TomTom Maps for JavaScript
    Preparing search index...

    Type Alias HasBBox

    HasBBox: BBox | GeoJSON | GeoJSON[]

    A geographic bounding box, or an object the SDK can derive one from.

    It takes these forms:

    • BBox - A GeoJSON bounding box array [west, south, east, north].
    • GeoJSON - Any GeoJSON object with a bbox property or whose bounds can be calculated.
    • GeoJSON[] - An array of GeoJSON objects, a convenience extension to standard GeoJSON.

    The format is [west, south, east, north], crossing the antimeridian when west > east, as BBox describes.

    // Direct BBox array
    const bbox1: HasBBox = [4.8, 52.3, 5.0, 52.4];

    // Feature with bbox property
    const bbox2: HasBBox = {
    type: 'Feature',
    bbox: [4.8, 52.3, 5.0, 52.4],
    geometry: { type: 'Polygon', coordinates: [...] },
    properties: {}
    };

    // Array of features to derive bounds from
    const bbox3: HasBBox = [feature1, feature2, feature3];