From f2bea0366a17fb0cc0cce361e7f562e5b9891d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=83=A8=E7=99=BD=E7=9A=84=E7=94=9F=E7=89=A9?= <841248127@qq.com> Date: Thu, 28 Apr 2022 02:09:45 +0000 Subject: [PATCH] =?UTF-8?q?update=20docs/api/location/map.md.=20Object.ass?= =?UTF-8?q?ign(marker,=20p)=20=E6=94=B9=E5=8F=98=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=20marker=20,=20=E5=BE=AA=E7=8E=AF=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E4=BB=A5=E5=90=8E=E6=8B=BF=E5=88=B0=E7=9A=84=20marker?= =?UTF-8?q?s=20=E9=87=8C=E9=9D=A2=E6=98=AF=E9=87=8D=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E6=9D=A1=E6=95=B0=E6=8D=AE,=E6=AD=A4?= =?UTF-8?q?=E6=97=B6=20addMarkers=20=E4=BC=9A=E4=BA=A7=E7=94=9F=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/location/map.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/api/location/map.md b/docs/api/location/map.md index 37428e3e1..985ebcb0e 100644 --- a/docs/api/location/map.md +++ b/docs/api/location/map.md @@ -333,18 +333,17 @@ mapContext const markers = [] positions.forEach((p, i) => { - const newMarker = Object.assign(marker, p) + const newMarker = Object.assign({},marker, p) newMarker.id = i + 1 newMarker.label.content = `label ${i + 1}` markers.push(newMarker) - - this._mapContext.addMarkers({ + }) + this._mapContext.addMarkers({ markers, clear: false, complete(res) { console.log('addMarkers', res) } - }) }) } } -- GitLab