⚡ Note on future versions
The v1.9 release is setting the stage for the first major version bump of Leaflet since 2016! A lot has changed since then, and it's time for Leaflet to grow together with the web platform.
After this release, we are branching off the 1.x code and putting it in maintenance mode — reserving potential 1.x releases only for critical bugfixes. Although version 2.0 is still far away and will take some time to take shape, we plan to make the following changes:
- Dropping support for Internet Explorer.
This has been a long time coming, but now that Internet Explorer is officially end-of-life, it's time to say goodbye. Going forward, Leaflet will move to an evergreen strategy that targets browsers like Firefox, Chrome, Edge and Safari. - Embracing modern JavaScript.
To maintain backwards compatibility, Leaflet is written entirely in ES5, a version of JavaScript supported by legacy browsers. So we have not been able to make use of many great JavaScript features (e.g. standardized classes, instead having to rely on our own implementation). By adopting a more modern version of the ECMAScript standard, we can start working towards aligning Leaflet with what is expected from a modern JavaScript library. - Standardized modules.
When we released Leaflet v1, the landscape in the JavaScript world was very different and full of competing module standards such as CommonJS, AMD and UMD. Today, ECMAScript modules have become the clear way forward to unite the JavaScript ecosystem under one banner. Moving forward, Leaflet will only be distributed in a single standardized module system, greatly reducing complexity of our distributed code. - Removing the Leaflet global.
As a developer using Leaflet, the capital letterL
is probably intimately familiar to you. This is the Leaflet global where all of Leaflet's functionality lives. In order to allow compiler tooling to better eliminate dead-code through a process called tree-shaking, we are removing this global variable. To preserve backwards compatibility with older plugins, we will provide a shim that can be imported manually that will restore this functionality.
v1.9.0 changelog
⚠️ Breaking Changes
❇️ API changes
- Add
content
andlatLng
options toPopup
/Tooltip
constructors (#7783 by @Falke-Design) - Extend
Bounds
to have the same functions asLatLngBounds
(#7882 by @Falke-Design)
✨ Improvements
- Expose ESM entrypoint with Leaflet global (#8329 by @jonkoops)
- Update
getCenter()
calculation and move it toPolyUtil
/LineUtil
(#7603 by @Falke-Design) - Remove border styles in overflowing popups (#8260 by @Malvoz)
- Fix "listener not found" warning when setting
maxBounds
(#8168 by @mourner) - Remove "listener not found" warning (#8234 by @Falke-Design)
- Extend
Events.listens
to search for specific function (#8161 by @Falke-Design) - Add
noMoveStart
option topanTo
(#6685 by @Chivano) - Add
FeatureCollection
handling togeometryToLayer
(#8163 by @Falke-Design)
🙌 Accessibility
- Improve
Tooltip
accessibility (focus and voice over) (#8247 by @alekzvik) - Fix links in accessibility guide (#8198 by @Malvoz)
- Remove
role="presentation"
from image tiles (#8172 by @Malvoz)
🐞 Bug fixes
- Fix invalid GeoJSON on unbalanced arrays (#7637 by @steff1986)
- Fix 2 step zooming while using mouse wheel scrolling (#8298 by @Falke-Design)
- Fix wrong assigned parameter while calling
map._move
overrequestAnimFrame
(#8328 by @AMDvsTMD) - Fix
_isClickDisabled
to not throw no error if parent is removed from DOM (#8288 by @Falke-Design) - Fix
DomEvent.DoubleTap
to ignore clicks on<label>
s with afor
attribute (#8227 by @IvanSanchez) - Fix calling
once()
twice if same event is fired insideonce
(#8190 by @Falke-Design) - Fix
map.getCenter()
returning a mutable object (#8167 by @mourner) - Fix regression about popup close button modifying the URL (#8160 by @IvanSanchez)
- Fix
min/maxZoom
when used in combination withdetectRetina
(#7328 by @bozdoz)
📝 Docs
- Use preferred tile.openstreetmap.org URL (#8418 by @Firefishy)
- Use LocalStorage for dialog sessions (#8382 by @ChristopherWirtOfficial)
- Update anchor links for headers and in collapsed accordions (#7780 by @Falke-Design)
- Fix typo in reference-1.6.0.html (#8330 by @eltociear)
- Add pre-commit linting to CONTRIBUTING.md (#8299 by @Falke-Design)
- Ensure no borders on dialog iframe (#8296 by @Malvoz)
- Replace Mapbox with OpenStreetMap in tutorials and examples (#7818 by @Falke-Design)
- Remove DOCS-TODO.md (#8259 by @Malvoz)
- Better PosAnimation example (#7386 by @stell)
- Correct heading level in GeoJSON example (#8230 by @Malvoz)
- Update Overlay Tutorial (ImageOverlay, VideoOverlay, SVGOverlay) (#8090 by @KonstantinBiryukov)
- Change attribute
anchor
todata-anchor
(#8174 by @KnightJam1) - Fix bad markdown causing link to not work (#8156 by @freyfogle)
- A couple of site SEO fixes (#8229 by @Malvoz)
- Fix attribution flag 1px misalignment on some websites (#8170 by @mourner)
- Attribution flag now resizes with font-size changes (#8183 by @sumitsaurabh927)
- Add Dialog to website (#8177 by @Falke-Design and #8193, #8194 by @Malvoz)
🔧 Workflow
- Improve GitHub Workflows security (#8419 by @sashashura)
- Update development dependencies
- Replace deprecated
eslint-plugin-script-tags
(#8331 by @jonkoops) - Use major version ranges for Github Actions (#8286 by @jonkoops)
- Configure YAML issue forms (#8246 by @Malvoz)
- Add FUNDING.yml (@mourner)
- Add pre-commit hook to fix linting issues (#8212 by @jonkoops)
- Remove Dependabot specific labels (#8199 by @jonkoops)
- Use shorter bundlemon names (#8195 by @mourner)
- Make sure integrity hashes are generated for the built version (@mourner)
🧪 Tests
- Added test cases for
map.latLngToLayerPoint
method (#8407 by @kreloaded) - Add test for
map.panTo
(#8390 by @anurag-dhamala) - Add test for
map.containerPointToLatLng
andmap.latLngToContainerPoint
(#8384 by @abhi3315) - Add test for
Layer._addZoomLimit
(#8037 by @zishiwu123) - Add tests for
Map
(#8206 by @stephenspol) - Add test for
CircleMarker._containsPoint
(#8340 by @gernhard1337) - Add missing handler tests (#8182 by @Falke-Design)
- Cover Rectangle with unit Tests (#8144 by @stephenspol)