How to get the city name in the ngcordova Geolocation plugin?

Asked

Viewed 159 times

1

I have a mobile app with the plugin ngcodova Geolocation is working only with lat and long what I intend now and that the same instead of giving me the lat and long I gave it the name of the city as I can do ?

Controller

.controller('GeoCtrl', function($scope, $cordovaGeolocation) {
var posOptions = {timeout: 10000, enableHighAccuracy: false};
$cordovaGeolocation
  .getCurrentPosition(posOptions)
  .then(function (position) {
      var lat  = position.coords.latitude
      var long = position.coords.longitude
      alert(lat + " --- " + long);
  }, function(err) {
    // error
});
})
  • If Voce uses a map, like google, Voce may use https://developers.google.com/maps/documentation/javascript/geocoding

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.