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>[] }

    GeoJSON FeatureCollection containing one or more calculated routes.

    Typically contains the main route (index 0) and optional alternative routes. Collection properties can include metadata about the routing request.

    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

      Bounding box that contains all the routes or at least their waypoints. Only defined if routes are present.

    • features: Route<P>[]

      Array of route features.

    const routes: Routes = {
    type: 'FeatureCollection',
    features: [
    { type: 'Feature', geometry: {...}, properties: { index: 0, ... } }, // Main route
    { type: 'Feature', geometry: {...}, properties: { index: 1, ... } } // Alternative
    ],
    properties: {
    requestId: 'req-456',
    calculatedAt: new Date()
    }
    };