@maplibre/geojson-vt
    Preparing search index...

    Class Supercluster

    This class allow clustering of geojson points.

    Implements

    Index
    clusterProps: Record<string, unknown>[]
    options: Required<SuperclusterOptions>
    stride: number

    A tree per zoom level. A zoom level where no clusters form shares the tree of the zoom level above it.

    • Returns clusters and/or points within a bounding box at a given zoom level.

      Parameters

      • bbox: [number, number, number, number]

        Bounding box in [westLng, southLat, eastLng, northLat] order, or [minX, minY, maxX, maxY] in the unit square with coordinates: 'unitSquare'. In a world that wraps, the box can reach across the antimeridian. In one that doesn't, only its part inside the world counts.

      • zoom: number

        Zoom level to query.

      Returns ClusterOrPointFeature[]

    • Returns leaf point features under a cluster, paginated by limit and offset.

      Parameters

      • clusterId: number

        The target cluster id.

      • Optionallimit: number

        Maximum number of points to return (defaults to 10).

      • Optionaloffset: number

        Number of points to skip before collecting results (defaults to 0).

      Returns Feature<Point, { [name: string]: any }>[]

    • Loads GeoJSON Point and MultiPoint features and builds the internal clustering index. Each position of a MultiPoint is clustered as a point of its own, with the id and properties of its feature.

      Parameters

      • points: Feature<Point | MultiPoint, { [name: string]: any }>[]

        GeoJSON Point and MultiPoint features to cluster.

      Returns void