diff --git a/README.md b/README.md index 3dcfe02..097e723 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ -## Mapbox-PmTiles -Add PmTiles support to mapbox +## Mapbox-PMTiles +Add [PMTiles](https://docs.protomaps.com/pmtiles/) support to Mapbox. +This library requires Mapbox GL JS v3 to work. ## Usage @@ -126,7 +127,7 @@ import mapboxPmtiles from 'https://cdn.jsdelivr.net/npm/mapbox-pmtiles@1.0.29/+e Just pass your `pmtile` url and this plugin will detect tileset's type and format from header automatically. ;) -## What is PmTiles -See the [PmTiles](https://docs.protomaps.com/pmtiles/) repository for more information +## What is PMTiles +See the [PMTiles](https://docs.protomaps.com/pmtiles/) repository for more information diff --git a/src/index.ts b/src/index.ts index 8b52dd3..253981b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -206,7 +206,7 @@ export class PmTilesSource extends VectorTileSourceImpl { type = 'vector'; scope: string | undefined; - dispatcher = undefined; + dispatcher?: { getActor(): any }; reparseOverscaled: boolean = true; map!: MapboxMap; @@ -460,7 +460,7 @@ export class PmTilesSource extends VectorTileSourceImpl { this.fixTile(tile) if (!tile.actor || tile.state === "expired") { - tile.actor = this._tileWorkers[url] = this._tileWorkers[url] || this.dispatcher.getActor(); + tile.actor = this._tileWorkers[url] = this._tileWorkers[url] || this.dispatcher?.getActor(); tile.request = this._protocol.tile({ ...request }, afterLoad); // always load tiles on the main thread and pass the result instead of requesting a worker to do so