I have two set of coordinates i.e. one is source and destination. I want to geocode them but in a single shot... not by calling Geocoding API twice. Is there a way this can be achieved ? If not what is the best approach?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Maybe.
If your intent is to find routes between latlngs and have addresses for the origin and destination of those routes, just use the Directions API: https://developers.google.com/maps/documentation/directions/intro
You'll find start_address and end_address in the response. Bear in mind these are the addresses of start_location and end_location respectively, which may not be the latlngs you provided initially.
If your intent is to simply reverse geocode 2 latlngs at once, regardless of the route from one to another, there is just no way to do that in the Geocoding API: just send one request per latlng.