You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using vector tiles that go up to zoom level 13, so i set the maxNativeZoom to 13.
When i allow a maxZoom higher than that, e.g. 17, the layer should scale up.
With rendererFactory: L.svg.tile, this works fine:
This slower in performance than L.canvas.tile however. With that however, the scaled-up version looks blurry:
I think this is behaviour as expected. If you use a maxZoom higher than maxNativeZoom on any L.TileLayer, the image will appear pixellated in the same fashion.
Is there some inherent reason how canvas gets rendered, or ...?
This is how <canvas>es work. Leaflet's L.Canvas renderer rasterizes the vector data into pixels.
You could argue "but it might be better to re-rasterize the <canvas> tiles on zoom change, doubling up their (width and height) size at each zoom threshold", to which I would reply "yeah, but that's extra work, and doubling up the size of canvases might create canvases larger than the screen and too large for the GPU, so if you want to re-rasterize stuff at zoom thresholds you will be better setting up a higher maxNativeZoom value anyway".
I'm partial to closing this as "it's a feature, not a bug". I don't think there's anything valuable to be done about this.
I'm using vector tiles that go up to zoom level 13, so i set the
maxNativeZoom
to 13.When i allow a
maxZoom
higher than that, e.g. 17, the layer should scale up.With

rendererFactory: L.svg.tile
, this works fine:This slower in performance than

L.canvas.tile
however. With that however, the scaled-up version looks blurry:BTW, I'm using the [ react-leaflet ](https://github.com/PaulLeCam/react-leaflet plugin) plugin with a custom component where i call leaflet directly, like in this issue
Is there some inherent reason how canvas gets rendered, or is that an issue with the canvas renderer?
The text was updated successfully, but these errors were encountered: