From 8b0a709a5b67eefd575cbe593b44a9ed8396804a Mon Sep 17 00:00:00 2001
From: chenzeping <ChenZeping02609@163.com>
Date: 星期四, 01 四月 2021 14:31:54 +0800
Subject: [PATCH] 公共文件修改

---
 src/components/LayerController/logic/SolidWaste.js |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js
index 3eee0e3..bb980a5 100644
--- a/src/components/LayerController/logic/SolidWaste.js
+++ b/src/components/LayerController/logic/SolidWaste.js
@@ -43,6 +43,12 @@
           iconAnchor: [25, 25]
         })
       })
+      marker.bindTooltip(getSolidWasteData[i].Name, {
+        permanent: true,
+        offset: [0, 14],
+        direction: 'bottom',
+        className: 'company-bindTooltip'
+      })
       layer.addLayer(marker)
     }
   }
@@ -54,8 +60,6 @@
   this.clickListener = (e) => {
     // 鐐瑰嚮marker鐨刾ulse()鍏夋尝
     this.animalService.pulseEffect(e.latlng)
-    /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */
-    // this.setPanTo(e.latlng, 200)
     /* 鐐瑰嚮鏁版嵁鐨勬帴鍙h姹� */
     this.requestSolidWasteData(e).then(e)
   }
@@ -86,14 +90,16 @@
     instance.$mount()
     document.body.appendChild(instance.$el)
     instance.setData(resultBasic.Result.DataInfo, resultDetailed, 'gufei')
+    /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */
+    this.setPanTo(e.latlng, 200)
   }
 
   // flayTo()
-  // this.setPanTo = (pos, value) => {
-  //   var position = pos
-  //   position = this.map.latLngToLayerPoint(position)
-  //   position.y += value
-  //   position = this.map.layerPointToLatLng(position)
-  //   this.map.flyTo(position)
-  // }
+  this.setPanTo = (pos, value) => {
+    var position = pos
+    position = window.map.latLngToLayerPoint(position)
+    position.y += value
+    position = window.map.layerPointToLatLng(position)
+    window.map.flyTo(position)
+  }
 }

--
Gitblit v1.8.0