Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

</div>

## 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

Expand Down Expand Up @@ -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


4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class PmTilesSource extends VectorTileSourceImpl {
type = 'vector';

scope: string | undefined;
dispatcher = undefined;
dispatcher?: { getActor(): any };
reparseOverscaled: boolean = true;
map!: MapboxMap;

Expand Down Expand Up @@ -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
Expand Down