Open Excape opened 6 years ago
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 amaxZoom
higher than that, e.g. 17, the layer should scale up.With![image](https://user-images.githubusercontent.com/5650949/40472236-2694239a-5f39-11e8-8faf-284b82a094fe.png)
rendererFactory: L.svg.tile
, this works fine:This slower in performance than![image](https://user-images.githubusercontent.com/5650949/40472298-54d8fb86-5f39-11e8-974e-ed29a38ec5ba.png)
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?