Commit 280269bb by zhangxw

自测 修改问题

1 parent 05b6902d
......@@ -6,6 +6,7 @@ Component({
multipleSlots: true
},
properties: {
markers: Array,
polyline: Array,
isLoading: Boolean,
includePoints: Array // 当前页面是否有marker或路径的左边点
......
<view class="map-wrap">
<!-- 地图组件 -->
<map id="Mymap" class="my-map" polyline="{{polyline}}" longitude="{{currentLo}}" latitude="{{currentLa}}" scale="{{scale}}" enable-satellite="{{enableSatellite}}" bindmarkertap="bindmarkertap" data-num="1" enable-traffic="{{enableTraffic}}" show-location bindtap="mapClick">
<map id="Mymap" class="my-map" polyline="{{polyline}}" markers="{{markers}}" longitude="{{currentLo}}" latitude="{{currentLa}}" scale="{{scale}}" enable-satellite="{{enableSatellite}}" bindmarkertap="bindmarkertap" data-num="1" enable-traffic="{{enableTraffic}}" show-location bindtap="mapClick">
</map>
<!-- 地图控件 -->
<text class="icon icon-locate map-cmd-icon" catchtap="locateClick">
......
......@@ -78,7 +78,7 @@ Page({
let points = this.data.points
WXRequest.get('trialdrive/api/vehicle/location', {
sns: this.data.sns
}, true).then(e => {
}, true, true).then(e => {
let includePoints = this.data.includePoints
if (e.code == 200 && e.data.length > 0) {
// 逆地址解析
......@@ -168,6 +168,8 @@ Page({
})
}
})
} else {
this.moveToLocation(Number(e.data[0].gpsLocation.elat), Number(e.data[0].gpsLocation.elng))
}
}
timeoutId = setTimeout(() => {
......
......@@ -58,7 +58,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.myMap = this.selectComponent('#myMap')
},
// 刷新
refresh() {
......@@ -70,10 +70,11 @@ Page({
polyline: [],
includePoints: [],
speedItemsIndex: 0,
isReplayIng: false
isReplayIng: false,
markers: []
})
this.myMap.getMapCtx().removeMarkers({
markerIds: [1, 2]
markerIds: [2]
})
},
// 获取定位
......@@ -121,9 +122,19 @@ Page({
return false
} else {
this.setData({
isShowModel: false
isShowModel: false,
polyline: [],
includePoints: [],
speedItemsIndex: 0,
isReplayIng: false,
markers: []
})
this.myMap.getMapCtx().removeMarkers({
markerIds: [2],
complete: () => {
this.getData()
}
})
this.getData()
}
},
// 选择固定时间段
......@@ -193,11 +204,8 @@ Page({
},
beginTrack() {
if (this.data.polyline.length) {
this.myMap.getMapCtx().removeMarkers({
markerIds: [1]
})
let marker = [{
id: 1,
id: 105,
width: 15,
height: 25,
latitude: this.data.polyline[0].points[0].latitude,
......@@ -205,19 +213,17 @@ Page({
iconPath: '../../images/car.png'
}]
this.setData({
isReplayIng: true
isReplayIng: true,
markers: marker
})
this.myMap.getMapCtx().addMarkers({
markers: marker,
success: () => {
this.myMap.getMapCtx().moveAlong({
markerId: 1,
path: this.data.polyline[0].points,
duration: this.data.duration
})
this.myMap.getMapCtx().moveAlong({
markerId: 105,
path: this.data.polyline[0].points,
duration: this.data.duration,
fail: () => {
this.beginTrack()
}
})
}
},
// 暂停
......
......@@ -89,9 +89,11 @@ module.exports = {
});
})
},
get(url, data, isNewFindCar){
get(url, data, isNewFindCar, notShowLoading){
return new Promise(function(resolve, reject){
wx.showLoading();
if (!notShowLoading) { // 实时监控不显示加载中
wx.showLoading();
}
//wx.setStorageSync('sessionid', 'JSESSIONID=node03r5y0xa3w4fh1jdk4e2q4oz860.node0;Path=/otmini')
const params = {
header: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!