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

    Interface GeoJSONVT

    Main class for creating and managing a vector tile index from GeoJSON data.

    interface GeoJSONVT {
        stats: { [key: string]: number };
        tiles: { [key: string]: GeoJSONVTInternalTile };
        total: number;
        getTile(
            z: string | number,
            x: string | number,
            y: string | number,
        ): GeoJSONVTTile;
        invalidateTiles(features: GeoJSONVTInternalFeature[]): void;
        splitTile(
            features: GeoJSONVTInternalFeature[],
            z: number,
            x: number,
            y: number,
            cz?: number,
            cx?: number,
            cy?: number,
        ): void;
        updateData(diff: GeoJSONVTSourceDiff): void;
    }
    Index

    Properties

    stats: { [key: string]: number } = {}
    tiles: { [key: string]: GeoJSONVTInternalTile }
    total: number = 0

    Methods

    • Given z, x, and y tile coordinates, returns the corresponding tile with geometries in tile coordinates, much like MVT data is stored.

      Parameters

      • z: string | number

        tile zoom level

      • x: string | number

        tile x coordinate

      • y: string | number

        tile y coordinate

      Returns GeoJSONVTTile

      the transformed tile or null if not found

    • Internal

      splits features from a parent tile to sub-tiles. z, x, and y are the coordinates of the parent tile cz, cx, and cy are the coordinates of the target tile

      If no target tile is specified, splitting stops when we reach the maximum zoom or the number of points is low as specified in the options.

      Parameters

      • features: GeoJSONVTInternalFeature[]

        features to split

      • z: number

        tile zoom level

      • x: number

        tile x coordinate

      • y: number

        tile y coordinate

      • Optionalcz: number

        target tile zoom level

      • Optionalcx: number

        target tile x coordinate

      • Optionalcy: number

        target tile y coordinate

      Returns void

    • Updates the tile index by adding and/or removing geojson features invalidates tiles that are affected by the update for regeneration on next getTile call.

      Parameters

      Returns void