The sixth beta of Leaflet 2.0 reduces tile flicker when zooming out and on redraw() / setUrl(), fixes iOS Safari crashing on maps with large image overlays, and makes zooms that skip the animation up to twice as fast on maps with many vectors, along with over 20 bug fixes.
⚡️ Performance
- Make zooms that skip the animation (
animate: false, or a jump pastzoomAnimationThreshold) up to twice as fast on maps with many vectors, by projecting and updating each path once instead of up to three times (#10618 by @b84330808, #10649 by @Chen1098)
✨ Improvements
- Keep the old tiles on screen on
redraw()andsetUrl()until the new ones load, instead of blanking the layer (#6659, #9100, #3005) - Reduce tile flicker when zooming out, and load the tiles for the whole destination view during the zoom animation, so
loadfires once instead of twice (#8073)
🐞 Bug fixes
- Fix iOS Safari crashing when zooming in on maps with several large image, video or SVG overlays, by clipping overlays to the view like vector layers (set how far past the view with the new
paddingoption) (#10613, #8386) - Fix a pinch zoom on iOS firing a
clickon the map (#10629) - Fix the zoom jumping when adding or removing a layer group whose members' zoom limits combine into a wider range, like a basemap group in the layers control (#6557, with @KhadeerBasha1232 and @ogchicken)
- Fix zooms queued during a zoom animation, like from quickly clicking zoom in, starting from the wrong scale and drifting sideways
- Fix a pan started from the last frame of a previous pan stopping short, which broke syncing maps (#10616 by @charan-rathore)
- Fix keyboard shortcuts not working after re-enabling
map.keyboardwhile the map has focus (#10632 by @alphaNumericEntity) - Fix pinch zoom staying broken after
pinchZoomis disabled mid-pinch and enabled again (#10643 by @Chen1098) - Fix the first wheel zoom after re-enabling
scrollWheelZoomskippingwheelDebounceTime(#10645 by @Chen1098) - Fix disabling marker dragging mid-drag (also by
remove()orsetIcon) not firingdragendand leavingautoPanpanning the map (#10644 by @Chen1098) - Fix
invalidateSizenot firingresize,moveandmoveendwhen a 1 px size change keeps the center pixel in place (#10650 by @Chen1098) - Fix a tooltip bound to a group not opening on keyboard focus of layers added to the group later, and staying open on layers removed from it (#10636 by @imeerkhurram)
- Fix a canvas
CircleMarkerwithradius: 0and no stroke catching clicks anywhere on the map (#10637 by @aslanmuradov) - Fix
Circleradius on CRSs that set their ownR, like Moon or Mars maps (#10625 by @thejesh23) - Fix
GeoJSON#resetStylenot resetting the layers of MultiPoint and GeometryCollection features (#10633 by @Asimmimx) - Fix
toGeoJSONreordering GeometryCollection members that are MultiPoints or nested collections (#10634 by @divya0795) - Fix a GeoJSON Point with empty
coordinatesthrowing and aborting the whole layer, instead of being skipped (#10624 by @thejesh23) - Fix
WMSTileLayersubclasses ignoring their owndefaultWmsParamsand options, a regression in 2.0 (#10639 by @Chen1098) - Fix
Util.throttlerunning a call made from inside the callback right away instead of after the interval (#10614 by @charan-rathore) - Fix
map.remove()leaving the container locked to the top-left scroll position (#10651 by @ogchicken) - Fix
Marker#setRotationthrowing on a marker with a tooltip that isn't open (#10646 by @ogchicken) - Fix
FullscreenControl#toggle/#setFullscreenthrowing when the control isn't on a map (#10647 by @ogchicken) - Fix a
ScaleControlremoved before the map loads throwing when it does (#10648 by @hkwongax)
📝 Docs
- Add
ProjectedCRSandEarthCRSto the API docs - Clarify that
Layer#removekeeps the layer in its groups (#9209) - Note that each zoom level below
minNativeZoomloads 4 times as many tiles - Document where to listen for the initial
tileloadstartevents (#10615 by @haranishi) - Clarify that popup
maxWidthandminWidthapply to the content (#10619 by @wozhenbang2004)
🔧 Workflow
- Add tests for negative
pad()ratios (#10626 by @BernardAgr) - Fix a flaky WebKit drag test
⚠️ Breaking changes
- Image, video and SVG overlays are wrapped in a
leaflet-image-layer-clipelement, which takes theirzIndexand theleaflet-zoom-animatedclass, so CSS that targets them as direct children of a pane (like.leaflet-overlay-pane > img) needs updating redraw()andsetUrl()keep the old tiles until the new ones load, sotileunloadfires for them later