From 5b09630e62e8eb894c6184caa4f91e1ccc6c8318 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 10 Oct 2023 10:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9C=A8=E9=AB=98=E5=BE=B7AP?= =?UTF-8?q?I=20setFitView=E6=96=B9=E6=B3=95=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=82=B9=E5=92=8C=E7=BC=A9=E6=94=BE=E4=B8=8E?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=9A=84=E9=97=AE=E9=A2=98=E8=B0=83=E4=BC=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/AiDvRender.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/AiDvRender.vue b/components/AiDvRender.vue index 96e4bc6b..78c5958d 100644 --- a/components/AiDvRender.vue +++ b/components/AiDvRender.vue @@ -183,13 +183,6 @@ export default { this.timer && clearInterval(this.timer) if (AMap && map) { map.clearMap() - const center = map.getCenter() - const zoom = map.getZoom() - map.on('click', () => { - map.setZoomAndCenter(zoom, center) - map.setPitch(0) - this.mapDialog = false - }) const markers = Array.isArray(this.values) ? this.values : this.values.markers const polylines = Array.isArray(this.values) ? [] : this.values.polylines || [] markers.map(e => ({lng: e['经度'], lat: e['纬度'], label: e['地区名称'], ...e})).filter(e => e.lng).map((e) => { @@ -214,6 +207,13 @@ export default { map, strokeColor: "#00FFAE", ...e, path: e.path.map(p => new AMap.LngLat(p[1], p[0])) })) map.setFitView() + const center = map.getCenter() + const zoom = map.getZoom() + map.on('click', () => { + map.setZoomAndCenter(zoom, center) + map.setPitch(0) + this.mapDialog = false + }) this.data.is3d > 0 && map.setPitch(65) if (this.data.is3dAround == 1) { this.timer = setInterval(() => map.setRotation(360, false, 16000))