|
@@ -115,7 +115,11 @@
|
|
|
var endLngLat = [_self.item.longitude,_self.item.latitude];
|
|
|
//_self.calculateDistance(startLngLat,endLngLat);
|
|
|
//let posCenter= {longitude: _self.longitude,latitude: _self.latitude};
|
|
|
-
|
|
|
+ var obj = {
|
|
|
+ longitude: longitude,
|
|
|
+ latitude: latitude
|
|
|
+ };
|
|
|
+ _self.$refs.amap.setPerson(obj);
|
|
|
_self.$refs.amap.calculateDistance(startLngLat,endLngLat).then(function(res){
|
|
|
|
|
|
_self.item.distance = res.distance/1000;
|
|
@@ -137,7 +141,7 @@
|
|
|
//this.message=JSON.stringify(res)
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
- title:JSON.stringify(error)
|
|
|
+ title:error//JSON.stringify(error)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -161,7 +165,7 @@
|
|
|
this.$refs.amap.setCenter(posCenter);
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
- title:JSON.stringify(error)
|
|
|
+ title:error//JSON.stringify(error)
|
|
|
})
|
|
|
})
|
|
|
|