From 505798927f75c84693cc51becf16aa525503fc92 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 11 七月 2024 17:23:38 +0800 Subject: [PATCH] 2024.7.11 --- src/utils/map/marks.js | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/utils/map/marks.js b/src/utils/map/marks.js index 8882fea..774a700 100644 --- a/src/utils/map/marks.js +++ b/src/utils/map/marks.js @@ -127,5 +127,19 @@ } return layer + }, + + drawMarker(title, lnglat, img) { + const marker = new AMap.Marker({ + position: new AMap.LngLat(lnglat[0], lnglat[1]), // 缁忕含搴﹀璞★紝涔熷彲浠ユ槸缁忕含搴︽瀯鎴愮殑涓�缁存暟缁刐116.39, 39.9] + title: title, + // offset: new AMap.Pixel(-13, -12), + // anchor: 'center', + icon: new AMap.Icon({ + image: img, + imageSize: [30, 30] + }) + }) + map.add(marker) } } -- Gitblit v1.9.3