NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4041 most downloaded on npm
JavaScript library for mobile-friendly interactive maps
Latest stable
1.9.4
Last release 12 days ago
10 Nov 2026
Release timing varies
gaps range from 8 days to 2.0 years
Nearly every release is documented
notes for 36 of 36 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
51 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
The third beta of Leaflet 2.0 makes chained view changes like setView(c).setZoom(z) or panTo(c).panBy(o) end where you'd expect, makes adding and remo
The third beta of Leaflet 2.0 makes chained view changes like setView(c).setZoom(z) or panTo(c).panBy(o) end where you'd expect, makes adding and removing event listeners up to hundreds of times faster on busy maps, and validates coordinates so bad data fails where it's created instead of somewhere deep in rendering. It also brings a round of keyboard and screen reader fixes for markers, popups and controls, along with over 15 bug fixes.
on, off, once and fire are faster in the common small cases too (#10537, #6914, #6923)Point objects ~40% faster, and the array and object forms of Point and LatLng 5–15% faster (#10550)setView(c) then setZoom(z) (or the reverse) keeps both, panTo(c).panBy(o) ends at c + o, and zoomIn() calls during a zoom animation add up (#10549, #2609, #2915, #7766 by @Falke-Design)Point and LatLng coordinates, accepting numbers and numeric strings, and make Point.validate() and LatLng.validate() match exactly what the constructors accept, so they can filter data (#10550, #7765 and #7767 by @johnd0e, #8214 by @Falke-Design)coords.z in TileLayer#getTileUrl, so it can build URLs for zoom levels other than the current one (#8849, #9201 by @yohanboniface)<button> and other role="button" elements in leaflet-bar controls like links (#9462, @someonewithpc)[100, 'auto'] in iconSize (#9253)getEvents() hook to controls, like the one on layers: the map listeners it returns are added and removed with the control (#10229)riseOnHover is set to, so it's never hidden under its neighbors (#10536, #8078)aria-expanded and aria-controls on keyboard-accessible markers with a popup (#10536, #7527)alt text with the translate map option (#10542 by @nfreear, #10541)prefers-contrast: more (#6742, #7538, #10536)maxZoom (#8300, #8311 by @sbquinlan)weight is a string (#6072, #7432)autoPan panning past maxBounds (#10539 by @A350xt, #6219)DocumentFragment popup and tooltip content being empty after the first open (#10540 by @A350xt, #3922)setIcon keeping the size, anchor, bgPos and crossOrigin of the previous icon when the new one doesn't set them (#10538 by @b84330808)fitBounds and getBoundsZoom zooming all the way in when the padding is larger than the map (#10544 by @jayhemnani9910)overlaps() on Bounds and LatLngBounds returning true for a point or line inside the other bounds (#10547 by @xunguangzlj-cloud)NaN minZoom or maxZoom breaking the map's zoom limits (#10548 by @xunguangzlj-cloud, #8354)togglePopup() and toggleTooltip() throwing on a layer that isn't on the map (#10551 by @Enesuygurs)fire being called by that same fire, a regression from 1.x (#10537)setView with worldCopyJump leaving the map outside the main world copy when it doesn't animate (#10549)getCenter() returning a center snapped to whole pixels right after the map is createdtranslate option translates with a "Translatable" badge in the reference (#10546 by @Falke-Design)flyTo and pinch flags of move and zoom events (#9775), and how to stop control events from reaching the map (#10299)LatLng and Point throw Invalid LatLng object / Invalid Point object for coordinates that aren't numbers or numeric strings. null, '' and booleans used to become 0 or 1, and missing coordinates ({lat: 50}) gave NaN. A non-numeric altitude throws too, and null altitude means no altitude instead of 0. Point converts numeric strings to numbers instead of keeping them (#10550)radius on a circle or circle marker throws, and a numeric string is converted to a numberzoomIn(), zoomOut(), setZoom(), panTo() and panBy() build on the view a running animation is heading to: two quick zoomIn() calls (or clicks on the zoom button) zoom in two levels. panBy during a zoom animation waits for it to end (#10549)riseOnHover only controls hover: focused markers always come to the front (#10536)Control#_refocusOnMap is gone. ZoomControl, ScaleControl and AttributionControl add their map listeners through getEvents(), and ZoomControl and ScaleControl no longer have an onRemove methodTileLayer#_getZoomForUrl takes the tile zoom as an argumentYour coding agent can read these notes before it upgrades. Set up the MCP server →
The second beta of Leaflet 2.0 adds a built-in fullscreen control, a way to translate the built-in text, and canvas layers that no longer block clicks
The second beta of Leaflet 2.0 adds a built-in fullscreen control, a way to translate the built-in text, and canvas layers that no longer block clicks on the layers below them, along with over a dozen bug fixes.
Plugin authors: if your plugin works with Leaflet 2.0, set compatible-v2: true in its entry in docs/_plugins to list it under "Ready for Leaflet 2" on the plugins page. See the migration guide for what changed for plugins, and Leaflet.markercluster and Leaflet.heat for examples of plugins ported to support both 1.9 and 2.0.
FullscreenControl, an opt-in control that makes the map fullscreen, replacing the leaflet.fullscreen plugins. It adds 0.5 kB gzipped only when imported, and falls back to filling the window on iPhone (#10531)translate map option to translate the built-in text, such as control titles and accessible labels: translate: text => i18next.t(text). Plugins can call map.translate(text) so their text gets translated the same way (#10534, #9092)originalEvent to movestart, move, moveend, zoomstart, zoom and zoomend when the user changes the view, so listeners can tell user moves from programmatic ones (#10525)title option to LayersControlriseOnHover on keyboard focus too (#8078)aria-describedby on a layer whenever its tooltip opens, however it was openedsetView and other view changes being ignored during a zoom animation, they now apply once it ends (#10407 by @yellowman, #1289)minNativeZoom and maxNativeZoom requesting the wrong zoom level with detectRetina on retina screens (#10111, #8850)closestLayerPoint on polygons ignoring the segment that closes the ring (#9098, #9114)zIndex and setZIndex() being ignored on video and SVG overlays, and zIndex: 0 and opacity: 0 being ignored on all image overlays (#10533 by @b84330808)setContent('') leaving the old content in a popup or tooltip (#10532 by @Don-Yin)dblclick three times on iOS with a canvas renderer (#10524)contextmenu on iOS<canvas> element of a canvas renderer no longer receives pointer events, so DOM listeners added to it don't fire; listen on the layers or the map instead. The private Canvas methods _onClick, _onPointerMove, _handlePointerHover, _handlePointerOut and _fireEvent are gone; the map calls _layerAt() to find the path under the pointer (#10523)DomEvent.on(el, 'dblclick', ...) no longer simulates double taps on iOS for elements outside a map (#10524)detectRetina, minNativeZoom and maxNativeZoom are now adjusted like maxZoom. If you added 1 to them to work around #10111, remove itThe release targets Baseline 2022 browsers (Safari 15.4+) and has more breaking changes since the alpha, listed after the improvements. Removed APIs t…
The first beta of Leaflet 2.0, and a big step up from the alpha. Leaflet is now fully tree-shakeable (a map with a tile layer is 25.6 kB gzipped, down from 38 kB), ships its own TypeScript types, and is built from plain ES classes. The default marker icon now works out of the box with any bundler and can be colored and rotated. Panning, zooming and rendering are smoother and faster, keyboard and screen reader support is much better, and over 40 bugs are fixed, including the infamous seams between tiles.
The release targets Baseline 2022 browsers (Safari 15.4+) and has more breaking changes since the alpha, listed after the improvements. Removed APIs throw an error or log a one-time warning that says what to use instead, and the migration guide covers every change.
new DefaultIcon({color: 'crimson'}) (#10450, #10489, thanks to @Falke-Design for #8855)rotation option and setRotation() / getRotation() (#10489)prefers-reduced-motion by toning motion down: big zooms and pans happen instantly, flyTo doesn't zoom out and back in, and inertia is shorter (#10250 by @IvanSanchez, #10466, #10479)+ used to zoom out on Nordic layouts (#10469, based on #10096 by @babielmam)role="region" and aria-label="Map" unless already set (#10521 by @nfreear)inertiaMaxSpeed: 1400), so a fast flick no longer throws the map many screens away (#10479)smoothFactor to 0.5, reducing slivers between adjacent shapes (#10087 by @IvanSanchez)layer property on events that bubble up to a group, as an alias of propagatedFrom. It was removed in 2.0.0-alpha and broke common code without an errormousedown or keypress, throw when a Circle gets the radius as the second argument, and accept bubblingMouseEvents as an alias of bubblingPointerEvents (#9866 by @simon04)referrerPolicy: 'strict-origin-when-cross-origin' for tiles and upgrade http:// OpenStreetMap URLs to https, as the OSM tile policy requires (#9897 by @IvanSanchez, #10444)Circle radius with setStyle({radius}) (#9853 by @AbbasReads)keyboardPanDelta and zoomDelta after map creation (#10490)Draggable work outside a mapimport * as L from 'leaflet' or named imports instead of import L from 'leaflet' (#10029 by @jonkoops)Control.Zoom → ZoomControl, TileLayer.WMS → WMSTileLayer, Icon.Default → DefaultIcon, CRS.EPSG3857 → EPSG3857, Projection.Mercator → MercatorProjection, Map.Drag → DragHandler, and so on (#10054, #10055, #10056, #10057, #10058, #10059, #10063 by @simon04)dist: leaflet.js (ESM) and leaflet-global.js (global L, without AMD/CommonJS support or L.noConflict()), with source maps. The -src builds and the images folder are gone (#10443, #10027 by @jonkoops)leaflet/src/... and leaflet/dist/..., except leaflet/dist/leaflet.css (also available as leaflet/styles.css) (#9910 by @jonkoops)@types/leaflet with types shipped in the package. Type names are flat (Control.LayersOptions → LayersControlOptions), events are typed per class (no LeafletMouseEvent), and generic parameters are options and events rather than GeoJSON properties (#10496–#10510)imagePath, DefaultIcon.imagePath and shadowUrl (#10450, #10489)preferCanvas map option; use renderer: new Canvas() instead (#10438)initialize() with constructor() and super.initialize(...) with super(...) in subclasses, and remove Class.extend() in favor of class X extends Y. Init hooks now run once on the fully constructed instance (#10006 by @jonkoops, #10433 based on #10069 by @simon04 and #10179 by @reblace)X.prototype.options: change defaults with X.mergeOptions({...}) (e.g. instead of Marker.prototype.options.icon = ...), and declare them in subclasses with static defaultOptions = {...}. setDefaultOptions is deprecated (#10432, based on #10069 by @simon04 and #10179 by @reblace)Browser namespace. Use matchMedia('(pointer: coarse)').matches instead of Browser.mobile; Browser.touch was always true. The leaflet-safari class is gone, and the tapHold handler is now on by default (#10447 with @IvanSanchez)keypress event; use keydown (#10473)leaflet-dragging on the map container instead of <body>, and make map content unselectable with CSS. Text in custom panes, or in controls placed outside the control container, needs user-select: text to be selectable (#10470)aria-keyshortcuts by default, since it was only right for US keyboards; opt in with the new ariaKeyShortcuts option. KeyboardHandler.keyCodes is now keys and holds KeyboardEvent.key values (#10469, based on #10096 by @babielmam)filter and onEachFeature a Feature (the same object as layer.feature) when the input is a bare geometry, and skip features with a null geometrylatLngToLayerPoint and latLngToContainerPoint (#10494)setView(center, zoom, true) no longer force a view reset (#10507)closeTooltip() return the layer, and isTooltipOpen() return false with no tooltip boundPopup, Tooltip and DivOverlay no longer extend Layer, so Layer.include(), addInitHook() and mergeOptions() don't affect them (#10441)DomEvent functions return nothing instead of DomEvent (#10501)DomUtil.preventOutline / restoreOutline, and the third argument of Draggable (#10455)DomUtil.disableTextSelection / enableTextSelection; use user-select: none (#10470)DomEvent.getPropagationPath (use event.composedPath()), PointerEvents, getWheelPxFactor and isExternalTarget (#10431, #10501)PosAnimation (#10446)LayerGroup.invoke; use eachLayer (#9680 by @simon04)Util.emptyImageUrl (#10068 by @SerAbin1)_leaflet_* properties on DOM elements; use DomEvent.disableClickPropagation (#10501)maxHeight not scrolling or resizing with their content (#10487 by @nk-batman21)bringToFront on pointerover in Chrome 144+ (#10129)flyTo throwing for some coordinates (#10053 by @itslevo), bouncing back near maxBounds (#10477 by @Don-Yin), and shifting layers after a short flight (#9438)worldCopyJump rebuilding all tiles (#10353 by @leijurv) and throwing with an infinite CRS (#10453 by @haranishi)setIcon (#10457 by @haranishi) and turning back on after re-adding a marker (#10456 by @haranishi)'auto' icon size throwing (#10375 by @A350xt)WMSTileLayer throwing on relative URLs (#10474 by @nk-batman21) and producing invalid URLs after changing version (#10482 by @osiandhammaloka)VideoOverlay ignoring keepAspectRatio: false in Firefox and Safari (#10475 by @nk-batman21) and throwing when created from a <video> element (#10464 by @Enesuygurs)Circle.getBounds() throwing before the circle is added (#6413 by @Schleuse), and FeatureGroup.getBounds() throwing in some cases (#7232 by @rafaelgallani)tileerror (#10490)load listener (#10122 by @pierreeurope)autoPan crash when the popup is removed mid-pan (#10416 by @DeanNorman)Infinity zoom after a tiny box zoom (#6709)LineUtil.clipSegment with fractional bounds (#10284 by @spokodev)toGeoJSON dropping MultiPoints inside a GeometryCollection (#10468 by @nk-batman21)permanent/sticky options, and tooltip focus after re-adding a layer (#10490)subdomains is undefined (#7744)LatLng.validate(null) throwing (#10276 by @chatman-media), and clone() adding an alt property (#10267 by @JSap0914)removeLayer throwing on an unknown id and GridLayer.isLoading() returning undefined (#10502, #10503)main with a small Node script instead of Jekyll (#10484, #10485)Map: New export LeafletMap as an alias for Map by @willfarrell in https://github.com/Leaflet/Leaflet/pull/9804
LeafletMap as an alias for Map by @willfarrell in https://github.com/Leaflet/Leaflet/pull/9804collapseDelay by @fyyyyy in https://github.com/Leaflet/Leaflet/pull/9612addEventListener, removeEventListener, addOneTimeEventListener, fireEvent, hasEventListeners on Evented by @lukewarlow in https://github.com/Leaflet/Leaflet/pull/9781addListener, removeListener on DomEvent by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/9834For more information checkout the blog post: https://leafletjs.com/2025/05/18/leaflet-2.0.0-alpha.html
Map as LeafletMap too, so it doesn't have to shadow the global Map (#9804 by @willfarrell)collapseDelay option to the layers control, making long lists easier to scroll (#9612 by @fyyyyy)L.control factory function (#9729 by @simon04)addEventListener, removeEventListener, addOneTimeEventListener, fireEvent and hasEventListeners aliases from Evented; use on, off, once, fire and listens (#9781 by @lukewarlow)addListener and removeListener aliases from DomEvent; use on and off (#9834 by @Falke-Design)locationfound events missing accuracy and other position properties (#9793 by @radhikalism)map.locate({watch: true}) calls leaving old position watchers running (#9746 by @jorri11)Remove the long-deprecated L.Mixin.Events and _flat by @mourner in https://github.com/Leaflet/Leaflet/pull/8537
After two and a half years of hard work, we’re thrilled to announce the first alpha release of Leaflet 2.0!
This release marks a major modernization of the Leaflet codebase. We've dropped support for Internet Explorer, removed legacy methods and polyfills, adopted modern standards like Pointer Events, and now publish Leaflet as an ESM module. The global L is no longer part of the core package (though it’s still available in the bundled version leaflet-global.js for backward compatibility).
For more information checkout the blog post: https://leafletjs.com/2025/05/18/leaflet-2.0.0-alpha.html
Mouse and Touch events to PointerEventsL.marker(latlng) ➜ new Marker(latlng)<script> tag to module: <script type='module'>L with explicit imports from the Leaflet package: import { Marker } from 'leaflet'
importmap: https://leafletjs.com/examples/quick-start/module-script, assign them to the window object (Not recommended): window.map = map<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script>
const map = L.map('map').setView([51.505, -0.09], 13);
const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
</script>
<script type="importmap">
{
"imports": {
"leaflet": "https://unpkg.com/leaflet@2.0.0-alpha1/dist/leaflet.js"
}
}
</script>
<script type="module">
import L, {Map, TileLayer, Marker, Circle, Polygon, Popup} from 'leaflet';
const map = new Map('map').setView([51.505, -0.09], 13);
const tiles = new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
</script>
<script src="https://unpkg.com/leaflet@2.0.0-alpha1/dist/leaflet-global.js"></script>
<script>
const map = new L.Map('map').setView([51.505, -0.09], 13);
const tiles = new L.TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
</script>
Check out this polyfill package to help ease the transition for legacy apps: Leaflet V1 Polyfill
decoding option to ImageOverlay by @IvanSanchez in https://github.com/Leaflet/Leaflet/pull/8650aria-label for popup close button by @ShivangMishra in https://github.com/Leaflet/Leaflet/pull/8590BlanketOverlay as Renderer superclass by @IvanSanchez in https://github.com/Leaflet/Leaflet/pull/8611trackResize for L.Popup by @IvanSanchez in https://github.com/Leaflet/Leaflet/pull/9605controls option by @simon04 in https://github.com/Leaflet/Leaflet/pull/9666aria-keyshortcuts to map container by @chcederquist in https://github.com/Leaflet/Leaflet/pull/9688<section> to <fieldset> in the layers control by @tmiaa in https://github.com/Leaflet/Leaflet/pull/7912Util.bind() with Function.bind() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8484Util.isArray() with Array.isArray() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8683Util.create() with Object.create() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8681Util.trim() with String.prototype.trim() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8682Object.hasOwn() over Object.prototype.hasOwnProperty() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8684classList API for class manipulation methods in DomUtil by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8685DomUtil.hasClass() with classList.contains() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8727DomUtil.getClass() with classList.value by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8728DomUtil.setClass() method by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8729DomUtil.addClass() with classList.add() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8731DomUtil.removeClass() with classList.remove() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8732DomUtil.remove() with Element.remove() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8735DomUtil.empty() with Element.replaceChildren() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8736statics and includes from class properties by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8823.js file extension for module imports by @jessetane in https://github.com/Leaflet/Leaflet/pull/8837callInitHooks() to prototype of Class by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8825Object.setPrototypeOf() to extend Class by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8824Map.Keyboard by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8758Class to a JavaScript class by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8871__super__ property from Class by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8800Class constructor by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8872Map.BoxZoom by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8757Control.Layers by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8759TouchZoom handler to PinchZoom (keep TouchZoom as alias for backward compatibility) by @Mahendra-006 in https://github.com/Leaflet/Leaflet/pull/9642Util.getParamString with URL.searchParams by @simon04 in https://github.com/Leaflet/Leaflet/pull/9654Bounds, LatLng, LatLngBounds, Point, Transformation to ES6 classes by @simon04 in https://github.com/Leaflet/Leaflet/pull/9655Util.extend with ES6 Object.assign or object spread by @simon04 in https://github.com/Leaflet/Leaflet/pull/9652PointerEvents by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/9620CRS to ES6 classes by @simon04 in https://github.com/Leaflet/Leaflet/pull/9669L.Mixin.Events and _flat by @mourner in https://github.com/Leaflet/Leaflet/pull/8537indexOf() function from Util by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8623filter CSS property on tiles by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8651DomUtil.setOpacity by @mourner in https://github.com/Leaflet/Leaflet/pull/8730DomUtil.TRANSFORM constant by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8733TRANSITION and TRANSITION_END constants from DomUtil by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8734userSelect style by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8738DomUtil.testProp() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8739DomUtil.getStyle() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8747Browser.any3d by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8748noConflict() by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8753L_NO_TOUCH global switch by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8752Browser.canvas feature detection by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8754which and change button to main-button by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8796requestAnimFrame by @mourner in https://github.com/Leaflet/Leaflet/pull/9236requestAnimationFrame leftovers by @mourner in https://github.com/Leaflet/Leaflet/pull/9241L as new bundle leaflet-global.js by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/9686toGeoJSON() should still work if no values in coords array by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8737zoomAnimation is false and zooming via flyTo or pinch by @plainheart in https://github.com/Leaflet/Leaflet/pull/8794outlineStyle instead of outline when preventing outline by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8917description and map id by @Malvoz in https://github.com/Leaflet/Leaflet/pull/8476substr with substring by @k-rajat19 in https://github.com/Leaflet/Leaflet/pull/8517ImageOverlay.decoding by @plainheart in https://github.com/Leaflet/Leaflet/pull/8660position doc string to controls by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8570quotes ESLint rule for the spec directory by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8686debug directory by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8925prefer-exponentiation-operator linting rule and fix issues by @simon04 in https://github.com/Leaflet/Leaflet/pull/9660arrow-spacing linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8584func-name-matching linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8585no-duplicate-imports linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8586prefer-template linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8587prefer-rest-params linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8593object-shorthand linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8592prefer-arrow-callback linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8594no-var linting rule and fix issues by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8602reference.html by @Malvoz in https://github.com/Leaflet/Leaflet/pull/8475actions/cache to version 3.2.0 by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8742prosthetic-hand from GitHub by @jonkoops in https://github.com/Leaflet/Leaflet/pull/9033versioning-strategy for NPM to increase by @jonkoops in https://github.com/Leaflet/Leaflet/pull/9165version when npm version is called by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/9717changes the option 'wheelPxPerZoomLevel' by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8481index.html and add missing RectangleSpec by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8499getWheelPxFactor and fix test changes the option 'wheelPxPerZoomLevel' for mac by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8512panBy test by @adrianaris in https://github.com/Leaflet/Leaflet/pull/8420ui-event-simulator and import as JavaScript module by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8977chai and sinon in the test suite by @jonkoops in https://github.com/Leaflet/Leaflet/pull/9284debug directory by @jonkoops in https://github.com/Leaflet/Leaflet/pull/8926stop (#8369) by @victorpatru in https://github.com/Leaflet/Leaflet/pull/8581Full Changelog: https://github.com/Leaflet/Leaflet/compare/v1.9.4...v2.0.0-alpha
The first alpha of Leaflet 2.0, a major modernization of the codebase. Leaflet is now published as ES modules with classes instead of factory functions, uses Pointer Events instead of mouse and touch events, and drops Internet Explorer and other legacy browsers along with a lot of compatibility code. See the announcement for an upgrade guide.
BlanketOverlay, a base class for overlays that cover the whole map, extracted from Renderer (#8611 by @IvanSanchez)aria-keyshortcuts to the map container (#9688 by @chcederquist)trackResize option to Popup, updating the popup when its content changes size (#9605 by @IvanSanchez)closeButtonLabel option to Popup (#8590 by @ShivangMishra)decoding option to image overlays (#8650 by @IvanSanchez)controls option to VideoOverlay (#9666 by @simon04)ResizeObserver, not just window resizes (#8612 by @IvanSanchez)import {Map, TileLayer} from 'leaflet'; a global L is only available from the new leaflet-global.js bundle. The UMD build is gone (#8826 by @jonkoops, #9686 by @Falke-Design)L.marker(latlng) becomes new Marker(latlng), and so on (#9626 by @Falke-Design)mousedown, mouseup, mouseover, mouseout and mousemove events become pointerdown, pointerup etc., bubblingMouseEvents becomes bubblingPointerEvents, map.mouseEventToLatLng() and similar become pointerEventToLatLng(), and DomEvent.getMousePosition becomes getPointerPosition. The touchZoom handler is renamed to pinchZoom, with the old name kept as an alias (#9620, #8758, #8759 by @Falke-Design, #8757 by @jonkoops, #9642 by @Mahendra-006)L_NO_TOUCH switch, and most Browser flags (ie, edge, webkit, gecko, android, opera, any3d, svg, canvas, vml and others) (#8196, #8600, #8559, #8748, #8752, #8754, #9622 and more by @jonkoops and @Falke-Design)Util.bind, create, extend, indexOf, isArray, trim, getParamString, requestAnimFrame and cancelAnimFrame, and the L.bind, L.extend, L.setOptions and L.stamp shortcuts (#8484, #8681, #8682, #8683, #8623 by @jonkoops, #9652, #9654 by @simon04, #8810 by @jonkoops, #9236, #9241)DomUtil.hasClass, addClass, removeClass, setClass, getClass (use classList), remove, empty, setOpacity, getStyle, testProp, TRANSFORM, TRANSITION and TRANSITION_END (#8685, #8727, #8728, #8729, #8731, #8732, #8735, #8736, #8733, #8734, #8739, #8747 by @jonkoops, #8730)L.Mixin.Events and _flat (#8537), and the __super__ property of classes (#8800 by @jonkoops)<fieldset> instead of <section> for the layers control list (#7912 by @tmiaa)filter CSS property, an old IE fix that clashed with modern CSS filters (#8651 by @jonkoops)DomUtil.setPosition in a WeakMap instead of the _leaflet_pos property (#8749 by @jonkoops)flyTo ignoring minZoom and maxZoom (#9025 by @yohanboniface){z} on fractionally zoomed maps (#8613 by @raychanks)Circle having no radius in a CRS.Simple with an inverted x axis (#9414 by @bakp22)shadowUrl is null (#9607 by @Falke-Design)dashOffset (#9649 by @Falke-Design)touchmove events while dragging (#9639 by @Falke-Design)transitionend listener not being removed with the map (#9048 by @samclaus)Fix tile gaps in Chromium-based browsers (#8891 by @IvanSanchez)
zoomAnimation is false and zooming via flyTo or pinch (#8794 by @plainheart)toGeoJSON() still works with an empty array (#8737 by @Falke-Design)LineUtil and PolyUtil only iterate over array values and not properties (#8840 by @Falke-Design)LineUtil and PolyUtil for small layers (#8784 by @Falke-Design)Tooltip-bound FeatureGroup that contains a layer without a getElement method (#8890 by @Falke-Design)Tooltip is not showing when loaded dynamically while moving the map (#8672 by @theGOTOguy)noMoveStart option not applying to fitBounds (#8911 by @AbdullahSohail-SE)Expand the layers control on Enter keydown (#8556 by @larsgw)
L global (#8536 by @mourner)setMaxBounds(map.getBounds()) (#8534 by @rjackson)latLngsToCoords() does not return references passed to it (#7344 by @marlo22)worldCopyJump() behavior is consistent when using a keyboard (#8562 by @Falke-Design)popupopen event (#8571 by @Belair34)Popup (#8520 by @rjackson)position: sticky for map container (#8550 by @tmiaa)⚠️ Drop ESM entrypoint from package because of numerous compatibility issues with plugins (import leaflet/dist/leaflet-src.esm.js explicitly instead t
leaflet/dist/leaflet-src.esm.js explicitly instead to take advantage; ESM by default will come in v2) (#8493 by @jonkoops)Bounds equals parameters in docs (#8500 by @Falke-Design)Fix Events listens not propagating to parent objects, in particular fixing compatibility with Leaflet.markercluster plugin (#8211 by @Falke-Design)
Events listens not propagating to parent objects, in particular fixing compatibility with Leaflet.markercluster plugin (#8211 by @Falke-Design)Replace deprecated eslint-plugin-script-tags (#8331 by @jonkoops)
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:
L is probably intimately familiar to you. This is the Leaflet global where all of Leaflet's functionality lives. 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.color-adjust to print-color-adjust (#8211 by @Malvoz)content and latLng options to Popup / Tooltip constructors (#7783 by @Falke-Design)Bounds to have the same functions as LatLngBounds (#7882 by @Falke-Design)getCenter() calculation and move it to PolyUtil / LineUtil (#7603 by @Falke-Design)maxBounds (#8168 by @mourner)Events.listens to search for specific function (#8161 by @Falke-Design)noMoveStart option to panTo (#6685 by @Chivano)FeatureCollection handling to geometryToLayer (#8163 by @Falke-Design)Tooltip accessibility (focus and voice over) (#8247 by @alekzvik)role="presentation" from image tiles (#8172 by @Malvoz)map._move over requestAnimFrame (#8328 by @AMDvsTMD)_isClickDisabled to not throw no error if parent is removed from DOM (#8288 by @Falke-Design)DomEvent.DoubleTap to ignore clicks on <label>s with a for attribute (#8227 by @IvanSanchez)once() twice if same event is fired inside once (#8190 by @Falke-Design)map.getCenter() returning a mutable object (#8167 by @mourner)min/maxZoom when used in combination with detectRetina (#7328 by @bozdoz)anchor to data-anchor (#8174 by @KnightJam1)eslint-plugin-script-tags (#8331 by @jonkoops)map.latLngToLayerPoint method (#8407 by @kreloaded)map.panTo (#8390 by @anurag-dhamala)map.containerPointToLatLng and map.latLngToContainerPoint (#8384 by @abhi3315)Layer._addZoomLimit (#8037 by @zishiwu123)Map (#8206 by @stephenspol)CircleMarker._containsPoint (#8340 by @gernhard1337)We've since released:
v1.8.0 is a culmination of 1.5 years of development, a huge release focused on bug fixes, major reliability and accessibility improvements, cleaning u
v1.8.0 is a culmination of 1.5 years of development, a huge release focused on bug fixes, major reliability and accessibility improvements, cleaning up legacy code, and numerous improvements to documentation, development workflow and release process. A culmination of hundreds of contributions, and a preparation for bigger changes to come. 🍃
I'm making this release just as an air raid alert is sounding outside, in Kyiv, warning about an imminent Russian air strike. This release is dedicated to Ukrainian fight for freedom and democracy against the Russian invasion 🇺🇦 (see how you can support Ukraine here).
From now on, releases will become much more frequent. Thanks to our amazing community for all your help and patience. ❤️🙏 Special thanks to @johnd0e who revived Leaflet development after long stagnation and made the biggest contributions, @Falke-Design for doing the bulk of the work organizing development and preparing the release, @Malvoz for his numerous accessibility contributions, and @jonkoops for help with workflow automations. ❤️
contextmenu event simulation on mobile Safari by introducing a new TapHold handler, replacing legacy Tap (#7026 by @johnd0e)DivOverlay/Popup/Tooltip APIs (#7540 by @johnd0e)
Popup related options from DivOverlay to Popup (#7778 by @Falke-Design)Tooltip class from leaflet-clickable to leaflet-interactive (#7719 by @Falke-Design)Map.closeTooltip now requires a layer as argument (#7533 by @johnd0e)DomEvent.Pointer) (#7059, #7084, #7415 by @johnd0e)dblclick event simulation on touch devices (DomEvent.DoubleTap) (#7027 by @johnd0e)disableClickPropagation (#7439 by @johnd0e)Map hasLayer() and LayerGroup hasLayer() to require a layer as argument (#6999 by @johnd0e)Class.include to not overwrite options (#7756 by @johnd0e)Class.extend to not modify source props object (#6766 by @johnd0e)Browser.touch touch devices detection (#7029 by @johnd0e)font-size relative to the map container. (You can change the font size on leaflet-container to adjust it if needed.) (#7800 by @Chandu-4444)DivOverlay / Tooltip interactive (#7531, #7532 by @johnd0e)openOn, close, toggle functions to DivOverlay (#6639 by @johnd0e)DomEvent.off(el) to remove all listeners (#7125 by @johnd0e)false to Util.formatNum / toGeoJSON (#7100 by @johnd0e)autoPanOnFocus to Marker (#8042 by @IvanSanchez)referrerPolicy to TileLayer (#7945 by @natevw)playsInline to VideoOverlay (#7928 by @Falke-Design)getCenter to ImageOverlay (#7848 by @Falke-Design)tileabort event when a TileLayer load is cancelled (#6786 by @dstndstn)crossOrigin to Icon (#7298 by @syedmuhammadabid)will-change CSS property on tile images (#7872 by @janjaap)GridLayer.onAdd (#7570 by @johnd0e)panInside (#7469 by @daverayment)TileLayer URL (#7216 by @lubojr)Tooltip bound to ImageOverlay (#7306 by @IvanSanchez)mousemove through Canvas to map if it has no layers (#7809 by @johnd0e)Layer to Control.Attribution (#7764 by @johnd0e)vmlCreate() so that it does not expose closure to TypeError (#7279 by @darcyparker)Control.Layers by not relying on Browser android and touch properties (#7057 by @johnd0e)Tooltip by not relying on Browser touch checks (#7535 by @johnd0e)Browser mutable for easier automated testing (#7335 by @bozdoz)div with span in Control.Layers container to fix an HTML validation error (#7914 by @tmiaa)Marker to default to role="button" & alt="marker" for an improved screen reader experience (#7895 by @tmiaa)role="button" for appropriate semantics on the <a> layers control (#7850 by @Malvoz)outline on focus for keyboard events (#7259 by @jafin)leaflet-container for keyboard users (#7996 by @Malvoz)font-size units for resizable text (#7800 by @Chandu-4444):hover styles to :focus as well (#7274 by @Malvoz)Marker jumping position while zooming in certain cases (#7967 by @Falke-Design)Tooltip while dragging the map (#7862 by @Falke-Design)Class prototype (#7459 by @Falke-Design)Tooltip options permanent & sticky to work together (#7563 by @Falke-Design)locate event listener (#7813 by @Falke-Design)Tooltip bindTooltip to unbind existent tooltip (#7633 by @Falke-Design)if condition, to add zoom limits for Layer (#7609 by @vcoppe)GridLayer redraw tiles after changing maxNativeZoom (#6443 by @cherniavskii)Popup keepInView if the map needs to panned over a long distance (#7792 by @Falke-Design)add/removePointerListener (#7808 by @johnd0e)mousedown event calling after dragging Canvas map (#7781 by @johnd0e)console.warn pollution (#7748 by @johnd0e)contextmenu event default-preventing when there are >1 target candidates (#7544 by @johnd0e)Popup-tip from firing on map. (#7541 by @johnd0e)Path.setStyle before adding the layer to the map (#6941 by @NielsHolt)BoxZoom after cancel with ESC (#7597 by @Falke-Design)noConflict (#7855 by @Falke-Design)latLngToCoords and latLngsToCoords not accepting array form of lat/lngs (#7436, by @Relkfaw)zoomend event (#7460 by @xeruf)false to prefix of Control.Attribution (#7814 by @Falke-Design)LayerGroup inherit from Interactive Layer (#7763 by @johnd0e)Map.panInside documentation (#7397 by @daverayment)Renderer documentation to clarify tolerance option is for Canvas only (#7515 by @Hippl-Eric)propagate argument (#7103 by @riffaud)plugins.md into many files for easier maintenance (#7805 by @Falke-Design)npm run serve to serve docs on localhost (#7973 by @Falke-Design)master branch to main (#7921 by @jonkoops)leaflet-include.js from debug samples (#7776 by @Falke-Design)Internet Explorer 11 (#7741 by @jonkoops)FirefoxNoTouch (#7736, #7742 by @johnd0e)PhantomJS from test suite (#7660, #7724 by @jonkoops).near and .nearLatLng usage (#7820 by @johnd0e)captureTimeout and browserSocketTimeout (#7856 by @Falke-Design)DomEvent with unit tests (by @stephenspol in https://github.com/Leaflet/Leaflet/pull/8088)DomUtil with unit tests (#7547, by @LGNorris)Fix vector drift when dragging and immediately zooming (by @manubb @johnd0e @mourner in https://github.com/Leaflet/Leaflet/pull/8103)
autoPanOnFocus on icons with no iconSize (by @Falke-Design in https://github.com/Leaflet/Leaflet/pull/8091)DomEvent with unit tests (by @stephenspol in https://github.com/Leaflet/Leaflet/pull/8088)(Skipped v1.8.0-beta.2 because of a publishing blunder)
Nothing published for this version
Fix Uncaught TypeError: t is undefined error with markers in some editing/drawing plugins (#8084, by @Falke-Design)
Changes since v1.8.0-beta.0:
Uncaught TypeError: t is undefined error with markers in some editing/drawing plugins (#8084, by @Falke-Design)(changelog moved to v1.8.0 final)
(changelog moved to v1.8.0 final)
Nothing published for this version
Fix build toolchain to reflect uglifyjs upgrade from v2 to v3 (by @ivansanchez)
VideoOverlay now can take a muted option (#7071 by @ronikar)featureGroup factory method now takes options, as the FeatureGroup constructor (#7160 by @frogcat)touchstart/touchend events (#7008 by @yneet)PointerEvents-capable browsers in L.Browser, and related changes to Tap, Drag, and TouchZoom handlers (#7010, (#7033, (#7036, (#7068, (#7195 by @johnd0e)L.Browser (#6930 by @Ivan-Perez)moveend listener from map.setMaxBounds (#6958 by @simon04)bind call in ESM environments (#6970 by @shintonik)closePopup exists before calling it automatically (#6962 by @pke)layerGroup.hasLayer() with wrong layerId (#6998 by @johnd0e)click filter targeting Android 4.x browsers (#7013 by @johnd0e)Bounds.overlaps() and Bounds.intersects() (#7075 by @mondeja)maxNativeZoom === maxZoom (#7094 by @johnd0e)GridLayer's zoom-level loading algorithm (#7123 by @johnd0e)tooltipAnchor behavior for different tooltip directions (#7155 by @Istador)Polyline.addLatLng() (#6924 by @life777)map.setMaxBounds() (#7001 by @johnd0e)jekyll when building docs (#7014 by @vncntcltt)divOverlay.getElement() (#7111 by @mondeja)Marker.shadowPane (#7135 by @mi-v)Layer.removeFrom() regarding LayerGroups (by @ivansanchez)LatLngBounds.overlaps() #7194 by @DerZade)VideoOverlay now can take a muted option (#7071 by @ronikar)
VideoOverlay now can take a muted option (#7071 by @ronikar)featureGroup factory method now takes options, as the FeatureGroup constructor (#7160 by @frogcat)touchstart/touchend events (#7008 by @yneet)PointerEvents-capable browsers in L.Browser, and related changes to Tap, Drag, and TouchZoom handlers (#7010, (#7033, (#7036, (#7068, (#7195 by @johnd0e)L.Browser (#6930 by @Ivan-Perez)moveend listener from map.setMaxBounds (#6958 by @simon04)bind call in ESM environments (#6970 by @shintonik)closePopup exists before calling it automatically (#6962 by @pke)layerGroup.hasLayer() with wrong layerId (#6998 by @johnd0e)click filter targeting Android 4.x browsers (#7013 by @johnd0e)Bounds.overlaps() and Bounds.intersects() (#7075 by @mondeja)maxNativeZoom === maxZoom (#7094 by @johnd0e)GridLayer's zoom-level loading algorithm (#7123 by @johnd0e)tooltipAnchor behavior for different tooltip directions (#7155 by @Istador)Polyline.addLatLng() (#6924 by @life777)map.setMaxBounds() (#7001 by @johnd0e)jekyll when building docs (#7014 by @vncntcltt)divOverlay.getElement() (#7111 by @mondeja)Marker.shadowPane (#7135 by @mi-v)Layer.removeFrom() regarding LayerGroups (by @ivansanchez)LatLngBounds.overlaps() #7194 by @DerZade)GeoJSON.resetStyle - allow invocation without an argument (#6663 by joukewitteveen)
GeoJSON.resetStyle - allow invocation without an argument (#6663 by joukewitteveen)markersInheritOptions option to L.GeoJSON (#6866 by ghybs)oldLatLng coordinates to L.CircleMarker move event (#6719 by errnesto)L.Util.formatNum (#6668 by cherniavskii)className option in SVGOverlay and VideoOverlay (#6679 by IvanSanchez)mousehover throttle on mouseout (#6749 by IvanSanchez)L.Path.setStyle (#6728 by TheRealTorreySmith)dblclick event when both Pointer Events and Touch Events are available (#6855 by filcab)Marker when icon is not present (#6794 by BenTalagan)Fix module export regression (#6647 by cherniavskii)
Add keepAspectRatio option to VideoOverlay (#6038 by ronikar)
keepAspectRatio option to VideoOverlay (#6038 by ronikar)keydown and keyup events to map (#6421 by OrBin)shadowPane option to Marker (#6460 by alexfig)L.SVGOverlay class (#6517 by Zsavajji)getIcon method to Marker (#6457 by OsamaShabrez)DivIcon html option accept Element (#6571 by oscar-sensornet)GeoJSON._setLayerStyle (#6616 by johnd0e)openPopup and openTooltip code (#6613 by johnd0e)Control.Layers radio buttons when using multiple maps (#6483 by jjimenezshaw)L.Util.formatNum rounding precision (#6587 by inkstak)Marker without icon (#6610 by charlie67)dblclick event relate to left mouse button (#6628 by IvanSanchez)toGeoJSON's precision argument (#6375 by rkatka)Events.off method docs (#6619 by lancebendo)Layer example (#6636 by billygarrison)Add new Map.panInside method (#6054 by daverayment)
Map.panInside method (#6054 by daverayment)_drawnLayers object (#6324 by ud09)TileLayer.setUrl() when URL does not change (#6313 by JackNeus)section instead of form in layers control (#6380 by hundekoerper)DomUtil.getClass function (#6366 by Schleuse)bringToFront/Back() (#6389 by perliedman)autoPan option when popup content gets updated while a panning animation is running (#6365 by Schleuse)<tr> (#6334 by mgred)Reset max-width and max-height styles for tiles in custom panes (#6255 by jerekshoe)
cursor: grab style (#6281 by Malvoz)GridLayer into TileLayer (#6264 by IvanSanchez)Canvas dashArray option (#6277 by IvanSanchez)webkitTransform property, which broke transformations on certain Webkit browsers (#6290 by tuckergordon)zoomControl map option (#6254 by IvanSanchez)ImageOverlay docs (#6266 by jgravois)Remove module field from package.json to fix plugin compatibility issues
module field from package.json to fix plugin compatibility issues (#6239)module field from package.json (#6239)Add use-credentials CORS option to ImageOverlay and TileLayer (#6016 by caleblogan) + unit tests (#6022 and #6027 by ghybs)
use-credentials CORS option to ImageOverlay and TileLayer (#6016 by caleblogan) + unit tests (#6022 and #6027 by ghybs)L in source code (#6047 and #6048 by ghybs)Canvas dashArray option + support array type (#6200 by McBen)preferCanvas option in all panes (#6019 by mjumbewu)tileload event if tile has empty src (#6025 by cherniavskii)Polygons with empty array of LatLngs (#6119 by BakuCity)Map panes example (#6018 by ghybs)closestLayerPoint method (#6060 by mattdsteele)VideoOverlay.js example docs (#6090 by zhuang-hao-ming)LatLng docstring (#6138 by jieter)Browser.retina explanation (#6203 by JLuc)node_modules (#6028 by cherniavskii)jake dependency and use NPM scripts instead (#5828 by cherniavskii)ssri dependency to 5.2.2 (#6086 by cherniavskii)getBoundsZoom parameter inside (#6192 by ghybs)Fix L.TileLayerregression, which caused incorrect tile URLs (#6006 by ghybs)
Add typeof check to checkDeprecatedMixinEvents (#5901 by murb)
tolerance option to L.Renderer instead of hardcoded tolerance for touch devices (#5922 by Muscot).autoPan option to L.Marker (#5651 by alenaksu)closeOnEscapeKey option to L.Popup (#5730 by Mickyfen17)tileerror tests to L.GridLayer spec (#5805 by msiadak)eachLayer method for iterations over layers in L.LayerGroup (#5809 by cherniavskii)Util.formatNum default to 6 decimals (#5492 by fminuti)zoomlevelschange event when calling setMinZoom & setMaxZoom (#5230 by mynameisstephen)L.TileLayer's getTileUrl method (#5822 by broncha)L.LayerGroup accept options (#5792 by iH8)typeof check to checkDeprecatedMixinEvents (#5901 by murb)addTo static function to L.Handler class (#5930 by cherniavskii)L.ImageOverlay accepts ImageElement (#5948 by ronikar)L.VideoOverlay, which caused map crash in IE8 (#5731 by Dzwiedzminator and #5785 by cherniavskii)_tiles cache when they're aborted (#5634 by oliverheilig)L.TileLayer infinite error loop (#5783 by cherniavskii)this._map in L.Marker's update method (#5736 by dnepromell)L.ImageOverlay className option (#5830 by cherniavskii)L.TileLayer.WMS when using Polar stereographic (#5618 by scaddenp)GridLayer's _tileZoom to undefined instead of null (#5888 by iH8)L.Map's map.flyTo method to respect noMoveStart option (#5923 by iPrytz)touchZoom is disabled (#5952 by cherniavskii)L.SVG to reset size on remove from map (#5966 by ghybs)L.Marker to set alt attribute for img-based Icons only (#5979 by msiadak)PolyLine.closestLayerPoint (#5701 by perliedman)DomEvent.stop event type to docs (#5733 by theashyster)L.LatLngBounds pad method (#5748 by CalvinWilliams1012)L.FeatureGroup bringToBack method docs (#5788 by fpopa)L.LatLng distanceTo method description (#5791 by loisgh)L.DomEvent.off() (#5855 by 77ganesh and #5976 by kring)L.SVG factory docs to appropriate place (#5864 by cherniavskii)mouseup event for interactive L.Layer (#5941 by germansokolov13)L.Icon's tooltipAnchor option, update tooltipAnchor and popupAnchor default values docs (#5989 by cherniavskii)legacy option in rollup config - now Leaflet works in IE again (#5929 by IvanSanchez)Fixes non-extendable objects regression of 1.1.0 (#5658 by mourner)
Fixes non-extendable objects regression of 1.1.0 (#5658 by mourner)
For a detailed changes, see the full changelog
L.LineUtil._flat public as L.LineUtil.isFlat (#5667 by yohanboniface)L.ImageOverlay's setBounds method accepts an array of points, not only a L.LatLngBounds instance (#5687 by ronikarVideoOverlay accepts VideoElement (#5661 by eavidan-0)addLayer with something that is not a Layer (#5689 by perliedman)leaflet.js (#5682 by jgravois)Control.Layers properly handles adding the same layer multiple times, as well as cleanup (#5672, #5684 and #5673 by jjimenezshaw)L.Draggable._dragging public again (#5659 by yohanboniface)DomEvent.off returns this (#5601 by jelhan)L internally (#5596 by atd-schubert)this instead of addOne in DomEvent.disableScrollPropagation (#5595 by Eschon)Add deprecation notice for L.Mixin.Events, fixes #5358 (#5365) (by perliedman)
1.1.0 is a feature release. Changes since 1.0.3 are:
L.Mixin.Events, fixes #5358 (#5365) (by perliedman)nonBubblingEvents into a documented boolean option (#4883 by IvanSanchez)L.transformation factory, allow creation from array (#5282 by anetz89)toGeoJSON methods now default to a precision of six decimals (as recommended in the GeoJSON spec), precision is settable through a method parameter (#5544 by mattgrande)reference.html now always points to latest stable docs (#5490 by IvanSanchez, #5493 by alyhegazy)L.VideoOverlay (#4988 by IvanSanchez)ImageOverlay layer and added tests for the new (#5416 by Saulzi)className option for ImageOverlay (#5555 by perliedman)_getBoundsCenterZoom (#5157 by IvanSanchez)L.Bounds for 2 missing corners, fixes #5475 (#5488 by ghybs)Polylines with empty array of LatLngs, #5497 (#5498, by perliedman)devicePixelRatio into account for scrollwheel zoom in win10+chrome (#5480) (by IvanSanchez)Infinity (#5478, #5479 by IvanSanchez)L.Mixin.Events a simple object instead of a prototype so it doesn't have a 'constructor' property, fixes #5451 (#5453 by luiscamachopt)ctx.setLineDash in _fillStroke #5182 (#5454 by TeXitoi)toFront/toBack if needed, fixes #4050 (#5465 by perliedman)L.Popup's close button (#5461 by Mirodil)DomUtil.preventOutline (#5435 by qjas)ImageOverlay for 404 links (#5307) by APwhitehat)collapsed: false, fixes #5328 (#5348 by ghybs)LayerGroups (#5359 by Resonance1584)lastId in Util (#5349 by DenisCarriere)iframe borders on examples (#5327) (by tariqksoliman)min/maxNativeZoom from TileLayer into GridLayer, as per #5316. (#5319 by jkuebart)-webkit-tap-highlight-color, fixes #5302 (#5303 by IvanSanchez)LatLngBounds.equals method (#5071 by miguelcobain)L.Draggable options and fix docstring (#5301 by IvanSanchez)getBoundsZoom, fixes #5136 (#5137 by IvanSanchez)marker.dragging when not on the map, fixes #5293 (#5295 by danzel)L.Layers.Control in chrome>55 (#5280 by IvanSanchez)Leaflet 1.0.3 is a bugfix release. Changes since 1.0.2:
Leaflet 1.0.3 is a bugfix release. Changes since 1.0.2:
L.Canvas redraws on several scenarios (by @perliedman, #5250, also thanks to @manubb for investigation and PR).dblclick events in Chrome 55 due to PointerEvents (by @IvanSanchez, #5185, #5248, #5268).L.SVG.VML for IE8 (by @IvanSanchez, #5215).popupopen event (by @hagai26, #5202).getBoundsZoom return value on CRSs with a flipped axis (by @computerlove, #5204).errorTileUrl of a L.TileLayer returns 404 (by @IvanSanchez, #5177).L.Canvas redraw areas to avoid artifacts during partial updates (by @Ernie23, #5148).isPopupOpen() behaviour of L.Layer when no popup is bound to a layer (by @gvangool, #5106).LatLngBounds.contains() to allow for non-instantiated LatLng objects (by @IvanSanchez, #5135).L.Control.Layers when the collapse option is false (by @perliedman, #5131).WrapLatLngBounds method to L.CRS, to fix an issue with maxBounds of GridLayers (by @IvanSanchez, #5185, also thanks to @DiogoMCampos for investigation).L.Map.getSize() will now return 0 instead of NaN in non-graphical environments (by @ughitsaaron, #5209).alt attribute to the <img>s of marker shadows (by @topicus, #5259).Leaflet 1.0.2 is a small release with a dozen bugfixes and a couple small improvements. Changes since v1.0.1:
Leaflet 1.0.2 is a small release with a dozen bugfixes and a couple small improvements. Changes since v1.0.1:
max-width is already set (by @brunob, #5046).mouseover events for same layer (by @perliedman, #5033).L.Canvas vectors during a zoom animation (by @ghybs) #5011.FeatureCollections (by @IvanSanchez), #5045.minZoom/maxZoom late inizialization (by @IvanSanchez), #4916.mouseover/mouseout events on overlapping L.Canvas layers (by @perliedman), #5090.L.Control.Layers.collapse() on initially uncollapsed layer controls (by @perliedman), #5090.L.Tooltip by rounding up pixel coordinates (by @ashmigelski), #5089.L.Canvas (by @perliedman), #5100.sortLayers option to L.Control.Layers (by @IvanSanchez, #4711.bringToFront and bringToBack when using L.Canvas, plus preventing other canvas glitches (by @perliedman), #5115.minNativeZoom option to L.TileLayers. (by @bb-juliogarcia), #5088.L.Paths by refactoring away event logic (by @IvanSanchez) #5054)].L.Marker and L.Map no longer have a separate file (by @mourner).Leaflet 1.0.1 is a small bugfix release, containing two bug fixes since the previous version:
Leaflet 1.0.1 is a small bugfix release, containing two bug fixes since the previous version:
Remove deprecated zoomanimated option for L.Popups (by @fnicollet) #4699
Leaflet 1.0 final, a culmination of several years of work by dozens of contributors from all over the world. This is the fastest, most stable and polished Leaflet release ever. Read the announcement blog post.
Changes since 1.0-rc3:
zoomanimated option for L.Popups (by @fnicollet) #4699bower.json (by @anotherredward) #4865L.Icon default path using CSS (by @IvanSanchez) #4605getScaleZoom in some custom CRSs (by @theashyster) #4919L.Path event handlers against race conditions (by @perliedman and @IvanSanchez) #4855 #4929 #4838L.GridLayers, wrap tileBounds when noWrap is false (by @fyeah) #4908L.Path's bringToFront() behaviour in the Edge browser (by @nikolai-b) #4848getCenter() when a L.Polygon has no map and thus no CRS (by @snkashis) #4820_leaflet_id to map containers to prevent error when removing a map twice (by @IvanSanchez) #4810L.Tooltip offset option now defaults to [0, 0] (by @yohanboniface) #4773
L.Tooltip offset option now defaults to [0, 0] (by @yohanboniface) #4773L.Tooltip zoom animation (by @yohanboniface) #4744layer.bindTooltip crashing when called before adding the layer to the map (by @yohanboniface) #4779L.Popup autopaning (by @yohanboniface) #4768L.Tooltip not being closed on touch when touching the map (by @yohanboniface) #4767popupopen and popupclose not being fired when clicking on path with an open popup (by @yohanboniface) #4788Make L.Handler.enable/disable return this (by @yohanboniface) #4708
L.Handler.enable/disable return this (by @yohanboniface) #4708size option can now be initialised with a number (by @rheh) #4608classname option to L.GridLayer (by @jayvarner) #4553Map.addLayer (by @nathancahill) #4504x and y properties (by @nathancahill) #4465updateWhenZooming option to L.GridLayer (by @IvanSanchez) #4462popup.options.offset when computing popup offset (fix #4645) (by @yohanboniface) #4662L.Bounds for "marking as prunable" and loading tiles (by @IvanSanchez) #4650L.Tooltip class to display small tooltips on the map (by @yohanboniface) #3952GridLayer's outer edge snapping to vertical center of map (fix #4702) (by @yohanboniface) #4704pointer-events: visiblePainted as fallback for IE <11 (by @perliedman) #4690abbr in website (by @brunob) #4663L.DomUtil.create() from automatically setting a CSS class name (by @MuellerMatthew) #4563Control.Layers._getLayer (by @ValentinH) #4561getWheelDelta() (by @IvanSanchez) #4538getBoundsZoom with small size and padding (by @dianjin) #4532L.Control.Layers in IE8 (by @jieter) #4509TileLayer's retina logic when zoomReverse is enabled. (by @perliedman) #4503setMaxBounds not resetting maxBounds when passing null argument (by @yohanboniface) #4494L.Control.removeLayer() raising an error when trying to remove a layer not yet added (by @jieter) #4487L.Evented.listens() on removed event handlers, #4474 (by @IvanSanchez) #4476markerZoomAnimation event hooks (by @IvanSanchez) #4460Make L.Control.Layers.collapse/expand public methods (by @yohanboniface) #4370
L.Control.Layers.collapse/expand public methods (by @yohanboniface) #4370L.latLngBounds factory return an empty bounds with no argument (by @yohanboniface) #4368Map.fitBounds now raises an error if bounds are not valid (by @theotow) #4353L.Circle (by @JrFolk) #4290NaN circle radius (by @IvanSanchez) #4237L.Class.include() & mergeOptions() now return this (by @IvanSanchez) #4246L.LatLng.equals to L.CRS.equals. (by @perliedman) #4074{-y} in tile layer urls (by @jieter) #4337dashArray path option in canvas (by @gommo) #4173navigator.pointerEnabled (by @IvanSanchez) #4287L.Control.Layers internally (by @jieter) #4227L.Browser.edge (by @IvanSanchez) #4143L.DivIcon.bgPos option to L.Point (by @perliedman) #4090Map.fitBounds (by @perliedman) #4377flyTo (by @hyperknot) #4376L.CRS.Earth. (by @perliedman) #4369setLineDash. (by @perliedman) #4364Map.TouchZoom (by @IvanSanchez) #4340this._times.length undefined in Map.Drag.js (by @LucasMouraDeOliveira) #4324L.Path (by @elkami12) #4314L.Control.Layer that is not on the map (by @errebenito) #4280Map.attributionControl only set on addInitHook (by @snkashis) #4263e.originalEvent in DomUtil._filterclick (by @IvanSanchez) #4256L.Draggable (by @turban) #4250Map.stop (by @IvanSanchez) #4229Map.fadeAnimation and GridLayer.opacity (by @IvanSanchez) #4228L.Browser.any3d (by @IvanSanchez) #4212pxBounds validity before using it (by @yohanboniface) #4191L.Circle radius (by @IvanSanchez) #4133dblclick instead of touch events (by @IvanSanchez) #4131L.Polyline's pixel bounds. (by @perliedman) #4114undefined property (by @robertleeplummerjr) #4113tileunload for all unloading of tiles (by @tcoats) #4099L.GridLayer.retainParent() (by @jblarsen) #4094_enforcingBounds. (by @perliedman) #4089L.Control.Layers where calling map._size instead of getSize() (by @Brobin) #4063resetStyle (by @yohanboniface) #4028maxZoom not honoring 0 (by @simsibimsiwimsi) #4000L.GridLayer._updateLevels() when out of min/max zoom (prevents IE8 exceptions) (by @IvanSanchez) #3999L.DomUtil.getPosition() should return a fallback value (for VML in IE8) (by @IvanSanchez) #3998L.Marker: init interaction regardless of new icon or not (by @celadevra) #3978interactive=false not taken into account for canvas (by @yohanboniface) #3956Beta 2 fixes over 50 bugs that were reported by users trying out beta 1. The vast majority of changes are small fixes to problems that are triggered i
Beta 2 fixes over 50 bugs that were reported by users trying out beta 1. The vast majority of changes are small fixes to problems that are triggered in very specific situations or conditions, a few API consolidation changes, and a few browser workarounds.
L.circle now accepts radius as an option (like L.circleMarker) rather than a second argument (by @IvanSanchez)preclick event during drag (by @yohanboniface) #3632L.ImageOverlay.setBounds() and fixed image overlay initialization (by @fminuti) #3680mousedown events (by @yohanboniface) #3682msPointer events (by @IvanSanchez) #3684Geolocation.clearWatch() #3707bringToFront and bringToBack to popups (by @danzel). #3908 #3307preventOutline exceptions #3625contextmenu behaviour when there are no event listeners (by @yohanboniface) #3638max-width (by @davidjb) #3647mouseout and mouseover event bubbling (by @yohanboniface) #3648 #3797 #3708flyTo animations when the map center doesn't change (by @fminuti) #3663baselayerchange event (by @yohanboniface) #3677L.Util.requestAnimFrame definition (by @fminuti) #3703L.Circle.getBounds() (by @knabar) #3776Rectangle.setBounds() return value (by @IvanSanchez) https://github.com/Leaflet/Leaflet/commit/e698f641afadd4a0b412a6c9e065a6dbfbe16f44maxZoom is set (by @patrickarlt) #3721noWrap option in L.GridLayer (by @IvanSanchez) #3691Nothing published for this version
Fixed a regression that could sometimes cause tiles to disappear when pinch-zooming on iOS devices.
Note that we skipped 0.7.6 version for which we accidentally published a broken build to NPM.
Fixed a regression that broke animation in Leaflet.markercluster. #3796
Fixed a bug introduced by a recent Chrome update that caused the map not to react to interactions until all tiles are loaded. #3689
minZoom or maxZoom options (by @ivansanchez) #3778maxNativeZoom were not checking bounds properly (by @jlaxon) #3415bindPopup(popup) (by @Eschon) #3675Map.fitBounds padding (by @bsstoner). #2489dblclick and contextmenu events (by @ivansanchez) #3482fillRule option (by @w8r) #3477lineCap and lineJoin options (by @northerneyes) #3156Added proper bower and component support (by @calvinmetcalf). #2561 #1903
setView (or similar methods) several times in succession could freeze the map. #2521 #2236 #2485Control.Layers wasn't properly removed (by @jack-kerouac). #2569TileLayer load event not to fire properly. #2510remove event when removed (by @adimitrov). #2486Fixed a bug that appeared with Chrome 32 update that made all mouse events shifted on scrolled pages. #2352
maxNativeZoom option didn't work with TMS tile layers (by @perliedman). #2321 #2314Fixed a bug where pinch-zooming quickly could occasionally leave the map at a fractional zoom thus breaking tile loading (by @danzel). #2269 #2255 #19
L.Util.template optimizations to allow Leaflet to be used in eval-banning environments like browser extensions (performance gain was insignificant anyway) (by @calvinmetcalf). #2217 #2209 #1968Map invalidateSize could lead to unexpected results when called before map initialization (by @Zverik). #2250 #2249FeatureGroup containing other group overwrote original e.layer value in mouse events (by @gumballhead). #2253 #2252CircleMarker setLatLngs didn't return this (by @radicalbiscuit). #2206Added support for IE11 touch devices (by @danzel, @DanielX2 and @fnicollet). #2039 #2066 #2037 #2102
maxBounds behavior: now it doesn't force higher minimal zoom, and anchors to max bounds edges properly when zooming (by @kapouer and @mourner). #2187 #1946 #2081 #2168 #1908Map setView zoom argument optional. #2056maxZoom option to Map fitBounds. #2101Map bounceAtZoomLimits option that makes the map bounce when you pinch-zoom past limits (it worked like this before, but now you can disable this) (by @trevorpowell). #1864 #2072distance property to Map and Marker dragend events. #2158 #872timestamp to Map locationfound event. #584Map invalidateSize to call moveend immediately unless given debounceMoveend: true option (by @jfirebaugh). #2181TileLayer maxNativeZoom option that allows displaying tile layers on zoom levels above their maximum by upscaling tiles. #1802 #1798TileLayer tileloadstart event (by @tmcw). #2142 #2140TileLayer world size (used for wrapping and limiting tiles) to be derived from CRS instead of hardcoded, making it easier to use with custom projections (by @perliedman). #2160Marker add event (by @tohaocean). #1942Marker getPopup method (by @scottharvey). #618 #1197Marker alt option for adding alt text to markers (by @jimmytidey). #2112Path className option for adding custom class names to vector layers.Path lineCap and lineJoin options (by @palewire). #1843 #1863 #1881GeoJSON (by @kapouer). #2075Polygon setLatLngs to also accept holes (by @aparshin). #2095 #1518GeoJSON 3D format support and optional altitude argument to LatLng constructor (by @Starefossen). #1822MultiPolygon and MultiPolyline openPopup method. #2046Popup update method. #1959Popup autoPanPaddingTopLeft and autoPanPaddingBottomRight options (by @albburtsev). #1972 #1588Popup getContent method. #2100Popup getLatLng method (by @AndreyGeonya). #2097ImageOverlay setUrl and getAttribution methods and attribution option (by @stsydow). #1957 #1958L.Util.template performance (affects L.TileLayer) by introducing cached template compilation (by @calvinmetcalf). #1969 #1968 #1554CRS getSize for getting the world size in pixels (by @perliedman). #2160leaflet-drag-target CSS class to an element under cursor when dragging for more flexible customization. #2164 #1902L.DomUtil addClass, removeClass, hasClass methods performance and fixed it to work with SVG elements. #2164leaflet.css and removed leaflet.ie.css, so no need for IE conditional comment when including Leaflet now. #2159leaflet-oldie CSS class to map container in IE7-8 for easier styling. #2159jake command to run tests before building the source. #2151package.json to unminified version for NPM/Browserify (by @icetan). #2109worldCopyJump: true option (by @fastrde). #1904 #1831 #1982L.DomUtil.getMousePosition would throw an error if container argument not provided (by @scooterw). #1826 #1928 #1926maxBounds behaving weirdly on panning inertia out of bounds. #2168EPSG:3395 projection were shifted (by @aparshin). #2020box-sizing: border-box.maxBounds (by @kapouer and @mourner). #2187 #1946 #2081 #2168 #1908+ no longer zoomed the map on FF 22+ (by @fastrde). #1943 #1981Map remove throwed an error in IE6-8. #2015isArray didn't work in rare cases in IE9. #2077Map getCenter returned old result after map container size changed (by @jfirebaugh). #1940 #1919Map invalidateSize rounding issues when changing map size by an odd pixel amount (by @russelldavis). #1931Map removeLayer didn't return this in a corner case (by @jfirebaugh).Map setZoom before setView would throw an error. #1449Popup setLatLng unnecessarily reset content and updated layout; works much faster now. #2167toGeoJSON of layers originated from GeoJSON GeometryCollection and MultiPoint didn't work properly (wasn't round-tripped). #1956GeoJSON dependencies in build configuration that could lead to a broken custom build in some situations (by @alubchuk). #1909CircleMarker popup placement wasn't updated after calling setLatLng (by @snkashis). #1921 #1927Marker setIcon (by @snkashis). #1874 #1891FeatureGroup would break when using non-evented children layers (by @tmcw). #2032 #1962CircleMarker getRadius would always return null. #2016 #2017TileLayer.WMS didn't work with WMS 1.3 & EPSG4326 projection (by @Bobboya). #1897FeatureGroup events e.layer was sometimes empty in old IE. #1938L.latLngBounds didn't accept simple object LatLng form (by @Gnurfos). #2025 #1915L.Util.tempalate wouldn't work with double quotes in the string (by @jieter). #1968 #2121 #2120Fixed a regression where fitBounds and setMaxBounds could freeze the browser in some situations. #1895 1866
Fixed a regression where mouse interaction had incorrect coordinates in some map positioning cases (by @scooterw). #1826 #1684 #1745 #1
ImageOverlay (by @jfirebaugh). #1821layerremove and layeradd were fired before the corresponding action finishes (by @jfirebaugh). #1846worldCopyJump: true breaking the map on small zoom levels (by @danzel). #1831Marker shadow didn't animate on zoom after using setIcon. #1768GeoJSON ignored non-feature geometries passed in an array. #1840Map minZoom and maxZoom didn't always override values derived from the added tile layers. 1848TileLayer.Canvas wasn't immediately redrawn when redraw is called (by @tofferrosen). #1797 #1817FeatureGroup still fired layerremove event on removeLayer even if the given layer wan't present in the group (by (by @danzel)). #1847 #1858Marker setOpacity wasn't returning the marker (by @freepius44). #1851leaflet-bar elements.setMaxBounds (by @davidjb). #1834MultiPolyline and MultiPolygon getLatLngs method. #1839dist folder) were removed from the repo and are now done automatically on each commit for master and stable branches by Travis CI. The download links are on the Leaflet download page.Fixed a bug that caused wrong tile layers stacking order when using opacity < 1 (by @jfirebaugh). #1804 #1790 #1667
Fixed a regression with mouse wheel zooming too fast on Firefox (by @jfirebaugh). #1788
One column per quarter.