This is the documentation of version 1.0.0-rc.4. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias DragEventType

    DragEventType: "dragstart" | "drag" | "dragend"

    Subtype for drag events, with the mouse or a single finger.

    • dragstart: Fires once the pointer, pressed on a feature, moves a few pixels.
    • drag: Fires on every move until the pointer is released, the first right after dragstart.
    • dragend: Fires once when the pointer is released, a second finger touches, the touch is cancelled, or the map's events are disabled.

    A handler for any of them makes the features it covers draggable:

    The handler gets the feature pressed at dragstart, and the pointer's current position. The SDK moves nothing: show the feature again at that position to move it.

    routing.events.waypoints.on('drag', (waypoint, lngLat) => moveStop(waypoint.properties.index, lngLat));