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

    Type Alias Route<P>

    Route: Omit<Feature<LineString, P>, "id" | "bbox"> & { bbox: BBox; id: string }

    A calculated route, as a GeoJSON Feature.

    Its geometry is a LineString of the route path coordinates, and its properties hold all route information (summary, sections, guidance).

    Type Parameters

    Type Declaration

    • bbox: BBox

      The bounding box of the entire route, or at least of its waypoints.

    • id: string

      The unique identifier of this route, randomly generated to tell route alternatives apart.

    const route: Route = {
    type: 'Feature',
    id: 'route-123',
    geometry: {
    type: 'LineString',
    coordinates: [[4.9, 52.3], [4.91, 52.31], ...]
    },
    properties: {
    summary: { lengthInMeters: 5000, travelTimeInSeconds: 300, ... },
    sections: { ... },
    index: 0
    },
    bbox: [4.9, 52.3, 4.91, 52.31]
    };