Commit 05b6902d by zhangxw

优化

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