Route Dragging Plugin

Edit a route by hand: move its stops by their pins, pull new ones off the line, and watch the road follow

View on GitHub

A route through three Dutch cities reshapes under the pointer: its stops move and new ones join it, and the road follows while you drag.

  • new RouteDragging(routing) listens to the routing module’s drag events, so no pointer handling of yours is in the loop.
  • setWaypoints shows the stops and plans the route, and every drag re-plans it twice a second and once more on the drop.
  • onRoutes gets each answer in order, so the summary never steps back to an older route.

Related examples