Commit d7d8953c by zhangxw

轨迹回放真机bug

1 parent 073faa0e
......@@ -170,6 +170,20 @@ Page({
polyline: polyline,
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 {
wx.showModal({
content: '暂无数据',
......@@ -194,36 +208,20 @@ Page({
},
beginTrack() {
if (this.data.polyline.length) {
this.myMap.getMapCtx().removeMarkers({
markerIds: [1]
this.setData({
isReplayIng: true
})
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.myMap.getMapCtx().moveAlong({
markerId: 1,
path: this.data.polyline[0].points,
duration: this.data.duration,
success: (res) => {
this.setData({
isReplayIng: true
})
this.myMap.getMapCtx().moveAlong({
markerId: 1,
path: this.data.polyline[0].points,
duration: this.data.duration,
success: (res) => {
this.setData({
isReplayIng: false
})
},
fail: () => {
this.beginTrack()
}
isReplayIng: false
})
},
fail: () => {
this.beginTrack()
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!