Consult ZIP code by user location

Asked

Viewed 528 times

1

There is some way to query the ZIP code from the user’s location, provided by the browser. Type given latitude and longitude return ZIP of past coordinates.

It would be something like:

function getCEP(lantitude, longitute) {
  // retorna o cep associado as coordenadas passadas
}
  • It depends a lot, I’ve used the service of Google Maps for this, but many addresses do not bring the full zip code, or even bring. To solve I set up my base with Postgis loading information from Openstreetmap and the base of the post office, a certain work but the result is much better. About the Google service you can see several examples in the documentation itself: https://developers.google.com/maps/documentation/geocoding/start?hl=pt-br https://developers.google.com/maps/documentation/geocoding/introhl=pt-br#Reversegeocoding

  • Vlw @Heberminetto can solve here, with your tip. Using Google Maps, it is not as accurate as you said, but it worked right.

  • If you reopen the question posed my solution...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.