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

后端 未结 4 1300
暗喜
暗喜 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: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
    

提交回复
热议问题