From 68d9f6b85690aa6402a69a1bc748be7129f39ed1 Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期一, 12 四月 2021 17:42:12 +0800 Subject: [PATCH] 功能底图切换标注 --- src/components/LayerController/logic/SolidWaste.js | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js index 3eee0e3..8f9e12b 100644 --- a/src/components/LayerController/logic/SolidWaste.js +++ b/src/components/LayerController/logic/SolidWaste.js @@ -4,7 +4,7 @@ // 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img const defaultImg = '/assets/images/map/solidwaste/voc.png' -const setting = '/assets/images/map/solidwaste/gf_green.png' +const setting = '/assets/images/map/solidwaste/gf_green2.png' // 璇锋眰鎺ュ彛鏁版嵁 const mapApi = require('../../../api/mapApi').default @@ -39,8 +39,8 @@ totransferData: getSolidWasteData[i], icon: L.icon({ iconUrl: iconUrl, - iconSize: [50, 50], - iconAnchor: [25, 25] + iconSize: [30, 30], + iconAnchor: [15, 15] }) }) layer.addLayer(marker) @@ -54,8 +54,6 @@ this.clickListener = (e) => { // 鐐瑰嚮marker鐨刾ulse()鍏夋尝 this.animalService.pulseEffect(e.latlng) - /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */ - // this.setPanTo(e.latlng, 200) /* 鐐瑰嚮鏁版嵁鐨勬帴鍙h姹� */ this.requestSolidWasteData(e).then(e) } @@ -73,27 +71,32 @@ // 鏍规嵁鐐瑰嚮涓嶅悓鏁版嵁 杩涜鎺ュ彛鐨勬暟鎹姹� this.requestSolidWasteData = async (e) => { - // 鍩烘湰淇℃伅灞曠ず + // 鍩烘湰淇℃伅 鍜� 璇︾粏淇℃伅 灞曠ず鏁版嵁鎵�闇�鍙傛暟 const dataValue = { StoragePlaceId: e.layer.options.totransferData.StoragePlaceId } + // 鍩烘湰淇℃伅 tabs const resultBasic = await mapApi.getSolidWasteBaseInfo(dataValue) - // 璇︾粏淇℃伅灞曠ず + // 璇︾粏淇℃伅灞曠ず table const resultDetailed = await mapApi.getSolidWasteDetail(dataValue) + // 缁戝畾寮规瀹炰緥 const PublicBounced = window.Vue.extend(publicBounced) const instance = new PublicBounced() instance.$mount() document.body.appendChild(instance.$el) - instance.setData(resultBasic.Result.DataInfo, resultDetailed, 'gufei') + // 閫氳繃鏂规硶 鍚戠粦瀹氬脊妗嗕紶閫掓暟鎹� + instance.setData(resultBasic.Result.DataInfo, resultDetailed.Result.DataInfo, '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) - // } + // flayTo() 寮规鐨勫彲婊戝姩浜嬩欢 + 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