Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get lat long from zip code in google places api

function getCoordinates(address){
  fetch("https://maps.googleapis.com/maps/api/geocode/json?address="+address+'&key='+API_KEY)
    .then(response => response.json())
    .then(data => {
      const latitude = data.results.geometry.location.lat;
      const longitude = data.results.geometry.location.lng;
      console.log({latitude, longitude})
    })
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #lat #long #zip #code #google #places #api
ADD COMMENT
Topic
Name
4+2 =