TomTom Maps for JavaScript
    Preparing search index...

    Type Alias PolygonFeatures<P>

    PolygonFeatures: Omit<
        FeatureCollection<Polygon | MultiPolygon, P>,
        "features" | "bbox",
    > & { bbox?: BBox; features: PolygonFeature<P>[] }

    GeoJSON FeatureCollection containing polygon or multi-polygon features.

    Represents multiple polygonal areas, useful for:

    • Collections of administrative boundaries
    • Multiple search result areas
    • Multiple building footprints

    Type Parameters

    Type Declaration

    • Optionalbbox?: BBox

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

      • Only included if any features present.
    • features: PolygonFeature<P>[]

      Array of polygon or multi-polygon features.

    const neighborhoods: PolygonFeatures<{ name: string, area: number }> = {
    type: 'FeatureCollection',
    features: [
    {
    type: 'Feature',
    geometry: { type: 'Polygon', coordinates: [...] },
    properties: { name: 'District 1', area: 500000 }
    },
    {
    type: 'Feature',
    geometry: { type: 'Polygon', coordinates: [...] },
    properties: { name: 'District 2', area: 750000 }
    }
    ]
    };