yarn leaflet 2.0.0-beta.5

2 hours ago

The fifth beta of Leaflet 2.0 adds ProjectedCRS, a core replacement for the Proj4Leaflet plugin for maps in national grids and other projected coordinate systems, along with over 20 bug fixes.

❇️ New features

  • Add ProjectedCRS for maps in national grids, WMTS tile matrix sets and other projected coordinate systems, replacing the unmaintained Proj4Leaflet plugin. Hooking up proj4 (or any other projection library) takes a few lines, zooming works smoothly past the defined zoom levels, and it adds nothing to your bundle unless imported (#10591)

⚡️ Performance

✨ Improvements

  • Allow clearing a WMSTileLayer param by setting it to undefined or null with setParams (#10590 by @ogchicken, #3441)
  • Add originalEvent to marker dragstart and movestart events, so you can check the pointer type or modifier keys that started the drag (#10574 by @ogchicken, #6953)
  • Show distances under a meter (like 0.3 m) in the scale control instead of an oversized 1 m bar (#10583 by @SwastikTripathi)
  • Accept arrays and plain objects in Point#scaleBy and Point#unscaleBy (#10573 by @Kernel-Hunter)

♿️ Accessibility

  • Mark the "Leaflet" and "OpenStreetMap" attribution links as English, so screen readers pronounce them correctly on non-English maps (#10580 by @nfreear, #10579)
  • Stop tooltips from overwriting other descriptions in their source's aria-describedby (#10596 by @xiaoyao-666-coder)
  • Stop closed tooltips from staying in their source's aria-describedby (#10578 by @ogchicken)

🐞 Bug fixes

  • Fix CSS resets like Tailwind's shrinking video overlays and vector layers in custom panes (#10589 by @ogchicken, #4600)
  • Fix canvas layers getting a click when the press started elsewhere on the map (#10588 by @b84330808, #7105)
  • Fix tooltips with a Point offset jumping around on zoom when they open to the left, a regression in beta.4 (#10605 by @SudeepGowda55)
  • Fix rebinding a popup with bindPopup leaving the old one open with no way to close it (#10606 by @SudeepGowda55)
  • Fix LayerGroup#toGeoJSON missing layers in plugins that extend layer groups, a regression in 2.0
  • Fix setMinZoom / setMaxZoom called during a zoom animation leaving the map outside the new limits (#10571 by @ogchicken, #9226)
  • Fix part of maxBounds being unreachable with some projections, such as conic ones (#10584 by @ogchicken, #7650)
  • Fix GeoJSON#resetStyle throwing for layers added with addLayer (#10598 by @Chen1098)
  • Fix dragging a marker with autoPan throwing when autoPanPadding is 0 on either axis (#10607 by @SudeepGowda55)
  • Fix the map not zooming out when a layer with maxZoom: 0 is added (#10572 by @ogchicken)
  • Fix disabling box zoom mid-drag leaving the box on the map and still zooming on release (#10587 by @ogchicken)
  • Fix FullscreenControl getting stuck in fullscreen mode when the map is removed from the page while fullscreen
  • Fix off() called from a listener not stopping the remaining listeners of that event (#10597 by @Chen1098)
  • Fix map.remove() leaving built-in handlers like scrollWheelZoom enabled when a plugin handler re-enables them (#6474)
  • Fix canvas paths with weight: '0' (as a string) still being drawn (#10581 by @ogchicken)
  • Fix ZoomControl#enable / #disable throwing when the control isn't on a map (#10582 by @ogchicken)

📝 Docs

  • Clarify that LayersControl's autoZIndex keeps the order of tile layers and overlays, but not of markers and vectors (#10594 by @deepujain, #5201)
  • Complete the keyboard shortcuts table in the accessibility tutorial (#10575 by @ogchicken)
  • Fix missing OpenTopoMap tiles past zoom 17 in the layers control tutorial (#10576 by @ogchicken)
  • Fix the favicon on tutorial example pages (#10577 by @ogchicken)

🔧 Workflow

⚠️ Breaking changes

  • WMSTileLayer no longer sends params set to undefined or null (previously sent as the strings "undefined" and "null")
  • A collapsed layers control updates its list only when it expands, so code reading the list's DOM while it's collapsed may see it out of date

Don't miss a new leaflet release

NewReleases is sending notifications on new releases.