Commit 05b6902d by zhangxw

优化

1 parent d7d8953c
......@@ -534,7 +534,6 @@ Page({
if(that.data.sns){
opts.path = `${opts.path}?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`;
}
console.log(opts)
return opts;
}
})
\ No newline at end of file
......@@ -67,7 +67,6 @@ Page({
duration: 20000,
clickItem: null,
selectTime: '',
isReplayIng: false,
polyline: [],
includePoints: [],
speedItemsIndex: 0,
......@@ -170,20 +169,6 @@ 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: '暂无数据',
......@@ -208,22 +193,31 @@ Page({
},
beginTrack() {
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.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
this.myMap.getMapCtx().addMarkers({
markers: marker,
success: () => {
this.myMap.getMapCtx().moveAlong({
markerId: 1,
path: this.data.polyline[0].points,
duration: this.data.duration
})
},
fail: () => {
this.beginTrack()
}
})
}
},
// 暂停
......
......@@ -15,7 +15,7 @@
<!-- 回放控制按钮 -->
<view class="btn-control" slot="bottomBox">
<view class="icon icon-replay-play play-btn {{isReplayIng? '' : 'active'}}" bindtap="play"></view>
<view class="icon icon-replay-pause pause-btn {{isReplayIng? 'active' : ''}}" bindtap="pause"></view>
<!-- <view class="icon icon-replay-pause pause-btn {{isReplayIng? 'active' : ''}}" bindtap="pause"></view> -->
<view class="icon icon-replay-refresh refresh-btn active" bindtap="replayRefresh"></view>
</view>
<!-- 轨迹时间弹窗 -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!