Getting No response from google direction api

扶醉桌前 提交于 2020-01-05 08:08:36

问题


I am using google direction api to get direction/routes between two places.

When I query

http://maps.googleapis.com/maps/api/directions/json?origin=New%20York%20LaGuardia%20Airport%20Marriott,%20Queens,%20NY,%20United%20States&destination=200%20e%2057th%20st%20ny&sensor=false

Iam getting Status = NOT_FOUND.

But when I search this path from New York LaGuardia Airport Marriott, Queens, NY, United States to 200 e 57th st ny using https://maps.google.com/. Google display a direction path between these two places. You can see this via link: link

What should I do to get the reponse from google api.

Thanks.


回答1:


Google Maps uses many sources of locations data including Places results. Look to me like the directions service can't find "New York LaGuardia Airport Marriott, Queens, NY, United States" (because it isn't an address). If I use the Places API, that can find it.

example using the javascript APIs



来源:https://stackoverflow.com/questions/15634925/getting-no-response-from-google-direction-api

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