Jelajahi Sumber

fix bug of pois

maguohua1 6 tahun lalu
induk
melakukan
d3eb9c82ad
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      prototype/addressComponent.js

+ 3 - 2
prototype/addressComponent.js

@@ -186,10 +186,11 @@ class AddressComponent extends BaseComponent {
 	//通过geohash获取精确位置
 	async getpois(lat, lng){
 		try{
-			const res = await this.fetch('http://apis.map.qq.com/ws/geocoder/v1/', {
+			const params = {
 				key: this.tencentkey,
 				location: lat + ',' + lng
-			})
+			};
+			let res = await this.fetch('http://apis.map.qq.com/ws/geocoder/v1/', params);
 			if (res.status != 0) {
 				params.key = this.tencentkey2;
 	 			res = await this.fetch('http://apis.map.qq.com/ws/geocoder/v1/', params);