ZipCode from location

后端 未结 3 555
野趣味
野趣味 2020-12-06 08:13

Is there any way to get zip-code of the current user location from location or lat or long. If so how?

3条回答
  •  长情又很酷
    2020-12-06 08:29

    Yes you can...All you need to do is extract the

    http://maps.google.com/maps/geo?ll=latitude,longitude

    http://maps.google.com/maps/geo?ll=10.345561,123.896932
    

    Or try experimenting this solutions.I can give you an idea.

    You can have a city right? WIth this json data, If you have a database(at maxmind.com) of the zipcode with this format

    CountryCode | City | ZipCode


    PH |Cebu |6000

    Now query your database that is relative to the countrycode that googles return.

    UPDATE

    The Geocoding API v2 has been turned down on September 9th, 2013.

    Here's the new URL of API service

    http://maps.googleapis.com/maps/api/geocode/json?latlng=your_latitude,your_longitude

    http://maps.googleapis.com/maps/api/geocode/json?latlng=10.32,123.90&sensor=true

提交回复
热议问题