Selaa lähdekoodia

站点详细地图当前位置显示

zhupeng 3 vuotta sitten
vanhempi
commit
5bfc4026c0
1 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 7 3
      pages/searchPile/stationAndPile/stationDetailsMap.vue

+ 7 - 3
pages/searchPile/stationAndPile/stationDetailsMap.vue

@@ -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)
 					})					
 				})