From 5435c8ffd568bf0a8b96fefa9912126bf110d582 Mon Sep 17 00:00:00 2001 From: Vce Date: Thu, 11 Apr 2024 15:43:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=B8=BD=E3=80=81=E6=9C=BA=E6=A2=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=AE=9A=E4=BD=8D=E5=AE=89=E5=85=A8=E5=B8=BD=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E3=80=81=E8=B5=B7=E7=82=B9=E5=9B=BE=E6=A0=87=E3=80=81?= =?UTF-8?q?=E7=BB=88=E7=82=B9=E5=9B=BE=E6=A0=87=E5=9B=BE=E6=A0=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digitalConstruction/equipmentPosition/index.vue | 5 +++-- .../digitalConstruction/smartSafeHat/index.vue | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/views/sevenLargeScreen/digitalConstruction/equipmentPosition/index.vue b/src/views/sevenLargeScreen/digitalConstruction/equipmentPosition/index.vue index 287bca8..d495c50 100644 --- a/src/views/sevenLargeScreen/digitalConstruction/equipmentPosition/index.vue +++ b/src/views/sevenLargeScreen/digitalConstruction/equipmentPosition/index.vue @@ -1015,7 +1015,8 @@ function trackMapInit(path: any, item: any) { // 将 icon 传入 marker let startMarker = new AMap.Marker({ position: path[0], - icon: startPointIcon + icon: startPointIcon, + offset: new AMap.Pixel(-15, -40) }); // 创建一个 icon @@ -1029,7 +1030,7 @@ function trackMapInit(path: any, item: any) { let endMarker = new AMap.Marker({ position: path[path.length - 1], icon: endPointIcon, - offset: new AMap.Pixel(-15, -20) + offset: new AMap.Pixel(-15, -40) }); // 将 markers 添加到地图 diff --git a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue index 98d66ca..e763d02 100644 --- a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue +++ b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue @@ -1352,7 +1352,8 @@ function trackMapInit(path: any, item: any) { // 将 icon 传入 marker let startMarker = new AMap.Marker({ position: path[0], - icon: startPointIcon + icon: startPointIcon, + offset: new AMap.Pixel(-15, -40) }); // 创建一个 icon @@ -1366,7 +1367,8 @@ function trackMapInit(path: any, item: any) { let endMarker = new AMap.Marker({ position: path[path.length - 1], icon: endPointIcon, - offset: new AMap.Pixel(-15, -20) + // offset: new AMap.Pixel(-15, -20) + offset: new AMap.Pixel(-15, -40) }); // 将 markers 添加到地图 @@ -1405,10 +1407,10 @@ function trackMapInit(path: any, item: any) { position: path[0], // icon: "https://webapi.amap.com/images/car.png", // icon: "src/assets/images/smartSafeHat.png", // 自定义图标 - icon: smartSafeHat, // 自定义图标 + icon: smartSafeHat2, // 自定义图标 // icon: "@/assets/images/carPosition/carIcon.png", // 自定义图标 // icon: "src/assets/images/carPosition/carIcon.png", // 自定义图标 - offset: new AMap.Pixel(-26, -13), + offset: new AMap.Pixel(-14, -13), autoRotation: true, angle: 90 }); @@ -1602,7 +1604,7 @@ function addMarker() { // 图标的取图地址 image: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png", // 图标所用图片大小 - imageSize: new AMap.Size(25, 34) + imageSize: new AMap.Size(25, 34), // 图标取图偏移量 // imageOffset: new AMap.Pixel(-9, -3) });