How can I get the Latitude and Longitude of a ZIP Code?

后端 未结 4 1301
暗喜
暗喜 2021-01-06 14:38

I need some help to get the Latitude and Longitude dynamically of a ZIP Code entered by the user. so that i can work to show the shop address on those area of zip code.

相关标签:
4条回答
  • 2021-01-06 15:10

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

    There is some requirements for that like you have to register your google account for that but it's very easy and you have to pass some parameter which is describe at there.

    You can make using JSON or XML as per your requirements.

    0 讨论(0)
  • 2021-01-06 15:14

    You haven't specified what country you're looking to do this for 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
    
    0 讨论(0)
  • 2021-01-06 15:20

    Going a little more in depth, 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 that you would like and it should return to you a json object with the latitude and longitude coordinates.

    0 讨论(0)
  • 2021-01-06 15:28

    Google is running some kind of geocoding, you should check it out, it might help you http://code.google.com/apis/maps/documentation/geocoding/

    0 讨论(0)
提交回复
热议问题