Zip code mismatching in google api

。_饼干妹妹 提交于 2019-12-13 07:59:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!