【问题标题】:Google Maps Directions API - Route not getting plotted for more than 8 waypointsGoogle Maps Directions API - 路线未绘制超过 8 个航点
【发布时间】:2016-04-20 20:52:09
【问题描述】:

我正在尝试使用 Google Maps Directions API 在我的项目中绘制路线,但它不适用于超过 8 个航点。

    var request = {
        origin: start,
        destination: end,
        waypoints: waypts,
        optimizeWaypoints: true,
        travelMode: google.maps.TravelMode.DRIVING,
        key: "our-api-key"
    }

https://developers.google.com/maps/documentation/directions/usage-limits

正如使用限制页面中所述,我们在请求中传递了 API 密钥,并且还通过我们的帐户启用了计费。但它仅适用于少于 8 个航点的路线。我可能做错了什么?

【问题讨论】:

    标签: javascript google-maps google-maps-api-3


    【解决方案1】:

    根据Google in this issue,免费用户将23个航点“扩展”为23个航点仅适用于Directions API (the web service),不适用于Google Maps Javascript API v3 DirectionsService

    • Web 服务(Directions API、Distance Matrix API)免费用户(API 密钥)和 Maps for Work 用户(客户端 ID + 签名)都有 23 个航点
    • JavaScript API(路线服务、距离矩阵服务):免费用户(API 密钥)有 8 个航点,Maps for Work 用户(客户端 ID)有 23 个航点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-24
      • 1970-01-01
      • 1970-01-01
      • 2015-07-24
      • 2016-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多