π JavaScript library for mobile-friendly interactive maps πΊπ¦
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)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)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)Events
listens
not propagating to parent objects, in particular fixing compatibility with Leaflet.markercluster plugin (#8211 by @Falke-Design)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 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)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)
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)
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 LayerGroup
s (by @ivansanchez)LatLngBounds.overlaps()
#7194 by @DerZade)