Closed Farkites closed 1 month ago
Could you elaborate on what the code is doing? Apart from the fix copied from https://github.com/Leaflet/Leaflet/pull/8613, I am not sure why the rest is needed. I tried your example using just that code ( implemented in https://github.com/emilhe/dash-leaflet/pull/244), and it seems to work as intended. I have pushed the build as dash-leaflet==1.0.16rc3
. Could you check if it works as intended, or if there are edge cases not covered?
Thanks for reviewing @emilhe! I have checked your implementation in #244 and it works exactly as expected both for #236 and for the issue in dash-cytoscape with the cytoscape + leaflet all in one component.
Apologies for the confusing code, I run into some issues overwriting the redraw()
function that lead me to this rather convoluted logic. With my initial approach the redraw
function was being called in an infinite loop, probably due to the adding and removing layers to useMap
that was calling the redraw
again, so I had to add the redrawNeeded
state.
Your implementation is also clearer than mine and I haven't found any edge cases not covered. So I'm very happy to proceed with your approach and close this PR.
Obsolete after merging https://github.com/emilhe/dash-leaflet/pull/244
Description
Adds custom
redraw
method toTileLayer
to round Zoom levels and fix the issue #236This fix is a workaround suggested in this comment by Leaflet.js maintainers.
Test fix: