3c119e75 by jikai

jikai commit

1 parent 2e330ad4
......@@ -5,28 +5,32 @@
"alpha":100,
"children":[
{
"label":"西安市阎良区",
"label":"西安市",
"id":"1-1",
"type":"layerGroup",
"alpha":100,
"children":[{
"label":"行政区划",
"id":"1-1-1",
"type":"layerGroup",
"name": "testLayer",
"alpha":100,
"children":[
{
"label":"行政区界限",
"id":"1-1-1-1",
"type":"layer",
"layerId":20,
"type":"layer",
"alpha": 100,
"name": "testLayer",
"layerId":0,
"children":null
},
{
"label":"行政区",
"id":"1-1-1-2",
"type":"layer",
"layerId":19,
"alpha": 100,
"name": "testLayer",
"layerId":1,
"children":null
}
]
......@@ -34,21 +38,25 @@
{
"label":"地籍分区",
"id":"1-1-2",
"type":"layerGroup",
"name": "djfqLayer",
"alpha":100,
"children":[
{
"label":"地籍区",
"id":"1-1-2-1",
"type":"layer",
"layerId":13,
"alpha": 100,
"name": "djfqLayer",
"layerId":0,
"children":null
},
{
"label":"地籍子区",
"id":"1-1-2-2",
"type":"layer",
"layerId":14,
"alpha": 100,
"name": "djfqLayer",
"layerId":1,
"children":null
}
]
......@@ -56,77 +64,96 @@
{
"label":"不动产单元",
"id":"1-1-3",
"type":"layerGroup",
"name": "bdcdyLayer",
"alpha":100,
"children":[
{
"label":"线状定着物",
"id":"1-1-3-1",
"type":"layer",
"layerId":7,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":0,
"children":null
},
{
"label":"宗海",
"id":"1-1-3-2",
"type":"layer",
"layerId":9,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":1,
"children":null
},
{
"label":"宗地",
"id":"1-1-3-3",
"type":"layer",
"layerId":8,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":2,
"children":null
},
{
"label":"林权",
"id":"1-1-3-4",
"type":"layer",
"layerId":5,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":3,
"children":null
},
{
"label":"构筑物",
"id":"1-1-3-5",
"type":"layer",
"layerId":2,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":4,
"children":null
},
{
"label":"面状定着物",
"id":"1-1-3-6",
"type":"layer",
"layerId":6,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":5,
"children":null
},
{
"label":"界址线",
"id":"1-1-3-7",
"type":"layer",
"layerId":4,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":6,
"children":null
},
{
"label":"点状定着物",
"id":"1-1-3-8",
"type":"layer",
"layerId":1,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":7,
"children":null
},
{
"label":"自然幢",
"id":"1-1-3-9",
"type":"layer",
"layerId":10,
"alpha": 100,
"name": "bdcdyLayer",
"layerId":8,
"children":null
},
{
"label":"界址点",
"id":"1-1-3-10",
"type":"layer",
"layerId":4,
"name": "bdcdyLayer",
"layerId":9,
"children":null
}
]
......@@ -134,28 +161,31 @@
{
"label":"自然地理",
"id":"1-1-4",
"type":"layerGroup",
"name": "zrdlLayer",
"alpha":100,
"children":[
{
"label":"辅助面",
"id":"1-1-4-1",
"type":"layer",
"layerId":15,
"name": "zrdlLayer",
"layerId":0,
"children":null
},
{
"label":"植被",
"id":"1-1-4-2",
"type":"layer",
"layerId":17,
"name": "zrdlLayer",
"layerId":1,
"children":null
},
{
"label":"水系",
"id":"1-1-4-3",
"type":"layer",
"layerId":16,
"name": "zrdlLayer",
"layerId":2,
"children":null
}
]
......
[{
"layerName": "ZDJBXX",
"layerLabel": "宗地",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id":8,
"layerUrl": "https://192.168.2.146:6443/arcgis/rest/services/qj/BDCDY/MapServer",
"id":2,
"fieldAliases": {
"BSM": "标识码",
"YSDM": "要素代码",
......@@ -40,7 +40,7 @@
"layerName": "ZRZ",
"layerLabel": "自然幢",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": 10,
"id": 9,
"fieldAliases": {
"YSDM": "要素代码",
"BDCDYH": "不动产单元号",
......@@ -72,8 +72,8 @@
{
"layerName": "DJQ",
"layerLabel": "地籍区",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": 13,
"layerUrl": "https://192.168.2.146:6443/arcgis/rest/services/qj/DJFQ/MapServer",
"id": 1,
"fieldAliases": {
"BSM": "标识码",
"YSDM": "要素代码",
......@@ -84,8 +84,8 @@
{
"layerName": "DJZQ",
"layerLabel": "地籍子区",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": 14,
"layerUrl": "https://192.168.2.146:6443/arcgis/rest/services/qj/DJFQ/MapServer",
"id": 0,
"fieldAliases": {
"BSM": "标识码",
"YSDM": "要素代码",
......@@ -96,8 +96,8 @@
{
"layerName": "XJZQ",
"layerLabel": "行政区",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": 19,
"layerUrl": "https://192.168.2.146:6443/arcgis/rest/services/qj/XZQH/MapServer",
"id": 1,
"fieldAliases": {
"BSM": "标识码",
"YSDM": "要素代码",
......@@ -109,13 +109,13 @@
{
"layerName":"JZD",
"layerLabel":"界址点",
"layerUrl":"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id":3
"layerUrl":"https://192.168.2.146:6443/arcgis/rest/services/qj/BDCDY/MapServer",
"id":9
},
{
"layerName":"JZX",
"layerLabel":"界址线",
"layerUrl":"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id":4
"layerUrl":"https://192.168.2.146:6443/arcgis/rest/services/qj/BDCDY/MapServer",
"id":6
}
]
\ No newline at end of file
......
......@@ -216,7 +216,7 @@ export default {
// if(item.dm == 'G' || item.dm == 'J' ||item.dm == 'Z'){
// this.$emit("changeCreateVisible", true);
// }
//判断楼盘类型
//判断楼盘类型
switch (item.type) {
case 'zd':
this.$emit("changeIsZD", true);
......
......@@ -572,6 +572,7 @@ export default {
this.$message.warning("不是临时数据,不能导入图形!!!");
return;
}
console.log(this.zdData);
var type = this.zdData.type;
if(type == "zd"){
BSM = this.zdData.zdbsm;
......@@ -579,7 +580,7 @@ export default {
BSM = this.zdData.bsm;
}
//当确定导入图形是 跳转到图形界面
this.queryGeoByBsm(BSM,type,function (features){
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0){
if(features[0].geometry && features[0].geometry.rings.length > 0){
self.$confirm('该条数据有地块信息,是否继续导入?', '提示', {
......
......@@ -381,7 +381,7 @@ export default {
if(valid){
//选择处理方式
var value = self.dealForm.method;
self.currntDealGraphic.attributes = {};
self.currntDealGraphic.attributes = {};
switch (value) {
case '1':self.currntDealGraphic.attributes.BGZT = 1;self.saveZd(self.currntDealGraphic);break;
case "2":self.getDifference(self.currntDealGraphic,self.overResults,self.delOverGeo);break;
......@@ -458,8 +458,9 @@ export default {
saveZd(graphic){
var self = this;
var points = null,lines = null,
layer = self.getLayerByName("ZDJBXX");
var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
layer = self.getLayerByName("ZDJBXX");
// var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
var featureUrl = layer.layerUrl;
featureUrl += "/"+layer.id;
if(self.geoInfo){
//替换 生成图像 高亮
......@@ -503,8 +504,8 @@ export default {
graphic.attributes = attributes;
self.addGraphic(featureUrl,graphic,function (res) {
var addRresult = res.addFeatureResults[0];
if(addRresult.objectId){
var OBJECTID = addRresult.objectId;
// if(addRresult.objectId){
// var OBJECTID = addRresult.objectId;
if(graphic.geometry) {
points = self.craetJZPoint(graphic);
self.savejzd(points)
......@@ -514,9 +515,9 @@ export default {
self.saveJzx(lines);
});
}
self.$message.success("保存成功!!!");
self.$message.success("保存成功!!!");
self.goMap();
}
// }
});
}
},
......
......@@ -191,7 +191,8 @@ export default {
layerIds.push(djqLayer.id);
layerIds.push(djzqLayer.id);
layerIds.push(xjzqLayer.id);
var polygon = new Polygon(geometry);
var polygon = new Polygon(geometry);
identifyUtils.methods.identify(djqLayer.layerUrl,layerIds,polygon,function (res) {
var results = res.results;
var isJoint = false,layerName = "",message="";
......
......@@ -10,13 +10,13 @@ export default {
"esri/tasks/support/IdentifyParameters"
]).then(([
IdentifyTask,
IdentifyParameters
IdentifyParameters
]) => {
var identifyTask = new IdentifyTask({
url:url
}),
identifyParameters = new IdentifyParameters();
identifyParameters.geometry = geometry;
identifyParameters.geometry = geometry;
if(layerIds){
identifyParameters.layerIds = layerIds;
}
......
......@@ -22,6 +22,8 @@ export default {
var featureLayer = new FeatureLayer({
url:url
})
console.log(featureLayer);
console.log(graphic);
var saveGraphics = [];
if(!Array.isArray(graphic)){
graphic = [graphic];
......@@ -45,7 +47,7 @@ export default {
}
featureLayer.applyEdits({
addFeatures:saveGraphics
}).then(function (res){
}).then(function (res){
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction(res);
}
......
......@@ -2,7 +2,7 @@
import {loadCss,loadScript} from "esri-loader"
export function init(){
loadScript({url:"http://192.168.2.38/4.16/init.js"});
loadCss("http://192.168.2.38/4.16/esri/themes/light/main.css");
loadScript({ url:"http://192.168.2.146/arcgis_js_api/library/4.17/init.js"});
loadCss("http://192.168.2.146/arcgis_js_api/library/esri/css/main.css");
}
init();
\ No newline at end of file
......
......@@ -177,7 +177,11 @@ export default {
data(){
return{
viewId:"testMap",
layerUrl:"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
// layerUrl:"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
layerUrl: 'https://192.168.2.146:6443/arcgis/rest/services/qj/XZQH/MapServer', // 行政区划
bdcdyUrl: 'https://192.168.2.146:6443/arcgis/rest/services/qj/BDCDY/MapServer', // 不动产单元
djfqUrl: 'https://192.168.2.146:6443/arcgis/rest/services/qj/DJFQ/MapServer', // 地籍分区
zrdlUrl: 'https://192.168.2.146:6443/arcgis/rest/services/qj/JCDL/MapServer', // 自然地理
dialogVisible:false,
selectResLayerId:null,
features:[],
......@@ -219,29 +223,37 @@ export default {
view.ui.move(["zoom"], "bottom-right");
loadModules([
"esri/layers/MapImageLayer"
]).then(([
MapImageLayer
])=>{
]).then(([ MapImageLayer ])=>{
var mapImageLayer = new MapImageLayer({
url:self.layerUrl,
id:"testLayer",
spatialReference:view.spatialReference,
sublayers:[
{
id:19,
visible:true
},
{
id:8,
visible:true
},
{
id:10,
visible:true
}
]
spatialReference:view.spatialReference
});
view.map.add(mapImageLayer, 1);
let bdcdyLayer = new MapImageLayer({
url:self.bdcdyUrl,
id:"bdcdyLayer",
spatialReference:view.spatialReference
});
view.map.add(mapImageLayer,1);
view.map.add(bdcdyLayer);
let djfqLayer = new MapImageLayer({
url:self.djfqUrl,
id:"djfqLayer",
visible: false,
spatialReference:view.spatialReference
});
view.map.add(djfqLayer);
let zrdlLayer = new MapImageLayer({
url:self.zrdlUrl,
id:"zrdlLayer",
visible: false,
spatialReference:view.spatialReference
});
view.map.add(zrdlLayer);
var query = self.$route.query;
if(query && JSON.stringify(query) != "{}"){
self.addGeoByBsm(query.bsm,query.type,self.viewId);
......@@ -355,12 +367,13 @@ export default {
self.features = [];
self.resultLayers = [];
this.heighGraphic = null;
//清除查询图层
//清除查询图层
this.clearSearchLayer(this.viewId);
this.totalResults = data.length;
this.totalResults = data.length;
for(var i = 0;i < data.length;i++){
var layerId = data[i].layerId;
var layer = self.getLayerById(layerId);
var layerResult = self.results.filter(function (item) {
return item.layerId == layerId;
})
......
......@@ -90,8 +90,10 @@ export default {
mixins:[draw,identifyUtils,measure,mapTools],
data(){
return{
url:"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
selectResLayerId:"",
// url:"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
// url: 'https://192.168.2.146:6443/arcgis/rest/services/qj/XZQH/MapServer',
url: 'https://192.168.2.146:6443/arcgis/rest/services/qj/BDCDY/MapServer',
selectResLayerId:"",
features:[],
resultLayers:[],
results:[],
......@@ -130,8 +132,8 @@ export default {
var view = maps[this.viewId];
var self = this;
this.initDraw("point",this.viewId,null,function(geo){
self.identify(self.url,[8,10],geo,function(res){
var resultes = res.results;
self.identify(self.url,[7, 9],geo,function(res){
var resultes = res.results;
if(resultes && resultes.length > 0){
self.$parent.delIdentifyData(resultes);
self.$parent.dialogVisible = true;
......
......@@ -30,8 +30,11 @@
:default-checked-keys="defaultSelectNodes"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span class="setOpacity" v-if="data.type == 'layerGroup'">
<span>{{ node.label }}</span>
<!-- <span class="setOpacity" v-if="data.type == 'layerGroup'">
<el-slider v-model="data.alpha" ref="data.id" :format-tooltip="formatTooltip" @change="alphaChange(data)"></el-slider>
</span> -->
<span class="setOpacity">
<el-slider v-model="data.alpha" ref="data.id" :format-tooltip="formatTooltip" @change="alphaChange(data)"></el-slider>
</span>
</span>
......@@ -178,22 +181,23 @@
return{
currentActivate:"",
layerTreeData:[],
defaultSelectNodes:['1-1-1-2','1-1-3-3','1-1-3-9'],
// defaultSelectNodes:['1-1-1-2','1-1-3-3','1-1-3-9'],
defaultSelectNodes: ['1-1-1', '1-1-3'],
layerUrl:"http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
sidePanelShow:false,
bufferParams:{
drawType:"",
distance:0,
layerId:[],
impotGeo:null,
selectDjq:"",
selectDjzq:""
},
activeName:'hzfw',
bufferLayers:[{
layerName:"宗地",
id:"8"
},
bufferParams:{
drawType:"",
distance:0,
layerId:[],
impotGeo:null,
selectDjq:"",
selectDjzq:""
},
activeName:'hzfw',
bufferLayers:[{
layerName:"宗地",
id:"8"
},
{
layerName:"自然幢",
id:"10"
......@@ -210,15 +214,17 @@
layerName:"宗海",
id:"9"
}],
bufferDialog:false,
djqList:[],
djzqList:[],
importDialog:false,
importGeo:""
bufferDialog:false,
djqList:[],
djzqList:[],
importDialog:false,
importGeo:"",
layerManager: ['testLayer', 'bdcdyLayer', 'djfqLayer', 'zrdlLayer']
}
},
mounted(){
this.layerTreeData = layerTree;
},
methods:{
checkTreeNode(treeNode,checkNodeList){
......@@ -229,24 +235,42 @@
if (checkNodeList.checkedNodes[i].id == treeNode.id) {
flag = true;
}
}
if(flag){
if(treeNode && treeNode.children){
var ids = [];
this.getChildrens(treeNode,ids);
this.addSublayers(this.viewId,ids);
}else{
this.addSublayers(this.viewId,[treeNode]);
}
}else{
if(treeNode && treeNode.children){
var ids = [];
this.getChildrens(treeNode,ids);
this.removeSublayer(this.viewId,ids);
}else{
this.removeSublayer(this.viewId,[treeNode]);
}
}
}
// **********************************************姬恺***************************************************************
var view = maps[this.viewId];
Object.prototype.toString.call(this.layerManager) === '[object Array]' && this.layerManager.forEach((e, i) => {
i || (this.layerManager = {});
this.layerManager[e] = view.map.findLayerById(e);
})
typeof treeNode.name === 'string' ? new Promise(r => {
typeof treeNode.layerId === 'number' ? r(treeNode.layerId) : this.layerManager[treeNode.name].visible = flag;
}).then(d => {
this.layerManager[treeNode.name].findSublayerById(d).visible = flag;
}) : Object.keys(this.layerManager).forEach(e => {
this.layerManager[e].visible = flag;
})
// **********************************************姬恺***************************************************************
// console.log(this.layerManager);
// if(flag){
// if(treeNode && treeNode.children){
// var ids = [];
// this.getChildrens(treeNode,ids);
// this.addSublayers(this.viewId,ids);
// }else{
// this.addSublayers(this.viewId,[treeNode]);
// }
// }else{
// if(treeNode && treeNode.children){
// var ids = [];
// this.getChildrens(treeNode,ids);
// this.removeSublayer(this.viewId,ids);
// }else{
// this.removeSublayer(this.viewId,[treeNode]);
// }
// }
},
//获取树节点选中的子节点
getChildrens(data, childrens) {
......@@ -273,10 +297,26 @@
alphaChange(nodeData){
if(nodeData.alpha == 0){
return;
}
var ids = [];
this.getChildrens(nodeData,ids);
this.setLayerOpacity(this.viewId,ids,nodeData.alpha);
}
// **********************************************姬恺***************************************************************
var view = maps[this.viewId];
Object.prototype.toString.call(this.layerManager) === '[object Array]' && this.layerManager.forEach((e, i) => {
i || (this.layerManager = {});
this.layerManager[e] = view.map.findLayerById(e);
})
typeof nodeData.name === 'string' ? new Promise(r => {
typeof nodeData.layerId === 'number' ? r(nodeData.layerId) : this.layerManager[nodeData.name].opacity = nodeData.alpha / 100;
}).then(d => {
this.layerManager[nodeData.name].findSublayerById(d).opacity = nodeData.alpha / 100;
}) : Object.keys(this.layerManager).forEach(e => {
this.layerManager[e].visible = nodeData.alpha / 100;
})
// **********************************************姬恺***************************************************************
// var ids = [];
// this.getChildrens(nodeData,ids);
// this.setLayerOpacity(this.viewId,ids,nodeData.alpha);
},
//缓冲区分析
bufferAnalysis(){
......