TomTom Maps for JavaScript
    Preparing search index...

    Type Alias Routes<P, FeatureCollectionProps>

    Routes: Omit<
        FeatureCollectionWithProperties<LineString, P, FeatureCollectionProps>,
        "features" | "bbox",
    > & { bbox?: BBox; features: Route<P>[] }

    A GeoJSON FeatureCollection of one or more calculated routes.

    It typically holds the main route (index 0) and optional alternative routes. calculateRoute sets no collection properties.

    Type Parameters

    • P extends RouteProps = RouteProps

      Type of individual route properties (defaults to RouteProps)

    • FeatureCollectionProps = unknown

      Type of collection-level properties

    Type Declaration

    • Optionalbbox?: BBox

      The bounding box of all the routes, or at least of their waypoints. It is defined only if there are routes.

    • features: Route<P>[]

      The route features.

    const routes: Routes = {
    type: 'FeatureCollection',
    features: [
    { type: 'Feature', geometry: {...}, properties: { index: 0, ... } }, // Main route
    { type: 'Feature', geometry: {...}, properties: { index: 1, ... } } // Alternative
    ]
    };