wasm-spatial-core
    Preparing search index...

    Class VectorTileEngine

    A high-performance vector tile engine.

    Creates a pre-indexed GeoJSONVT structure from a GeoJSON string, then can efficiently slice tiles by (z, x, y). Feature properties from the original GeoJSON are preserved as MVT tags.

    Supports optional LRU caching via getTileCached / clearTileCache.

    Index
    layerName: string

    Get the layer name used by this engine.

    • Request a tile by z, x, y coordinates. Returns a raw Uint8Array representing the MVT (PBF) protobuf. If the tile is empty or out of bounds, returns an empty array.

      Feature properties (name, id, class, and any other fields) from the original GeoJSON are automatically encoded as MVT tags.

      Parameters

      • z: number
      • x: number
      • y: number

      Returns Uint8Array

    • Request a tile with LRU caching (max 64 tiles).

      If the tile was previously requested, returns the cached result without re-computing. Otherwise, generates the tile, caches it, and returns it.

      Use clearTileCache() to evict all cached tiles.

      Parameters

      • z: number
      • x: number
      • y: number

      Returns Uint8Array