yarn leaflet 2.0.0-beta.6

one hour ago

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 past zoomAnimationThreshold) 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() and setUrl() 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 load fires 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 padding option) (#10613, #8386)
  • Fix a pinch zoom on iOS firing a click on 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.keyboard while the map has focus (#10632 by @alphaNumericEntity)
  • Fix pinch zoom staying broken after pinchZoom is disabled mid-pinch and enabled again (#10643 by @Chen1098)
  • Fix the first wheel zoom after re-enabling scrollWheelZoom skipping wheelDebounceTime (#10645 by @Chen1098)
  • Fix disabling marker dragging mid-drag (also by remove() or setIcon) not firing dragend and leaving autoPan panning the map (#10644 by @Chen1098)
  • Fix invalidateSize not firing resize, move and moveend when 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 CircleMarker with radius: 0 and no stroke catching clicks anywhere on the map (#10637 by @aslanmuradov)
  • Fix Circle radius on CRSs that set their own R, like Moon or Mars maps (#10625 by @thejesh23)
  • Fix GeoJSON#resetStyle not resetting the layers of MultiPoint and GeometryCollection features (#10633 by @Asimmimx)
  • Fix toGeoJSON reordering GeometryCollection members that are MultiPoints or nested collections (#10634 by @divya0795)
  • Fix a GeoJSON Point with empty coordinates throwing and aborting the whole layer, instead of being skipped (#10624 by @thejesh23)
  • Fix WMSTileLayer subclasses ignoring their own defaultWmsParams and options, a regression in 2.0 (#10639 by @Chen1098)
  • Fix Util.throttle running 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#setRotation throwing on a marker with a tooltip that isn't open (#10646 by @ogchicken)
  • Fix FullscreenControl#toggle / #setFullscreen throwing when the control isn't on a map (#10647 by @ogchicken)
  • Fix a ScaleControl removed before the map loads throwing when it does (#10648 by @hkwongax)

📝 Docs

  • Add ProjectedCRS and EarthCRS to the API docs
  • Clarify that Layer#remove keeps the layer in its groups (#9209)
  • Note that each zoom level below minNativeZoom loads 4 times as many tiles
  • Document where to listen for the initial tileloadstart events (#10615 by @haranishi)
  • Clarify that popup maxWidth and minWidth apply 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-clip element, which takes their zIndex and the leaflet-zoom-animated class, so CSS that targets them as direct children of a pane (like .leaflet-overlay-pane > img) needs updating
  • redraw() and setUrl() keep the old tiles until the new ones load, so tileunload fires for them later

Don't miss a new leaflet release

NewReleases is sending notifications on new releases.