有关从latlong获取地址的问题

时间:2019-03-20 04:19:52

标签: typescript ionic4

我正在使用NativeReverseGeocoder从lat-long获取地址,但是它给出了如下响应:

this.nativeGeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude ).then(resp => {
      this.address =  resp[0].locality + " ," + resp[0].subAdministrativeArea + " ," + resp[0].administrativeArea + " ," + resp[0].postalCode + " ," + resp[0].countryName;
 	  console.log(this.address);

this.nativeGeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude ).then(resp => {
      this.address =  resp[0].locality + " ," + resp[0].subAdministrativeArea + " ," + resp[0].administrativeArea + " ," + resp[0].postalCode + " ," + resp[0].countryName;
      console.log("hhjj");
 	  console.log(this.address);

在此subLocality中,通途,subThoroughfare是空字段,有人可以告诉我如何获取完整地址吗?

0 个答案:

没有答案