muhammed shanid

muhammed shanid

  • NA
  • 14
  • 409

location undefine when i convert lat&long to adderss format

Dec 7 2018 10:38 PM
var location;
var point = new google.maps.LatLng(data[key].latitude, data[key].longitude);
var geocoder = new google.maps.Geocoder();
geocoder.geocode({latLng: point},function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
location = results[0].formatted_address;
}
}
});
 
when i console location out side ofi this code its undifined

Answers (1)