From 69b2bd6b6f4752075dd2a33c23cadf5b511b16e7 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 20 Apr 2023 16:21:50 +0800 Subject: [PATCH] 245 --- packages/grid/AppBuildMap/AppBuildMap.vue | 1 - project/fengdu/app/AppIntegratingTask/components/Add.vue | 4 +++- project/fengdu/app/AppIntegratingTask/components/Detail.vue | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/grid/AppBuildMap/AppBuildMap.vue b/packages/grid/AppBuildMap/AppBuildMap.vue index a66d2123..5ccd664a 100644 --- a/packages/grid/AppBuildMap/AppBuildMap.vue +++ b/packages/grid/AppBuildMap/AppBuildMap.vue @@ -381,7 +381,6 @@ export default { this.map.removeLayer(this.satellite) } - this.isImageMap = flag }, initMap({lng, lat}) { diff --git a/project/fengdu/app/AppIntegratingTask/components/Add.vue b/project/fengdu/app/AppIntegratingTask/components/Add.vue index 887dee48..3911a2da 100644 --- a/project/fengdu/app/AppIntegratingTask/components/Add.vue +++ b/project/fengdu/app/AppIntegratingTask/components/Add.vue @@ -220,6 +220,7 @@ export default { this.showMap = false }, initMap() { + if (this.map) return AMapLoader.load({ key: '54a02a43d9828a8f9cd4f26fe281e74e', version: '2.0', @@ -228,7 +229,7 @@ export default { this.map = new AMap.Map('map', { resizeEnable: true, zooms: [6, 20], - center:[this.lng, this.lat], + center: this.form.lng ? [this.form.lng, this.form.lat] : [this.lng, this.lat], zoom: 11, }) this.placeSearch = new AMap.PlaceSearch({ map: this.map }) @@ -286,6 +287,7 @@ export default { resizeEnable: true, zooms: [6, 20], zoom: 11, + center:[lng,lat], }) let marker = new AMap.Marker({ position: new AMap.LngLat(lng,lat), diff --git a/project/fengdu/app/AppIntegratingTask/components/Detail.vue b/project/fengdu/app/AppIntegratingTask/components/Detail.vue index d6c93ff8..a27e8f77 100644 --- a/project/fengdu/app/AppIntegratingTask/components/Detail.vue +++ b/project/fengdu/app/AppIntegratingTask/components/Detail.vue @@ -143,6 +143,7 @@ resizeEnable: true, zooms: [6, 20], zoom: 11, + center:[lng,lat], }) let marker = new AMap.Marker({ position: new AMap.LngLat(lng,lat),