问题
I'm using google API service in my project, while doing some sample testing i have came across an issue with the below api service call,
"http://maps.googleapis.com/maps/api/geode/json?address=00210&sensor=true"
Which shows the Finland address but i want the information regarding the USA. How can i solve this problem? Is there anything which i need to pass like country code or something?
回答1:
Typically the suggested way to find a postal code in certain country is applying a component filtering that is described in the following document:
https://developers.google.com/maps/documentation/geocoding/intro#ComponentFiltering
You can create request like:
https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A00210%7Ccountry%3AFI&key=YOUR_API_KEY
You can also check this in Geocoder tool:
https://google-developers.appspot.com/maps/documentation/utils/geocoder/#q%3D%26options%3Dtrue%26in_country%3DFI%26in_postal_code%3D00210
Hope it helps!
来源:https://stackoverflow.com/questions/43493250/zip-code-mismatching-in-google-api