Google Map API通过邮政编码获取地址信息,但通过街道号获取响应结果 [英] Google Map API get address information by postal code, but it response result by street number

查看:50
本文介绍了Google Map API通过邮政编码获取地址信息,但通过街道号获取响应结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用google map api通过世界各地[而不是特定国家/地区]的邮政编码获取地址信息.

I am using google map api to get address information by Postal code around the world [ not specific country].

https://maps.googleapis.com/maps/api/geocode/json?address = 610& key = [apiKey]

我期望邮政编码为610,但Google响应结果为街道编号610.

I expected zip code is 610, but google response result for street number 610.

有什么方法只能通过邮政编码获取地址?

Is there any ways to get address by zip code only?

谢谢你们的支持.

推荐答案

与此查询有关的内容

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:1441|country:PH&key=YOUR_API_KEY

这将为您提供这种格式的地址 http://prntscr.com/ouwlq5

This will get you the address kind of this format http://prntscr.com/ouwlq5

主要注意事项是国家/地区.您需要邮政编码和国家/地区都可以进行此工作.没有国家,您将得到零结果.

Key note here is the country. You need both of the postal_code and the country to make this work. Without country you'll get zero results.

这篇关于Google Map API通过邮政编码获取地址信息,但通过街道号获取响应结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆