From 50b5bca4861dbeb97b6a817f03c24c919ebaab40 Mon Sep 17 00:00:00 2001
From: 陈泽平 <qibolin02429@126.com>
Date: 星期一, 17 五月 2021 13:24:32 +0800
Subject: [PATCH] 企业点展示控制
---
src/components/LayerController/logic/Company.js | 37 ++++++++-----------------------------
1 files changed, 8 insertions(+), 29 deletions(-)
diff --git a/src/components/LayerController/logic/Company.js b/src/components/LayerController/logic/Company.js
index 962ec96..d6b7ea2 100644
--- a/src/components/LayerController/logic/Company.js
+++ b/src/components/LayerController/logic/Company.js
@@ -14,7 +14,6 @@
* 杩斿洖marker瀵硅薄鏁扮粍
* @param L leaflet瀵硅薄
*/
-
this.init = async (layer, L) => {
this.animalService = new AnimalService({
L: L,
@@ -40,29 +39,11 @@
className: 'company-bindTooltip',
iconSize: 16
})
-
const marker = L.marker([positionX, positionY], {
- /* icon: L.icon({
- iconUrl: iconUrl,
- iconSize: [30, 30],
- iconAnchor: [15, 15]
- }), */
icon: myIcon,
test: data[i]
})
- /* const htmls = '<ul><li>' + data[i].name + '</li></ul>'
- marker.bindTooltip(htmls, {
- permanent: true,
- offset: [0, 5],
- direction: 'bottom',
- className: 'company-bindTooltip'
- }) */
- // layer.addLayer(marker)
- if (window.map.getZoom() <= 5) {
- layer.addLayer(marker)
- } else if (window.map.getZoom() >= 12) {
- layer.removeLayer()
- }
+ layer.addLayer(marker)
}
}
/*
@@ -80,15 +61,13 @@
*
* */
this.clickListener = (e) => {
- console.log(e)
- window.map.setView(e.latlng, 13)
- if (window.map.getZoom() >= 12) {
- e.layer.remove()
- }
- // if (window.map.getZoom() <= 5) {
- // e.layer.addLayer()
- // } else if (window.map.getZoom() >= 12) {
- // e.layer.removeLayer()
+ // console.log(e)
+ window.map.setView(e.latlng, 15)
+ // if (window.map.getZoom() >= 10) {
+ // window.map.removeLayer(e.layer)
+ // e.layer.remove()
+ // } else if (window.map.getZoom() < 10) {
+ // window.map.addLayer(e.layer)
// }
// const dataValue = {
// StoragePlaceId: e.layer.options.test.name
--
Gitblit v1.8.0