diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index b87030c..0912c2e 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -1026,6 +1026,7 @@ if (this.vectorSourceArea) { this.vectorSourceArea.clear(); } + } // 限制数组的长度不超过10个 @@ -1082,6 +1083,7 @@ if (this.vectorSourceArea) { this.vectorSourceArea.clear(); } + } // 根据平台渲染站点数量统计及状态统计 this.loadSiteNumForOroject(); @@ -1541,15 +1543,22 @@ if (this.vectorSourceArea) { this.vectorSourceArea.clear(); } + //删除行政区域图层 + /* var layers=this.map.getLayers().array_; + for(var i=0;i { + //先删除图层 + if(this.vectorArea) + this.map.removeLayer(this.vectorArea) // console.log(response); let dataJson = response.data.features[0]; // console.log(dataJson); @@ -1560,7 +1569,8 @@ features: areaFeature }); - this.vectorArea = new LayerVector({ + this.vectorArea = new LayerVector({ + layername:"xingzhengbianma", renderMode: "image", maxResolution: 2, zIndex: 2, @@ -1574,9 +1584,10 @@ }) }); } - }); - this.map.addLayer(this.vectorArea); - + }); + + this.map.addLayer(this.vectorArea); + //定位过去 //开始根据routeFeature定位 /* console.log(areaFeature[0].getGeometry().getExtent()) @@ -1586,56 +1597,7 @@ }); }, - gotoProgramArea1(areaCode) { - //初始化项目行政区域边框 - // Create layer - if (this.vectorSourceArea) { - this.vectorSourceArea.clear(); - } - - /* let response = await fetch( - "https://geo.datav.aliyun.com/areas_v2/bound/" + areaCode + ".json" - ); - - let dataJson = await response.json(); */ - this.$http - .get(this.nozzle.queueadmin + "/" + areaCode + ".json") - .then(response => { - console.log(response); - let dataJson = response.data.features[0]; - console.log(dataJson); - - let areaFeature = new GeoJSON().readFeatures(dataJson); - - this.vectorSourceArea = new SourceVector({ - features: areaFeature - }); - - this.vectorArea = new LayerVector({ - renderMode: "image", - maxResolution: 2, - zIndex: 2, - source: this.vectorSourceArea, - style: feature => { - return new Style({ - stroke: new Stroke({ - color: "#8A2BE2", - lineCap: "butt", - width: 3 - }) - }); - } - }); - this.map.addLayer(this.vectorArea); - - //定位过去 - //开始根据routeFeature定位 - /* console.log(areaFeature[0].getGeometry().getExtent()) - console.log(areaFeature[0].geometryChangeKey_.target.extent_) */ - var extent = areaFeature[0].getGeometry().getExtent(); - this.map.getView().fit(extent, this.map.getSize()); - }); - }, + //显示cluster聚簇界面 showCluster(clusterData) { //初始化kkLayer @@ -1644,6 +1606,9 @@ } this.source = new SourceVector({}); + if(this.vector) + this.map.removeLayer(this.vector) + //初始化kkLayer if (this.vectorSource) { this.vectorSource.clear(); @@ -1659,10 +1624,11 @@ } }); + + var cell, resultwkt = ""; var feature; - var keydataStruct; this.north = -90; this.south = 90; this.east = -180; @@ -1848,6 +1814,9 @@ // this.map.addLayer(this.vector); + + + this.$http .post(this.nozzle.listStationBase, { data: {