maplibre: display error on empty bounds [#508] (#510)

* If a MapLibre source has empty bounds, no tiles will be displayed.
This commit is contained in:
Brandon Liu
2025-01-09 16:10:43 +08:00
committed by GitHub
parent 275b5bcb5d
commit d4d97ad7a9

View File

@@ -221,6 +221,13 @@ export class Protocol {
}
const h = await instance.getHeader();
if (h.minLon >= h.maxLon || h.minLat >= h.maxLat) {
console.error(
`Bounds of PMTiles archive ${h.minLon},${h.minLat},${h.maxLon},${h.maxLat} are not valid.`
);
}
return {
data: {
tiles: [`${params.url}/{z}/{x}/{y}`],