From 4df2f8b18bca292d3cc4d147a8e844c9610bef3b Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 12 八月 2024 13:40:58 +0800 Subject: [PATCH] 你可以和他对话得到想要的答案 --- miniprogram/components/chat-components/summary/map/map.ts | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/miniprogram/components/chat-components/summary/map/map.ts b/miniprogram/components/chat-components/summary/map/map.ts index 5b549b6..ec4a872 100644 --- a/miniprogram/components/chat-components/summary/map/map.ts +++ b/miniprogram/components/chat-components/summary/map/map.ts @@ -16,13 +16,40 @@ * 缁勪欢鐨勫垵濮嬫暟鎹� */ data: { - mapId: uuid() + mapId: uuid(), + marker: [] }, /** * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { + addMarker() { + this.setData({ + marker: (this.data.data?.values ?? []).map(item => ({ + id: 4, + latitude: item.posx, + longitude: item.posy, + // iconPath: '/assets/tabbar/yingyongchengxu.png', + customCallout: { + anchorY: 0, + anchorX: 20, + display: 'ALWAYS', + }, + })) + }) + // this.data.marker.push({ + // id: 4, + // latitude: 23.095994, + // longitude: 113.325520, + // iconPath: '/image/location.png', + // customCallout: { + // anchorY: 0, + // anchorX: 20, + // display: 'ALWAYS', + // }, + // }) + } }, lifetimes: { @@ -46,6 +73,7 @@ latitude: this.data.data.maxy } }) + this.addMarker(); }, 300); -- Gitblit v1.9.3