From 1b09fe890938f123fbcccf235620384b7cd9b721 Mon Sep 17 00:00:00 2001 From: zhangshuaibao <15731629597@163.com> Date: 星期二, 30 三月 2021 17:36:31 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/BaseNav/SolidWaste/SolidWaste.js | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/BaseNav/SolidWaste/SolidWaste.js b/src/components/BaseNav/SolidWaste/SolidWaste.js index 54107a5..6df5e3e 100644 --- a/src/components/BaseNav/SolidWaste/SolidWaste.js +++ b/src/components/BaseNav/SolidWaste/SolidWaste.js @@ -52,20 +52,24 @@ // var url = Icon.options.iconUrl const marker = this.L.marker([positionX, positionY], { icon: Icon }) - // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 marker.bindTooltip(data[i].Name, { permanent: true, - offset: [0, 16], - direction: 'bottom', + offset: [0, -16], + direction: 'top', className: '' }) // 鐐瑰嚮 浜嬩欢 marker.on('click', (e) => { try { - console.log(e) + // console.log(e) + // console.log(this.map.getCenter()) + // console.log(this.map.setCenter([e.target.getLatLng().lat, e.target.getLatLng().lng])) + // this.map.flyTo([e.target.getLatLng().lat, e.target.getLatLng().lng]) + // this.map.panTo([e.target.getLatLng().lat, e.target.getLatLng().lng], 100) + this.setPanTo(e.target.getLatLng(), 30) this.EffectOfPulse(e.target.getLatLng()) - this.SolidWastePopup.setData(data[i]) + this.SolidWastePopup.setData(data[i], 'gufei') return this.SolidWastePopup.$el } catch (error) { console.log(error) @@ -75,6 +79,16 @@ this.SolidWasteLayerGroup.addLayer(marker) } } + } + + // panTo + setPanTo (pos, value) { + var position = pos + position = this.map.latLngToLayerPoint(position) + position.y += value + position = this.map.layerPointToLatLng(position) + this.map.setView(position) + // this.map.flyTo(position) } // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� @@ -106,7 +120,7 @@ // 鑴夊啿鏁堟灉璁剧疆瀹炵幇 EffectOfPulse (position, markers, layerGroup) { - // // 鍖哄垎鐩存帴鎵ц 鍜屽垽鏂墽琛岀殑涓嶅悓鍖哄埆 + // 鍖哄垎鐩存帴鎵ц 鍜屽垽鏂墽琛岀殑涓嶅悓鍖哄埆 var differentColor = '' if (markers) { differentColor = '#ff0000' @@ -140,7 +154,6 @@ var HeightLightTime = 5 var PulseNumber = 5 const pulseinterver = setInterval((e) => { - console.log(e) if (PulseNumber > 0) { PulseNumber-- } else { -- Gitblit v1.8.0