谷歌地图API地理code邮政code和设置国家code? [英] Google Maps API Geocode Postal Code and set Country code?
问题描述
我使用这个API调用谷歌地图获得邮政code的纬度和经度
I'm using this API call to Google Maps to get the latitude and longitude of a postal code
<一个href=\"http://maps.googleapis.com/maps/api/geo$c$c/json?address=2340&sensor=false\">http://maps.googleapis.com/maps/api/geo$c$c/json?address=2340&sensor=false
邮政code是在澳大利亚。这个API调用返回地点与世界部分匹配邮政codeS各地的地址。
The postal code is in Australia. This API call returns locations all around the world with partial matching postal codes in the address.
有一个参数,我可以用它来在全国各地设立澳大利亚吗?
Is there a parameter I can use to set the country to Australia?
感谢
推荐答案
要做到这一点,正确的方法是不是通过区域偏移,而是使用的分量滤波:
The correct way to do this is not via region biasing but rather using component filtering:
http://maps.google.com/maps/api/geocode/json
?components=country:AU|postal_code:2340
&sensor=false
示范一些:
请注意,如果您使用的元件的参数,你并不需要指定地址参数。
Please note that if you use the components parameter, you don't need to specify the address parameter.
这篇关于谷歌地图API地理code邮政code和设置国家code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!