diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index 1e2e9b4..d6287c3 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -547,7 +547,7 @@ // 根据平台渲染站点统计 loadSiteNumForOroject() { // console.log(this.platformtype, this.ChecksplatformCode); - + this.$http .post(this.nozzle.getSiteNum, { data: { platform: this.ChecksplatformCode, type: this.platformtype } @@ -762,6 +762,8 @@ this.ProjectList.forEach(item1 => { if (item1["groupName"] == item) { this.ChecksplatformCode = item1["groupNo"]; + //地图联动响应的项目 + this.initPointToMap(this.ChecksplatformCode) // 根据平台渲染站点数量统计及状态统计 this.loadSiteNumForOroject(); // 根据平台渲染项目设备总览 @@ -1344,6 +1346,24 @@ } this.source = new SourceVector({}); + //初始化kkLayer + if (this.vectorSource) { + this.vectorSource.clear(); + } + this.vectorSource = new SourceVector({ + wrapX: false, + }); + + this.vector = new LayerVector({ + source: this.vectorSource, + style: feature => { + return this.getStyleOfCar(feature); + } + }); + + + + var cell, resultwkt = ""; var feature; @@ -1434,7 +1454,11 @@ } } }); - this.map.addLayer(this.layer); + //?要判断currentZoom加哪一个 + if(this.currentZoom>=10) + this.map.addLayer(this.vector); + else + this.map.addLayer(this.layer); }, getStyleOfCar(feature) { @@ -1496,7 +1520,7 @@ this.REFSFunctionToGis(!this.switchStatusData); //定义无聚簇的layer - this.vectorSource = new SourceVector({ + /* this.vectorSource = new SourceVector({ //features: this.Features wrapX: false, }); @@ -1505,7 +1529,7 @@ style: feature => { return this.getStyleOfCar(feature); } - }); + }); */ // this.map.addLayer(this.vector); @@ -1581,6 +1605,7 @@ //鼠标移动事件 this.map.on("moveend", evt=> { var zoom=this.map.getView().getZoom() + console.log(zoom) if(zoom>=10&&this.currentZoom<10) /* if(this.map.getView().getZoom()>10) */