mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-03-21 22:39:39 +00:00
JS cleanup (#640)
* JS cleanup * remove unused function * leaflet: properly clean up object URLs * maplibre: refactor tile type detection * update leaflet raster example
This commit is contained in:
@@ -551,23 +551,6 @@ function deserializeIndex(buffer: ArrayBuffer): Entry[] {
|
||||
return entries;
|
||||
}
|
||||
|
||||
function detectVersion(a: ArrayBuffer): number {
|
||||
const v = new DataView(a);
|
||||
if (v.getUint16(2, true) === 2) {
|
||||
console.error(
|
||||
"PMTiles spec version 2 is not supported; please see github.com/protomaps/PMTiles for tools to upgrade"
|
||||
);
|
||||
return 2;
|
||||
}
|
||||
if (v.getUint16(2, true) === 1) {
|
||||
console.error(
|
||||
"PMTiles spec version 1 is not supported; please see github.com/protomaps/PMTiles for tools to upgrade"
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error thrown when a response for PMTiles over HTTP does not match previous, cached parts of the archive.
|
||||
* The default PMTiles implementation will catch this error once internally and retry a request.
|
||||
|
||||
Reference in New Issue
Block a user