From 93c23192519a2872b3ed4e18649b6ac2ffe5987f Mon Sep 17 00:00:00 2001 From: qq_40649554 Date: Tue, 10 Jan 2023 13:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E6=B3=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/location/map.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/api/location/map.md b/docs/api/location/map.md index b18d6c121..fa69311bd 100644 --- a/docs/api/location/map.md +++ b/docs/api/location/map.md @@ -375,10 +375,28 @@ App nvue 3.6.9+ 支持 const markers = [] positions.forEach((p, i) => { - const newMarker = Object.assign({},marker, p) - newMarker.id = i + 1 - newMarker.label.content = `label ${i + 1}` - markers.push(newMarker) + console.log(i) + markers.push({ + latitude: p.latitude, + longitude: p.longitude, + id: i + 1, + iconPath: img, + width: 50, + height: 50, + joinCluster: true, // 指定了该参数才会参与聚合 + label: { + width: 50, + height: 30, + borderWidth: 1, + borderRadius: 10, + bgColor: '#ffffff', + content: i + "" + } + }) + // const newMarker = Object.assign({},marker, p) + // newMarker.id = i + 1 + // newMarker.label.content = `label ${i + 1}` + // markers.push(newMarker) }) this._mapContext.addMarkers({ markers, -- GitLab