The process of turning longitude and latitude into a human readable address is called Reverse Geocoding . Many map APIs support features such as Google Maps and Maps. Here's how you can do it using the Google Maps API.
API JavaScript Google
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en"></script>
API: angular
app.controller('geoLocationCtrl', function($scope, $window) {
$window.navigator.geolocation.getCurrentPosition(function(position) {
$scope.$apply(function() {
$scope.lat = position.Coordinates.latitude;
$scope.lng = position.Coordinates.longitude;
var geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng($scope.lat, $scope.lng);
var request = {
latLng: latlng
};
geocoder.geocode(request, function(data, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (data[0] != null) {
alert("address is: " + data[0].formatted_address);
} else {
alert("No address available");
}
}
})
console.log(position);
})
})
});