Get latitude and longitude based on location name with Google Autocomplete API
问题 I have a textbox in my page which gets a location name and button with text getLat&Long . Now on clicking my button I have to show an alert of latitude and longitude of the location in the textbox. Any suggestion? 回答1: You can use the Google Geocoder service in the Google Maps API to convert from your location name to a latitude and longitude. So you need some code like: var geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; geocoder.geocode( {