following example using cordova googlemaps plugin reverse geocoding, i always get not found, but when the latLng test in Google map there is retun address.
here is part of code i use :
searchLocation(data){
// data contain latLng from other function and tested has correct value
plugin.google.maps.Geocoder.geocode({
"position": data
}, (results) => {
if (results.length === 0) {
// Not found
return;
}
let address = [
results[0].subThoroughfare || "",
results[0].thoroughfare || "",
results[0].locality || "",
results[0].adminArea || "",
results[0].postalCode || "",
results[0].country || ""].join(", ");
this.presentToast('Location address :'+ address);
// marker.setTitle(address)
// .showInfoWindow();
});
}
“cordova-plugin-googlemaps”: “^2.2.5”,
ionic info :
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.9.4
npm : 5.6.0
OS : Windows 10
thank you