TomTom Maps for JavaScript
    Preparing search index...

    Class RouteDragging

    Edits a route by dragging on a RoutingModule: a waypoint's pin moves its stop, and a route line pulls a new stop off it. The routes re-plan as you drag.

    Public Preview until the plugin's 1.0.0 release.

    • It edits the waypoints the routing module last showed, so its indexes are the pins' own.
    • While a drag lasts, the routes re-plan every RouteDraggingOptions.planIntervalMS, and once more on the drop.
    • The requests overlap rather than cancel each other, so a route slower than the interval still shows during the drag. An answer older than one already shown is dropped, through createLatestRequest({ supersede: 'on-answer' }).
    • With showOnMap: false, it shows nothing itself, and your app shows what it reports.
    const routing = await RoutingModule.create(map);
    const dragging = new RouteDragging(routing);
    await dragging.setWaypoints([[4.9041, 52.3676], [5.1214, 52.0907]]);
    Index
    • get dragging(): boolean

      Whether a waypoint is being dragged.

      Returns boolean

    • The waypoints, as the routing module last showed them or a drag left them.

      Returns PlanningWaypoint[]

    • Stops listening to the routing module, and drops the plans still in flight.

      Returns void

    • Shows the waypoints on the routing module and plans the routes through them.

      Parameters

      • waypoints: PlanningWaypoint[]

      Returns Promise<void>

      With showOnMap: false, call routing.showWaypoints yourself instead: the plugin follows whatever the routing module shows.