我知道现在回答这个问题已经晚了,但它可能会帮助其他寻找它的人。去
geonames.org
. 他们确实有一个api从邮政编码中获取位置信息。响应包含纬度和经度信息。你可以利用这些信息把它放在地图上。
以下是请求和响应示例:
请求:
http://api.geonames.org/postalCodeLookupJSON?postalcode=627357&username=demo&country=IN
{
"postalcodes": [{
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Karaiyiruppu",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}, {
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Nanajankulam",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}, {
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Naranammalpuram",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}, {
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Pallaikottai",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}, {
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Sankarnagar",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}, {
"adminName2": "Tirunelveli",
"adminName3": "Tirunelveli",
"postalcode": "627357",
"adminCode1": "25",
"countryCode": "IN",
"lng": 77.38515755863037,
"placeName": "Tenkulam",
"lat": 9.042148763528974,
"adminName1": "Tamil Nadu"
}]
}