更新时间:2023-02-21 20:35:47
我建议使用组件过滤以获取邮政编码.
I would suggest using a component filtering in your Geocoder requests in order to obtain postal codes.
您的请求将被重写为
https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A42025%7Ccountry%3AUS&key=YOUR_API_KEY
https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A42020%7Ccountry%3AUS&key=YOUR_API_KEY
两个请求都将预期结果返回给我.您还可以在Geocoder工具中看到它:
Both requests return expected results to me. You can also see it in the Geocoder tool: