TomTom Maps for JavaScript
    Preparing search index...

    Interface FeatureCollectionWithProperties<G, P, FeatureCollectionProps>

    Extended GeoJSON FeatureCollection with additional properties at the collection level.

    This type extends the standard GeoJSON FeatureCollection by adding an optional properties field at the collection level (in addition to properties on individual features).

    // Collection of routes with summary properties at the collection level
    const routeCollection: FeatureCollectionWithProperties<LineString, RouteProps, { totalDistance: number }> = {
    type: 'FeatureCollection',
    features: [...],
    properties: { totalDistance: 1000 }
    };
    interface FeatureCollectionWithProperties<
        G extends Geometry
        | null = Geometry,
        P = GeoJsonProperties,
        FeatureCollectionProps = unknown,
    > {
        bbox?: BBox;
        features: Feature<G, P>[];
        properties?: FeatureCollectionProps;
        type: "FeatureCollection";
    }

    Type Parameters

    • G extends Geometry | null = Geometry

      The geometry type for features in the collection (defaults to Geometry)

    • P = GeoJsonProperties

      The type of properties for individual features (defaults to GeoJsonProperties)

    • FeatureCollectionProps = unknown

      The type of properties for the collection itself (defaults to unknown)

    Hierarchy

    Index

    Properties

    bbox?: BBox

    Optional bounding box that contains all features in the collection, including their bounding boxes, if any.

    • Only included if any features are present.
    features: Feature<G, P>[]

    Optional properties for the entire feature collection. This allows metadata to be attached at the collection level.

    type: "FeatureCollection"

    Specifies the type of GeoJSON object.