从谷歌方向api得到没有反应 [英] Getting No response from google direction api

查看:161
本文介绍了从谷歌方向api得到没有反应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用google方向API来获取两个地方之间的方向/路线。



当我查询时


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获得Status = NOT_FOUND。



但是,当我从纽约拉瓜迪亚机场万豪酒店,纽约州皇后区,美国搜索到 200 e 57th st <使用 https://maps.google.com/ 。谷歌显示这两个地方之间的方向路径。您可以通过以下链接查看:链接

谢谢。

解决方案

我应该怎么做才能从google api获取响应。

Google地图使用多种位置数据来源,包括地点结果。在我看来,服务无法找到美国纽约州皇后区纽约拉瓜迪亚机场万豪酒店(因为它不是地址)。如果我使用Places API,可以找到它。



使用JavaScript API的示例


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.

解决方案

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

这篇关于从谷歌方向api得到没有反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆