经纬度能查到邮编吗? [英] Latitude and longitude can find zip code?
本文介绍了经纬度能查到邮编吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用谷歌地理编码器获取纬度和经度,我的问题是,有没有办法找出带有纬度和经度的邮政编码?
I am using Google geocoder for lat and lon and my question is, is there a way you can find out zipcode with latitude and longitude?
推荐答案
我认为您正在寻找的是 results
数组中的 address_components[]
.也许这样的事情会奏效,只需输入下面的内容,这样它就可能有错误,但我想你会明白的.
I think what you are looking for is the address_components[]
in the results
array. Maybe something like this would work, just typing the below so it might have errors in it but I think you will get the idea.
http://code.google.com/apis/maps/documentation/geocoding/#Results
function (request, response) {
geocoder.geocode({ 'address': request.term, 'latLng': centLatLng, 'region': 'US' }, function (results, status) {
response($.map(results, function (item) {
return {
item.address_components.postal_code;//This is what you want to look at
}
}
这篇关于经纬度能查到邮编吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文