diff --git a/docs/api/location/map.md b/docs/api/location/map.md index 37428e3e1ff725a083568d95ea77cb33be60a831..985ebcb0ed465080c30a0c08f5303b78ef61b0ac 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) } - }) }) } }