The fourth beta of Leaflet 2.0 fixes zoom animations getting cut short on pages with many markers, makes the layers control work from the keyboard, and fixes jitter during flyTo, along with over a dozen other fixes.
⚡️ Performance
- Fix zoom animations getting cut short on pages with many markers, where a 250 ms fallback timer ended them before the browser got to run them, and stop forcing a style recalc of every marker when a zoom animation adds a tile level or a pointer moves during it
- Make animated panning (drag inertia, keyboard panning,
panBy/panTo) with many markers several times faster in Chrome, which re-rendered every marker on every frame of the animation
✨ Improvements
- Hide a layer's attribution while the map zoom is outside the layer's
minZoom/maxZoom(#5253, #7716) - Use
detectRetinaonly at a device pixel ratio of 1.5 or higher, so tile labels stay readable on screens scaled to 125% (#6721 by @vpithart) - Don't capture pointers that start on form controls inside the map, so native widgets like the clear button of a search input work (#10567 by @Misyuk-T, #10565)
- Show tiles fully opaque when printing, even if they're still fading in (#3202)
♿️ Accessibility
- Make the layers control work from the keyboard: opening it moves focus into the list, Escape closes it and returns focus to the toggle, and moving focus out of it collapses it (#10560 by @ogchicken)
🐞 Bug fixes
- Fix tiles, markers and overlays jittering during
flyTo(#3194) - Fix marker tooltips with
directionset totop,bottom,leftorcenterattaching to the wrong side of the icon (#7302, #7519) - Fix icons in zoom and other bar control buttons not being centered, a regression in beta.3 (#10554)
- Fix
LatLngBoundsandBoundsthrowing on empty arrays, such as an empty ring, a regression in beta.3 (#10569 by @ogchicken) - Fix clicks on overlapping shapes from canvas renderers in panes with the same z-index going to the shape underneath, a regression in beta.3 (#10570 by @ogchicken)
- Fix circle radii and
fitBounds/getBoundsZoomwith projections that rotate the axes (#5246) - Fix
getCenter()of a polygon with all points on one line returning its first point (#10555 by @kevin9327) - Fix
distanceTo()returningNaNfor some antipodal points (#10561 by @SwastikTripathi) - Fix URL templates throwing on a space before the closing brace, like
{x }(#10562 by @Kernel-Hunter)
📝 Docs
- List the keyboard shortcuts and the core
FullscreenControlin the accessibility tutorial (#10558 by @ogchicken) - Fix the contrast and an invalid
alton the Translatable badge (#10556 by @ogchicken)
🔧 Workflow
- Fix the build and check scripts on Windows (#10559 by @ogchicken)
- Fix GeoJSON specs that asserted nothing (#10564 by @dylanpulver)
⚠️ Breaking changes
detectRetinaneeds a device pixel ratio of 1.5 or higher, up from anything above 1 (#6721)tooltipAnchoris mirrored for tooltips withdirection: 'left'(not onlyautoones that open to the left), is ignored fortopandbottomtooltips, which attach to the middle of the icon's top or bottom edge, and only itsyapplies tocenterones (#7302, #7519)- Marker icons and shadows have
will-change: transform, and a tile layer's container has theleaflet-zoom-animatedclass