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,
"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
......
......@@ -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;
......
......@@ -459,7 +459,8 @@ export default {
var self = this;
var points = null,lines = null,
layer = self.getLayerByName("ZDJBXX");
var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
// 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)
......@@ -516,7 +517,7 @@ export default {
}
self.$message.success("保存成功!!!");
self.goMap();
}
// }
});
}
},
......
......@@ -192,6 +192,7 @@ export default {
layerIds.push(djzqLayer.id);
layerIds.push(xjzqLayer.id);
var polygon = new Polygon(geometry);
identifyUtils.methods.identify(djqLayer.layerUrl,layerIds,polygon,function (res) {
var results = res.results;
var isJoint = false,layerName = "",message="";
......
......@@ -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];
......
......@@ -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);
view.map.add(mapImageLayer, 1);
let bdcdyLayer = new MapImageLayer({
url:self.bdcdyUrl,
id:"bdcdyLayer",
spatialReference:view.spatialReference
});
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);
......@@ -361,6 +373,7 @@ export default {
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,7 +90,9 @@ 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",
// 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:[],
......@@ -130,7 +132,7 @@ 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){
self.identify(self.url,[7, 9],geo,function(res){
var resultes = res.results;
if(resultes && resultes.length > 0){
self.$parent.delIdentifyData(resultes);
......
......@@ -31,7 +31,10 @@
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span class="setOpacity" v-if="data.type == 'layerGroup'">
<!-- <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,7 +181,8 @@
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:{
......@@ -214,11 +218,13 @@
djqList:[],
djzqList:[],
importDialog:false,
importGeo:""
importGeo:"",
layerManager: ['testLayer', 'bdcdyLayer', 'djfqLayer', 'zrdlLayer']
}
},
mounted(){
this.layerTreeData = layerTree;
},
methods:{
checkTreeNode(treeNode,checkNodeList){
......@@ -230,23 +236,41 @@
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) {
......@@ -274,9 +298,25 @@
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(){
......