简体   繁体   English

Google Maps Directions API-路线未绘制超过8个航路点

[英]Google Maps Directions API - Route not getting plotted for more than 8 waypoints

I am trying to draw a route in my project using the Google Maps Directions API but it is not working with waypoints more than 8. 我正在尝试使用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 https://developers.google.com/maps/documentation/directions/usage-limits

As mentioned in the the usage limits page, we are passing our API key in the request and also have billing enabled with our account. 如使用限制页面所述,我们在请求中传递了API密钥,并且还为我们的帐户启用了结算功能。 But it is only working for routes less than 8 waypoints. 但它仅适用于少于8个航路点的路线。 What could I be doing wrong? 我可能做错了什么?

According to Google in this issue the 23 waypoints "extension" to 23 waypoints for free users only applies to the Directions API (the web service) , not the Google Maps Javascript API v3 DirectionsService 根据Google在本期中的介绍,免费用户将23个航点“扩展”到23个航点仅适用于Directions API(网络服务) ,而不适用于Google Maps Javascript API v3 DirectionsService

  • Web Services (Directions API, Distance Matrix API) both free users (API keys) and Maps for Work users (client ID + signature) have 23 waypoints Web服务(Directions API,Distance Matrix API)免费用户(API密钥)和Maps for Work用户(客户端ID +签名)都有23个航路点
  • JavaScript API (directions service, distance matrix service): free users (API keys) have 8 waypoints, Maps for Work users (client ID) have 23 waypoints. JavaScript API(方向服务,距离矩阵服务):免费用户(API密钥)有8个航点,Maps for Work用户(客户端ID)有23个航点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM