Commit d7d8953c by zhangxw

轨迹回放真机bug

1 parent 073faa0e
...@@ -170,6 +170,20 @@ Page({ ...@@ -170,6 +170,20 @@ Page({
polyline: polyline, polyline: polyline,
includePoints: arr includePoints: arr
}) })
this.myMap.getMapCtx().removeMarkers({
markerIds: [1]
})
let marker = [{
id: 1,
width: 15,
height: 25,
latitude: this.data.polyline[0].points[0].latitude,
longitude: this.data.polyline[0].points[0].longitude,
iconPath: '../../images/car.png'
}]
this.myMap.getMapCtx().addMarkers({
markers: marker
})
} else { } else {
wx.showModal({ wx.showModal({
content: '暂无数据', content: '暂无数据',
...@@ -194,20 +208,6 @@ Page({ ...@@ -194,20 +208,6 @@ Page({
}, },
beginTrack() { beginTrack() {
if (this.data.polyline.length) { if (this.data.polyline.length) {
this.myMap.getMapCtx().removeMarkers({
markerIds: [1]
})
let marker = [{
id: 1,
width: 15,
height: 25,
latitude: this.data.polyline[0].points[0].latitude,
longitude: this.data.polyline[0].points[0].longitude,
iconPath: '../../images/car.png'
}]
this.myMap.getMapCtx().addMarkers({
markers: marker,
success: () => {
this.setData({ this.setData({
isReplayIng: true isReplayIng: true
}) })
...@@ -225,8 +225,6 @@ Page({ ...@@ -225,8 +225,6 @@ Page({
} }
}) })
} }
})
}
}, },
// 暂停 // 暂停
pause() { pause() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!