Open JoffreyB31 opened 5 years ago
@jieter any thoughts about it ?
I'm not sure about this. I understand the use case to override maxzoom/maxnativezoom, but I don't like to do it by default.
@JoffreyBourdieux may implement this as an option ?
I'm not sure about this. I understand the use case to override maxzoom/maxnativezoom, but I don't like to do it by default.
By default you cannot use the maxNativeZoom property of Leaflet, so you can't zoom "above" the max zoom of the layer (a gray layer is returned instead).
This update seem to not change the original behavior of the plugin, since if you dont tell Leaflet to use the property "maxNativeZoom" it will simply stop the maximum zoom to the one provided by "maxZoom"
@JoffreyBourdieux may implement this as an option ?
I'll look into it
Hi,
It is now implemented as an option. Simply use :
L.tileLayer.provider("OpenStreetMap.DE", {
maxZoom: 21,
useNativeZoom: true
});
It use a key "useNativeZoom" to detect if the user want to override the default maxZoom value, then clone the maxZoom value inside a maxNativeZoom key and override the maxZoom from the providers list value with the user value.
Tell me if this modification suits you. Regards.
Hi, I'm guessing this hasn't been implemented yet? I'm using the 'Stamen.Terrain' layer, want it to keep its maxNativeZoom at 10, then over that (as users will zoom in further for sure) should show zoomed-in tiles instead of vanishing into gray. how to achieve the same? I'm able to do this fine when using native leaflet tile layer. Would it be better to revert to the same?
Hi,
A small update I have done for a site i'm working on, it allow a layer to be pixelized above maxZoom and not showing a grey tile (like originaly).
I have done this because when you use a provider it "lock" the maxZoom value to the one set in the providers list. But if you want to use maxNativeZoom, the plugin will still try to fetch tiles with greater maxZoom than the one allowed and it will return grey tiles.
Thanks in advance :)