Skip to content

spatial-monorepo


spatial-monorepo / pmtiles/src / registerSpatialServiceWorker

Function: registerSpatialServiceWorker()

registerSpatialServiceWorker(options?): Promise<void>

Defined in: packages/pmtiles/src/index.ts:151

Registers the Spatial Service Worker that intercepts PMTiles range requests and caches them in the Cache API for offline use.

PRD F61 — registerSpatialServiceWorker.

Parameters

options?

SWOptions = {}

Returns

Promise<void>

Example

ts
await registerSpatialServiceWorker({
  buildingIds: ['https://tiles.example.com/building-a'],
  maxCacheBytes: 200 * 1024 * 1024, // 200 MB
});

Released under commercial licensing.