mapbox-gl-directions icon indicating copy to clipboard operation
mapbox-gl-directions copied to clipboard

Ability to add multiple waypoints at once

Open hughjdavey opened this issue 6 years ago • 3 comments

It would be great if the plugin API could have a method like addWaypoints() to complement the existing addWaypoint() method. The reason for this is that displaying a route with multiple waypoints can result in rate limit issues as we are forced to do something like [simplified]:

this.directions
  .setOrigin(origin)
  .setDestination(destination);

waypoints.forEach((waypoint, index) => {
  this.directions.addWaypoint(index, waypoint);    // a request each time
});

which results in multiple fast requests. This should be possible as the underlying directions API allows adding multiple points to a single request. So I suppose what I am asking to be possible is something like:

this.directions
  .setOrigin(origin)
  .setDestination(destination)
  .setWaypoints(waypoints);

Let me know if I have done something wrong or asked in the wrong place, and thanks for your time :)

hughjdavey avatar Aug 14 '18 15:08 hughjdavey

Any updates on this?

AshwinTayson avatar Jan 22 '19 13:01 AshwinTayson

Updates?

IJaouhar avatar Feb 26 '19 18:02 IJaouhar

need updates....

lywinged avatar Mar 05 '19 21:03 lywinged