TomTom Maps for JavaScript
    Preparing search index...

    Type Alias PolygonFeatures<P>

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

    A GeoJSON FeatureCollection of polygon or multi-polygon features.

    It represents multiple polygonal areas, such as:

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

    Type Parameters

    Type Declaration

    • Optionalbbox?: BBox

      The bounding box of all features in the collection, including any bounding boxes they have. It is present only if the collection has features.

    • features: PolygonFeature<P>[]

      The 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 }
    }
    ]
    };