Closed Mtehabsim closed 6 months ago
@Mtehabsim I will have a look at it but due to the nature of tbe mbtile I think we need to specify the zoom. I have to write a safer control for it.
@am2222 The main pain is that overzooming cause to crash too for example if I add a source with maxzoom 20 and a layer with maxzoom 22, it should not send a request to get the 21 zoom from the pmtiles, but instead overzoom the 20 zoom tile it has, so it shouldn't be related to the pmtiles itself but mapbox GL internally.
https://docs.mapbox.com/help/glossary/overzoom/
Please correct me if I got it wrong.
@Mtehabsim I will have a look at it but due to the nature of tbe pmtiles I think we need to specify the zoom. I have to write a safer checks for it.
I think the main issue here is that for some reason your pmtiles does not have zoom information in the header.
Can you share your pmtile's headers?
@am2222 Here is the pmtiles file, which was generated using tippecanoe https://sagerdrones-my.sharepoint.com/:u:/g/personal/m_tehabsim_sagerdrone_com/Eai61PLsKGVMhQMPf1dxMWwBD0gxn59b5QlBnHtOGxZytA?e=SsVnoA
Thanks @Mtehabsim I am looking into it
@Mtehabsim so for a temporary solution you can always set the min and max zoom of the data at the source level to avoid requesting the tiles for overzoom from the the source. mapbox should be able to handle the overzoom at the layer level
const header = await PmTilesSource.getHeader(url);
const bounds: [number, number, number, number] = [
header.minLon,
header.minLat,
header.maxLon,
header.maxLat,
];
map.addSource('sourceName', {
type: PmTilesSource.SOURCE_TYPE,
url: url,
minzoom: header.minZoom,
maxzoom: header.maxZoom,
bounds: bounds,
})
Hello Thank you for a great tool, i noticed if I set the max zoom level on the layer wrong or i dont specify it, the page stop loading the map and crash
for example on a source which support zoom from 0 to 14 this would work just fine:
while this or setting any number higher than 14 would crash: