Hi
I would like assistance with getting city name from gps coords, I am using agm/core.
Here is my code that gets gps lat and long and its working on getting coords, I need to get a city name with the coords returned.
onLocate() {
const loader = this.loadingCtrl.create({
content: 'Getting your Location...'
});
loader.present();
this.geolocation
.getCurrentPosition()
.then((location) => {
loader.dismiss();
this.location.lat = location.coords.latitude;
this.location.lng = location.coords.longitude;
})
.catch((error) => {
loader.dismiss();
const toast = this.toastCtrl.create({
message: 'Could not get location, please pick it manually!',
duration: 2500
});
toast.present();
});
}