Answers for "get latlng from google places api"

0

get latlng from google places api

function GetLatlong() {
  var geocoder = new google.maps.Geocoder();
  var address = document.getElementById('textboxid').value;

  geocoder.geocode({
    'address': address
  }, function(results, status) {

    if (status == google.maps.GeocoderStatus.OK) {
      var latitude = results[0].geometry.location.lat();
      var longitude = results[0].geometry.location.lng();
    }
  });
}
Posted by: Guest on September-19-2021

Browse Popular Code Answers by Language