How can I get the Latitude and Longitude of the zip code?

I need help to get Latitude and Longitude dynamically and longitude from a user entered zip code. so that I can work to show the store address in this zip code area.

+3
source share
4 answers

Google starts some kind of geocoding, you have to check it out, it can help you http://code.google.com/apis/maps/documentation/geocoding/

+4
source

http://code.google.com/apis/maps/documentation/geocoding/

There are some requirements for this, for example, you need to register your google account, but it is very simple, and you need to pass some parameter that is described there.

JSON XML .

+3

You have not indicated which country you want to do this in, but you can use the GeoNames API for postalCodeSearch.

For example (XML and JSON responses respectively)

http://api.geonames.org/postalCodeSearch?postalcode=90210&username=demo
http://api.geonames.org/postalCodeSearchJSON?postalcode=90210&username=demo
+2
source

Going a little deeper, you can get a JSON-encoded object from google from the following URL:

http://maps.googleapis.com/maps/api/geocode/json?address=ZIPCODE&sensor=false

just replace the ZIPCODE with the zipcode you need, and it should return you a json object with latitude and longitude coordinates.

+2
source

All Articles