Skip to content

spatial-monorepo


spatial-monorepo / pmtiles/src / SWOptions

Interface: SWOptions

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

Options for registerSpatialServiceWorker.

Properties

buildingIds?

optional buildingIds?: string[]

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

Building IDs to pre-cache on Service Worker install. Each ID is treated as the base URL of a .pmtiles archive.


maxCacheBytes?

optional maxCacheBytes?: number

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

Maximum total bytes to keep in the tile cache. When exceeded the least-recently-used entries are evicted. 0 (default) means unlimited.


onUpdate?

optional onUpdate?: () => void

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

Called when the Service Worker has an available update. Use this to prompt the user to reload for offline support.

Returns

void


scope?

optional scope?: string

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

Service Worker registration scope.

Default

ts
'/'

swUrl?

optional swUrl?: string

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

URL of the compiled Service Worker script.

Default

ts
'/spatial-sw.js'

Released under commercial licensing.