From e955287ac83d12c1545db512d9af7ed5a15db21c Mon Sep 17 00:00:00 2001 From: chenyabin <Chenab123!> Date: 星期一, 10 五月 2021 15:05:47 +0800 Subject: [PATCH] 管线搜索弹框整体调整 --- src/components/LayerController/service/WmsLayerService.js | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/components/LayerController/service/WmsLayerService.js b/src/components/LayerController/service/WmsLayerService.js index 38758ff..8c0d5dc 100644 --- a/src/components/LayerController/service/WmsLayerService.js +++ b/src/components/LayerController/service/WmsLayerService.js @@ -131,15 +131,18 @@ autoClose: false }) .openPopup() */ - window.$layer.open({ - content: { - content: Popup, // 缁勪欢 - data: { // 浼犻�掔殑鍙傛暟 - datas: popupDatas - } - }, - title: '' // 鏍囬 - }) + + if (window.layerFactory.clickSwitch) { + window.$layer.open({ + content: { + content: Popup, // 缁勪欢 + data: { // 浼犻�掔殑鍙傛暟 + datas: popupDatas + } + }, + title: '' // 鏍囬 + }) + } // this.popupComp.setDatas(popupDatas) // this.popupComp.setShow() } @@ -148,7 +151,7 @@ }) } - reverse (feature) { + reverseMultiLine (feature) { const coordinates = feature.geometry.coordinates var latlng = [] for (var j = 0; j < coordinates.length; j++) { @@ -163,15 +166,27 @@ return latlng } + reversePolyLine (feature) { + const coordinates = feature.geometry.coordinates + var latlng = [] + for (var j = 0; j < coordinates.length; j++) { + const coordinate = coordinates[j] + latlng.push(coordinate.reverse()) + } + return latlng + } + highlight (feature) { const type = feature.geometry.type if (type === 'MultiLineString') { - this.L.polyline(this.reverse(feature), { color: 'red' }).addTo(this.featureGroup) + this.L.polyline(this.reverseMultiLine(feature), { color: 'red' }).addTo(this.featureGroup) } else if (type === 'Point') { var myIcon = this.L.divIcon({ className: 'my-div-icon' }) this.L.marker(feature.geometry.coordinates.reverse(), { icon: myIcon }).addTo(this.featureGroup) + } else if (type === 'LineString') { + this.L.polyline(this.reversePolyLine(feature), { color: 'red' }).addTo(this.featureGroup) } } } -- Gitblit v1.8.0