From 7cc92ee01124aa9bbc218216400b740476d08729 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 9 Jan 2023 17:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=9C=B0=E5=9B=BE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E5=85=83=E7=B4=A0=E5=86=8D=E6=B8=B2=E6=9F=93=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/packages/tools/AiMap.vue | 39 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ui/packages/tools/AiMap.vue b/ui/packages/tools/AiMap.vue index f8b4e5c5..fb5e2dc9 100644 --- a/ui/packages/tools/AiMap.vue +++ b/ui/packages/tools/AiMap.vue @@ -53,22 +53,25 @@ export default { Loca: {version: '2.0.0'} }).then(AMap => { this.mapLib = AMap - this.amap = new AMap.Map(this.$refs.amap, { - mapStyle, - viewMode, - terrain: true, - resizeEnable: true, - skyColor: "#082243", - zoom: 11, - ...this.ops - }) - this.amap.on('complete', () => { - this.amap.setFitView();//视口自适应 - }) this.$emit('update:lib', AMap) - this.$emit('update:map', this.amap) - this.$emit("loaded") - this.mapLoaded() + if (this.$refs.amap) { + this.amap = new AMap.Map(this.$refs.amap, { + mapStyle, + viewMode, + terrain: true, + resizeEnable: true, + skyColor: "#082243", + zoom: 11, + ...this.ops + }) + this.amap.on('complete', () => { + this.amap.setFitView();//视口自适应 + }) + + this.$emit('update:map', this.amap) + this.$emit("loaded") + this.mapLoaded() + } }) }, getMapArea() { @@ -216,7 +219,7 @@ export default { background: radial-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .6) 40%, #000 100%); } - :deep( .marker ){ + :deep( .marker ) { position: relative; & > img { @@ -240,11 +243,11 @@ export default { } } - :deep( .amap-logo), :deep( .amap-copyright ){ + :deep( .amap-logo), :deep( .amap-copyright ) { display: none !important; } - :deep( .amap-icon ){ + :deep( .amap-icon ) { width: 40px !important; height: 40px !important;