fix binding this in ProtocolCache; update maplibre examples

This commit is contained in:
Brandon Liu
2022-02-18 11:17:34 +08:00
parent 7517b26c66
commit ca1c59d9d3
3 changed files with 6 additions and 4 deletions

View File

@@ -451,7 +451,7 @@ export class ProtocolCache {
return this.tiles.get(url);
}
protocol(params: any, callback: any) {
protocol = (params: any, callback: any) => {
const re = new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/);
const result = params.url.match(re);
const pmtiles_url = result[1];
@@ -495,5 +495,5 @@ export class ProtocolCache {
cancel();
},
};
}
};
}