From a70b76f5f880dc6dfc9da8754e1d117c7ca5c7e7 Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期一, 17 五月 2021 16:07:57 +0800 Subject: [PATCH] 公共flyTo方法 --- src/components/LayerController/logic/WasteGas.js | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/components/LayerController/logic/WasteGas.js b/src/components/LayerController/logic/WasteGas.js index 7d57975..6c2fe65 100644 --- a/src/components/LayerController/logic/WasteGas.js +++ b/src/components/LayerController/logic/WasteGas.js @@ -3,7 +3,8 @@ */ const AnimalService = require('../service/AnimalService').default // const AjaxUtils = require('../../../utils/AjaxUtils').default - +// 鍏叡鏂规硶 panTo() 寮曠敤 +const { setPanTo } = require('../../../utils/utils') // 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img // const ImgBlue = '/assets/images/map/exhaust/fq_blue.png' // const ImgGray = '/assets/images/map/exhaust/fq_gray.png' @@ -60,8 +61,9 @@ } this.clickListener = async (e) => { - console.log(e) + // console.log(e) this.animalService.pulseEffect(e.latlng) + setPanTo(e.latlng, 200) const title = e.layer.options.test.Name const res = e.layer.options.test window.$layer.open({ @@ -72,9 +74,8 @@ storagePlaceId: res } }, - title: title // 鏍囬 + title: '澶╂触鐭冲寲' + title // 鏍囬 }) - this.setPanTo(e.latlng, 150) } // 涓嶅悓绫诲瀷鍥剧墖鍔犺浇 this.differentTypes = (ContrLevel) => { @@ -91,12 +92,5 @@ // effectOfChange = ImgGray // } return effectOfChange - } - 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