Closed hupe13 closed 1 year ago
Seems familiar. I thought I already resolved this.
In leaflet, there was this:
And from the readme:
= 2.21.0 =
- Fixes issues with tilelayers when min_zoom and max_zoom are identical and detect_retina is true
The bug exists. I'm using Leaflet V 1.9.2, Leaflet Map 3.0.5. MaxZoom is 19. Shortcode:
[leaflet-map height=200px width=100% detect-retina]
[zoomhomemap]
If the shortcode is:
[leaflet-map height=200px width=100% max_zoom=18 detect-retina]
No tiles are displayed at zoom level 18 if retina is true.
That's upsetting. I'll see if it happens in leaflet; I imagine it does. Maybe there's something we can do on the plug-in to fix it.
Do you believe this is resolved @hupe13 ?
It isn't resolved. I tried it, but I did not understand the $raw_map_options. I'll have to look at it again.
Yeah, so it looks like when detect-retina is on, leaflet refuses to load tiles at the max_zoom (likely because they have some code to disable loading any tiles greater than max_zoom, and detectRetina requires loading the next zoom level)
This is related to what I worked on before, but I think it's slightly different than the bug I was trying to fix:
Issue: https://github.com/Leaflet/Leaflet/issues/7326
So I think the new issue here is that maxZoom seems to affect the actual tile request: probably _updateLevels and _pruneTiles in L.GridLayer:
TileLayer is altering maxZoom if detectRetina is true: https://github.com/Leaflet/Leaflet/blob/3f5ea5a271b41ec09147ea774fea90bc960a1ab2/src/layer/tile/TileLayer.js#L102
And then GridLayer (which is what TileLayer is extended from) is pruning tiles and refusing to load new tiles at the maxZoom. Need to make a demo and a new Leaflet Issue.
Ok, demo made: https://codepen.io/bozdoz/pen/VwBjwaW
So maybe it's not a problem with Leaflet, but a problem with configuring the tileLayer. Perhaps this can just be removed now that Leaflet has a fix for this:
I can confirm this bug. https://wordpress.org/support/topic/detectretina-and-maxzoom-no-tiles/