首页 > 解决方案 > Google Maps Directions API 零结果错误

问题描述

我们想使用 Google Maps Directions API 在两点之间绘制路线。

要求:

https://maps.googleapis.com/maps/api/directions/json?origin=39.76700140,30.50334660&destination=39.49402464,31.84024373

回复:

{
   "geocoded_waypoints" : [ {}, {} ],
   "routes" : [],
   "status" : "ZERO_RESULTS"
}

它返回 ZERO_RESULTS 状态。但是,这两个点可以进行地理编码,它们是实际有效的点。

有谁知道为什么路线虽然可以进行地理编码却无法绘制?

在此先感谢,马克

标签: google-mapsgoogle-maps-api-3routesdirectionsgoogle-directions-api

解决方案


我找到了原因。谷歌路线到靠近道路至少 5 公里的点。

那一点在农村地区,不靠近任何至少 5 公里的道路。因此,它给出了名为 ZERO_RESULTS 的错误。

谢谢,

标记


推荐阅读