(all changes without author notice are by @mourner)
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)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)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)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)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)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)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)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)L.Marker docs sections (#6871 by chloe-mc)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)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)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)module field from package.json (#6239)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)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)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)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)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).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), #5131.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).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) #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) #4788L.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) #4460L.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 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) #3691The first beta of the huge, long-awaited Leaflet 1.0 release.
This version contains a lot of beneficial but potentially breaking changes (especially if youâre a plugin author), so please read through the changes carefully if your code breaks after upgrading.
Leaflet vector layers rendering got a major rewrite, making it possible to switch between rendering backends (Canvas, SVG) dynamically (and even use both for different layers at the same time), have more than one physical pane for vector layers, significantly improving performance, adding Canvas retina support, getting rid of ugly hacks and generally making the code much cleaner. Main PR #2290.
Renderer layer (inherited by SVG/Canvas implementations) that handles renderer bounds and zoom animation.SVG & Canvas classes that now contain all renderer-specific code for vector layers and can be added as layers to the map.Path, Polyline, etc.) now donât contain any renderer-specific code and instead can be passed a renderer layer to use as renderer in options;MultiPolyline and MultiPolygon classes since multiple rings are now handled by Polyline and Polygon classes respectively. Layers with multiple rings now perform much better (since each is now physically a single path object instead of being a FeatureGroup of layers).Polyline and Polygon getCenter for getting centroids.Polyline and Polygon popup positioning when calling openPopup.Polyline/Polygon getBounds to be cached (so it works much faster).Circle to inherit from CircleMarker and not the other way.GeoJSON resetStyle to work properly in case style option wasnât set.moveend when updating Canvas layers.Polyline and Polygon spliceLatLngs method (just use setLatLngs instead).Polygon getLatLngs to always return an array of rings (nested array) (by @yohanboniface). #2618 #3386 Leaflet/Leaflet#3279 #2648fillRule option (by @bullgare). #2834L_PREFER_CANVAS global switch and added Map preferCanvas option instead (by @yohanboniface). #3623All Leaflet layers (including markers, popups, tile and vector layers) have been refactored to have a common parent, Layer class, that shares the basic logic of adding and removing. The leads to the following changes (main PR #2266):
Layer class which all layers added to a map should inherit from.add and remove events to all layers.remove method to layers and controls (marker.remove() is now equivalent to map.removeLayer(marker)).pane option to all layers that can be changed (e.g. you can set pane: 'overlayPane' to a tile layer).map createPane method for custom panes. #1742objectsPane, all panes are on the same level now.shadowPane option to markers as well.getEvents method to all layers that returns an {event: listener, ...} hash; layers now manage its listeners automatically without having to do this in onAdd/onRemove.togglePopup, setPopupContent, getPopup, isPopupOpen methods to all layers. #2279 #2292FeatureGroup getBounds to work correctly when containing circle markers.Map tilelayersload event.Popup open and close events in favor of add and remove for consistency.Map.js to Layer.js.FeatureGroup bindPopup to accept a function for generating popup content, significantly improving memory footprint when adding popups to a huge number of layers (by @patrickarlt). #3109 #3059ImageOverlay interactivity (mouse events, etc.) (by @snkashis). #3009 #1727ImageOverlay getBounds (by @brunob). #2848clickable option to interactive (by @AndriiHeonia). #2838 #2499nonBubblingEvents option to layers (by @yohanboniface). #3605 #3307 #3604In addition, layer events implementation was rewritten to use event delegation, significantly improving add/remove performance and memory footprint. #3032 #46
TileLayer code and everything projections-related has undergone a major refactoring, documented in PR #2247. It includes the following changes (in addition to much cleaner and simpler code):
These changes make implementing custom grid-like layers for Leaflet much easier.
TileLayer logic into the new GridLayer class (which TileLayer now inherits, extending it with logic specific to tile servers).TileLayer.Canvas in favor of the much more flexible and powerful GridLayer.TileLayer to work transparently and completely depent on the CRS used; removed the need for TileLayer hacks when using custom projections.url property in tileload and tileloadstart events (get it through tile.src).These changes were targeted at removing any hardcoded projection-specific logic accross Leaflet classes, making it transparent and driven by the chosen CRS. They make using Leaflet with custom projections (including flat maps) much easier, and remove the need for ugly hacks in the Proj4Leaflet plugin.
CRS.Earth which serves as a base for all Earth-based CRS (EPSG3857 etc.). #2345Projection bounds property that defines bounds for different projections (Mercator, etc.) in projected coordinates (by @perliedman).CRS wrapLat and wrapLng properties which define whether the world wraps on a given axis and in what range. Set as [-180, 180] for EPSG:3857, EPSG:4326, EPSG:3395 by default.CRS and Map wrapLatLng (the latter depends on the chosen CRS).CRS infinite property that disables boundaries (the world can go on infinitely in any direction), default for CRS.Simple.CRS getProjectedBounds and Map getPixelWorldBounds methods that returns world bounds in projected coordinates depending on zoom (derived from Projection bounds) (by @perliedman).CRS unproject method that converts coordinates in CRS-dependent units into LatLng coordinates (by @sowelie).Map distance(latlng1, latlng2) method that takes CRS into account and works with flat projections. #2345 #1442Circle to be approximated with an ellipse in Earth-based projections. #2345EPSG:4326 to have correct tile pyramid (2x1 tiles at root).Projection.SphericalMercator to project to meter units (by @calvinmetcalf).Map worldCopyJump option to work for other projections.Circle to work with flat projections. #2345 #1465ImageOverlay not working properly in some non-standard projections. #3011Animation code in Leaflet had undergone a major rewrite (main PR: #2382), bringing improvements such as:
map.flyTo) for zooming to a particular place in a curve (simultaneously zooming and panning)map.setZoom(12.45) and it just works.zoom event in addition to viewreset for frame-by-frame zoom animations. #3278LatLng creation performance (8x).FeatureGroup (and correspondingly GeoJSON) layer adding and events performance (about 10x) by implementing a much better event propagation mechanism. #2311Evented off performance by about 2 times.DomUtil off to require context attribute if you remove a listener that was previously added with a particular context.DomUtil.getViewportOffset method as it is no longer necessary.DomUtil getTranslateString and getScaleString methods.DomUtil documentIsLtr method.LatLng RAD_TO_DEG, DEG_TO_RAD and MAX_MARGIN constants.Util.limitExecByInterval to Util.throttle.Evented class that now many Leaflet classes inherit from (instead of mixing in events methods in each class), while keeping the old includes: L.Mixin.Events syntax available. #2310Class options to be prototypically inherited instead of copied over in children classes, which leads to more efficient memory use, faster object construction times and ability to change parent options that get propagated to all children automatically (by @jfirebaugh). #2300 #2294{r} variable to TileLayer url for adding "@2x" prefix on Retina-enabled devices (by @urbaniak). #2296Point ceil method (by @perliedman).Util.wrapNum method for wrapping a number to lie in a certain range.L.bind to use native Function bind on modern browsers and prepend real arguments to bound ones.LatLng equals second argument maxMargin.DomUtil setClass and getClass methods.Marker move event to include oldLatlng (by @danzel). #2412Marker mousemove event (by @bullgare). #2798DomEvent on/off to accept space-separated events and object literals ({type: fn}).DomUtil toFront and toBack methods.Evented listens as a shortcut to hasEventListeners.L.map option touchZoom (by @mtmail). #2527getElement method to all layers that returns an associated DOM element.LatLng clone method (by @yohanboniface). #3390Map setMinZoom and setMaxZoom methods (by @nathancahill). #3383 #3380originalEvent to Map and Marker drag and move event data (by @yohanboniface). #3264Popup autoClose option (by @jfirebaugh). #3018 #2716 #1853Control.Zoom enable and disable methods. #3172L.PolyUtil.clipPolygon that controls rounding (by @aparshin). #2926 #2917Map wheelDebounceTime option (by @AndriiHeonia). #2836 #2501TileLayer.WMS uppercase option (now false by default) (by @kdeloach). #2831 #1751ImageOverlay alt option (by @francis-liberty). #2767 #2564L.Util.extend performance (by @fab1an). #2746Map stop method for stopping panning or flyTo animation.Map maxBoundsViscosity option that controls how much the map resits dragging out of max bounds (set to 1 for a hard limit) (by @IvanSanchez). #2224 #3510 #1673Bounds and LatLngBounds overlaps method (by @IvanSanchez). #2981 #3508ImageOverlay crossOrigin option (by @patrickarlt). #3594 #2621DomUtil on to make it possible to add the same listener to the same element for multiple contexts.ImageOverlay mercator distortion on lower zoom levels.popupopen and popupclose events when manually creating a popup object and passing it to bindPopup. #2354Map panInsideBounds to accept array-form bounds (by @RLRR). #3489LatLng wrap to not drop altitude (by @IvanSanchez). #3420setMaxBounds several times in a row (by @IvanSanchez). #3410 #3320Map locate bug that could cause some unexpected effects (by @sindre). Leaflet/Leaflet#3404Polygon getCenter when all points </area> in the same pixel (by @yohanboniface). #3372Polyline getCenter when the line is very small (by @yohanboniface). #3371azerty keyboards. #3362Map panBy not always returning this (by @Trufi). #3303Polygon toGeoJSON exporting a MultiPolygon in some cases (by @yohanboniface). #2977TileLayer.WMS passing all options as WMS params. #2972map.fitBounds(map.getBounds()) zoom out sometimes. #2957setIcon (by @jeffsmale90). #2578TileLayer when maxNativeZoom = 0. #3004FeatureGroup setStyle not affecting ImageOverlay opacity (by @opie). #3008 #2246Map worldCopyJump option is enabled (by @flemenach). #3038 #2624getMaxZoom sometimes returned wrong result inside a Control.Layers baselayerchange event (by @CloudNiner). #3048 #2318Map getSize race condition where it could return a wrong result (by @kshepard). #3052 #3031L.latLng factory to accept altitude as a third argument too (by @lonelyelk). #3070.L.latLng factory to not throw error on empty array input (by @lonelyelk). #3080 #3079Map locate not to mutate the given options object (by @tmcw). #3173Marker setIcon to not reset popup anchor offset (by @bullgare). #2872zoom in Map options and then set center (by @AndriiHeonia). #2849 #1871TileLayer setUrl where loading event didnât fire properly (by @bennlich). #2802 #2675 #2827Marker setIcon (by @jfgodoy). #2811LatLng distanceTo to not return NaN on equal locations. #2705TileLayer maxNativeZoom didnât work properly with bounds option set (by @mlegenhausen). #2725 #2704map.remove() (by @IvanSanchez). #3514 #2718jake build) to report gzipped library size.src/images/logo.svg.package.json (by @bclinkinbeard). #2432Note tha we skipped 0.7.6 version for which we accidentally published a broken build to NPM.
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) #3156setView (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). #2486maxNativeZoom option didnât work with TMS tile layers (by @perliedman). #2321 #2314L.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). #2206maxBounds 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 #2120fitBounds and setMaxBounds could freeze the browser in some situations. #1895 1866ImageOverlay (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.Object.prototype (luckily itâs a thing of the past nowadays).Map invalidateSize no longer fires move and moveend events if the map size didnât change. #1819Control.Layers icon (designed by Volker Kinkelin), added retina version and SVG source. #1739TileLayer zoom animation to eliminate flickering in case one tile layer on top of another or when zooming several times quickly (by @mourner with lots of fixes from @danzel). #1140 #1437 #52map.attributionControl.setPrefix('') if you need.Marker popups to close on marker click if opened (by @popox). #1761toGeoJSON method to various layer types, allowing you to save your Leaflet layers as GeoJSON. (by @jfirebaugh). #1462 #712 #1779GeoJSON coordsToLatLng option for dealing with GeoJSON that has non-WGS84 coords (thanks to @moonlite). #888 #886Marker to reuse icon DOM elements when changing icons on the fly (e.g. fixes problems when changing icon on mouse hover) (by @robpvn & @danzel). #1726 #561 #1753 #1754latlng property to Marker mouse event data. #1613LayerGroup hasLayer method (by @rvlasveld). #1282 #1300LayerGroup getLayers method (by @tmcw). #1469LayerGroup getLayer method (by @gumballhead). #1650LayerGroup removeLayer method to also accept layer id (by @gumballhead). #1642Path pointerEvents option for setting pointer-events on SVG-powered vector layers (by @inpursuit). #1053Polygon to filter out last point if itâs equal to the first one (to fix GeoJSON polygon issues) (by @snkashis). #1153 #1135clickable: false to allow mouse events to pass through to objects underneath (by @snkashis). #1384 #1281L.Util.template (and correspondingly url-related TileLayer options) to support functions for data values (by @olegsmith). #1554TileLayer getContainer method (by @tmcw). #1433TileLayer.Canvas redraw method chaining (by @jieter). #1287TileLayer.WMS crs option to be able to use WMS of CRS other than the map CRS (by @kengu). #942 #945popupopen and popupclose events to various layers (by @Koc). #738Popup keepInView option (thanks to @lapo-luchini) that prevents the popup from going off-screen while itâs opened. #1308 #1052Marker togglePopup method (by @popox). #1761Popup closeOnClick option that overrides the same Map option for specific popups (by @jfirebaugh). #1669Marker and Path bindPopup method to also accept Popup objects (by @snkashis). #1385 #1208 #1402Marker setPopupContent method (by @snkashis). #1373Map (setView, panTo, setZoom, fitBounds, etc.) to accept an options object, including the ability to precisely control zoom/pan animations they cause (force disable/enable, etc.). #1617 #1616 #340 #483 #1164 #1420Map fitBounds method to accept padding (or paddingTopLeft and paddingBottomRight) options, allowing you to zoom to an area with a certain padding in pixels (usually left for controls). #859Map invalidateSize to accept options object (animate and pan, the latter controls if it pans the map on size change). (by @jacobtoye and @mourner). #1766 #1767Map setZoomAround method for zooming while keeping a certain point fixed (used by scroll and double-click zooming). #1157Map remove method to properly destroy the map and clean up all events, and added corresponding unload event (by @jfirebaugh and @mourner). #1434 #1101 #1621Map tap handler that now contains all mobile hacks for enabling quick taps and long holds and tapTolerance option specifying the number of pixels you can shift your finger for click to still fire.Map zoomAnimationThreshold for setting the max zoom difference with which zoom animation can occur. #1377Map openPopup method to also accept (content, latlng) signature as a shortcut.Map closePopup method to optionally accept a popup object to close. #1641Map stopLocate method to abort resetting map view if calling locate with setView option. #747Map to throw exception if the specified container id is not found (by @tmcw). #1574Map locationfound event to pass all location data (heading, speed, etc.). #984 #584 #987 #1028Map resize event. #1564Map zoomlevelschange event that triggers when the current zoom range (min/max) changes (by @moonlite). #1376Map baselayerchange, overlayadd and overlayremove events fired by Control.Layers (by @calvinmetcalf and @Xelio). #1286 #1634Control getContainer method. #1409cleanAllEventListeners method (aliased to off without arguments) to all events-enabled objects (by @iirvine). #1599addOneTimeEventListener method (aliased to once) to all events-enabled objects (by @iirvine). #473 #1596{lat: 50, lon: 30} or {lat: 50, lng: 30}). #1412LatLngBounds getNorth, getEast, getSouth, getWest methods (by @yohanboniface). #1318AMD support (Leaflet now registers itself as a leaflet AMD module) (with fixes from @sheppard). #1364 #1778L.Util.trim function (by @kristerkari). #1607Map maxBounds. #1491 #1475 #1194 #900 #1333contextmenu events on popups falling through to map (by @snkashis). #1730 #1732404 tile loading errors when browsing the map off the world bounds.TileLayer opacity didnât work in IE 7-8 (by @javisantana & @danzel). #1084 #1396 #1371L.point and L.latLng factories werenât passing null and undefined values through.DomEvent removeListener function chaining (by @pagameba).removeEventListener would throw an error if no events are registered on the object (by @tjoekbezoer). #1632 #1631Point equals and contains methods didnât accept points in array form.LatLngBounds extend of an undefined object would cause an error (by @korzhyk). #1688Control.Attribution removeAttribution of inexistant attribution corrupted the attribution text. #1410setView on an invisible map caused an error (by @jfire). #1707TileLayer.WMS param values werenât escaped in URLs (by @yohanboniface). #1317TileLayer.WMS tileSize option was ignored (by @brianhatchl). #1080Polyline constructor could overwrite the source array (by @snkashis and @danzel). #1439 #1092 #1246 #1426TileLayer to prevent incorrect subdomain in case of negative tile coordinates (by @malexeev). #1532DivIcon html option to accept 0 as a value (by @stuporglue). #1633mousemove in certain conditions. #1615TileLayer bounds (by @ansis). #1618TileLayer load event wouldnât always fire correctly. #1565TileLayer.WMS compatibility with some old servers that only accepted request parameters in uppercase. #1751L.Icon.Default.imagePath detection in some cases. #1657onRemove was still called even if it was never added (by @jfirebaugh). #1729setRadius on a Canvas-powered CircleMarker would cause an infinite loop (by @snkashis). #1712 #1713 #1728marker-icon@2x.png to marker-icon-2x.png to fix compatibility with Google AppEngine. #1552 #1553popupclose and popupopen events werenât fired for multipolygons and multipolylines (by @tmcw). #1681Map fitBounds wouldnât work correctly with large bounds (thanks to @MaZderMind). #1069Map hasLayer wasnât handling null objects (by @rvlasveld). #1282 #1302Map moveend fired before dragend on drag (by @oslek). #1374Map movestart event on inertia start (by @oslek). #1374Map moveend fired repeatedly on window resize even if the actual map size didnât change (by @oslek). #1374Map moveend sometimes wasnât fired after drag (particularly often when dragging with a trackpad).Map load event listener. #962Map autopanstart event back (it was removed occasionally in previous version). #1375Map maxBounds (by @jec006). #1749 #1750GeoJSON not accepting arrays of FeatureCollection (by @snkashis). #1299 #1298CirleMarker setRadius not working if called before adding the layer to the map (by @danzel). #1342 #1297Be sure to read through these changes to avoid any issues when upgrading from older versions:
LatLng wrapping/clamping of coordinates (-180, -90 to 180, 90), wrapping moved to an explicit method (LatLng wrap).Map worldCopyJump option by default (jumping back to the original world copy when panning out of it). Enable it explicitly if you need it.Icon iconRetinaUrl and shadowRetinaUrl options) (by @danzel). #1048 #1174L.Transition with a much better and simpler L.PosAnimation.Class addInitHook method for adding constructor hooks to any classes (great extension point for plugin authors). #1123Map whenReady method (by @jfirebaugh). #1063delta argument to Map zoomIn and zoomOut (1 by default).isValid method to LatLngBounds and Bounds (by @domoritz). #972Point equals method.Bounds getSize method.Path unbindPopup and closePopup methods.Path add and remove event.Marker riseOnHover and riseOffset options (for bringing markers to front on hover, disabled by default) (by jacobtoye). #914 #920Marker move and remove events.Marker contextmenu event. #223Popup zoomAnimation option (useful to disable when displaying flash content inside popups #999).FeatureGroup layeradd and layerremove events (by @jacobtoye). #1122Control.Layers baselayerchange event (by @jfirebaugh). #1064Control.Layers to support HTML in layer names (by @aparshin). #1055 #1099CRS.Simple to the list of built-in CRS and improved it to be more usable out of the box (it has different default scaling and transformation now), see debug/map/simple-proj.html for an example.Browser ua, gecko, opera properties (no longer needed).L.extend, L.bind, L.stamp, L.setOptions shortcuts for corresponding L.Util methods.L.Util.isArray function (by @oslek). #1279mouseover and mouseout events to canvas-based vector layers (by @snkashis). #1403Map eachLayer to iterate over all layers added to the map (by @jfirebaugh). #1457TileLayer bounds option to limit tile loading to a specific region (by @adimitrov). #991panBy wouldnât round the offset values (so it was possible to make the map blurry with it). #1085TileLayer bringToBack didnât work properly in some cases (by @danzel). #963 #959Map load event happened too late (after moveend, etc.) (by @jfirebaugh). #1027Circle getBounds to return correct bounds and work without adding the circle to a map. #1068Popup on viewreset throwed an error (by fnicollet and @danzel). #1098 #1094TileLayer.Canvas drawTile didnât receive tile zoom level in arguments.GeoJSON resetStyle would not fully reset a layer to its default style. #1112latLngBounds factory with coordinates as string values. #933Marker setIcon, setZIndexOffset, update methods. #1176FeatureGroup bindPopup didnât take options into account.CircleMarker setStyle didnât take radius into account (by @fdlk). #1012 #1013layer event property on click (by @snkashis). #1215 #1243TileLayer.WMS didnât work correctly if the base URL contained query parameters (by @snkashis). #973 #1231GeoJSON features with GeometryCollection didnât pass properties to pointToLayer function (by @calvinmetcalf). #1097FeatureGroup eachLayer chaining. #1452TileLayer bringToFront/Back() throwed an error in IE6-8. #1168- key not working in Firefox 15+ (thanks to @mattesCZ). #869GeoJSON setStyle to also accept function (like the corresponding option).GeoJSON resetStyle(layer), useful for resetting hover state.feature property to layers created with GeoJSON (containing the GeoJSON feature data).FeatureGroup bringToFront and bringToBack methods (so that they would work for multipolys).animate argument to Map invalidateSize (by @ajbeaven). #857Path bringToFront and bringToBack didnât return this.FeatureGroup removeLayer would unbind popups of removed layers even if the popups were not put by the group (affected Leaflet.markercluster plugin) (by @danzel). #861TileLayer detectRetina option (by @sxua). #854Leaflet 0.4 contains several API improvements that allow simpler, jQuery-like syntax (example) while being backwards compatible with the previous approach (so you can use both styles):
LatLng, LatLngBounds, Point and Bounds values in an array form (e.g. map.panTo([lat, lng]) will be the same as map.panTo(new L.LatLng(lat, lng)))addTo method to all layer classes, e.g. marker.addTo(map) is equivalent to map.addLayer(marker)new keyword, named the same as classes but starting with a lowercase letter, e.g. L.map('map') is the same as new L.Map('map')TileLayer detectRetina option (false by default) that makes tiles show in a higher resolution on iOS retina displays (by @Mithgol). #586GeoJSON API was improved to be simpler and more flexible (example). The changes are not backwards-compatible, so be sure to update your old code.
style option for styling vector layers, passed either as an object or as a function (to style vector layers according to GeoJSON properties).filter option to leave out features that donât correspond to a certain criteria (e.g. based on properties).onEachFeature option to execute certain code on each feature layer based on its properties (binding popups, etc).pointToLayer function signature to provide geojson in addition to latlng when creating point features for more flexibility.Icon API was improved to be more flexible, but one of the changes is backwards-incompatible: you now need to pass different icon properties (like iconUrl) inside an options object (example).
Icon properties to options, changed constructor signature to Icon(options).L.Icon.Default class (which extends from L.Icon).Icon className option to assign a custom class to an icon.Icon shadowAnchor option to set the anchor of the shadow.Icon options except iconUrl optional (if not specified, theyâll be chosen automatically or implemented using CSS). Anchor is centered by default (if size is specified), and otherwise can be set through CSS using negative margins.setPosition and getPosition to all controls, as well as ability to pass certain position as an option when creating a control.L.Control.Position.TOP_LEFT) with light strings ('topleft', 'bottomright', etc.)TileLayer constructor to interpolate URL template values from options (removed third urlParams argument).TileLayer scheme: 'tms' option to tms: true.Map locateAndSetView method (use locate with setView: true option)minWidth and maxWidth options to be applied to content element, not the whole popup.prefix argument to options in Control.Attribution constructor.L.VERSION to L.version.on and off methods to also accept (eventHash[, context]), as well as multiple space-separated events (by @Guiswa). #770off to remove all listeners of the event if no function was specified (by @Guiswa). #770 #691TileLayer setZIndex method for controlling the order of tile layers (thanks to @mattcurrie). #837Control.Layers autoZIndex option (on by default) to preserve the order of tile layers when switching.TileLayer redraw method for re-requesting tiles (by @greeninfo). #719TileLayer setUrl method for dynamically changing the tile URL template.bringToFront and bringToBack methods to TileLayer, ImageOverlay and vector layers. #185 #505TileLayer loading event that fires when its tiles start to load (thanks to @lapinos03). #177TileLayer.WMS setParams method for setting WMS parameters at runtime (by @greeninfo). #719TileLayer.WMS subdomain support ({s} in the url) (by @greeninfo). #735originalEvent property to MouseEvent (by @k4). #521containerPoint property to MouseEvent. #413contextmenu event to vector layers (by @ErrorProne). #500LayerGroup eachLayer method for iterating over its members.FeatureGroup mousemove and contextmenu events (by @jacobtoye). #816DomEvent methods.on and off aliases for DomEvent addListener and removeListener methods.L_NO_TOUCH global variable switch (set it before Leaflet inclusion) which disables touch detection, helpful for desktop apps built using QT. #572dashArray option to vector layers for making dashed strokes (by jacobtoye). #821 #165Circle getBounds method. #440Circle getLatLng and getRadius methods (by @Guiswa). #655openPopup method to all vector layers. #246redraw method to vector layers (useful if you manipulate their LatLng points directly).Marker opacity option and setOpacity method.Marker update method. #392Marker openPopup not to raise an error if it doesnât have a popup. #507ImageOverlay opacity option and setOpacity method. #438Popup maxHeight option that makes content inside the popup scrolled if it doesnât fit the specified max height.Popup openOn(map) method (similar to Map openPopup).Map getContainer method (by @Guiswa). #654Map containerPointToLatLng and latLngToContainerPoint methods. #474Map addHandler method.Map mouseup and autopanstart events.LatLngBounds pad method that returns bounds extended by a percentage (by @jacobtoye). #492position: fixed container (by @chx007). #602mousedown listener. #834TileLayer setOpacity wouldnât work when setting it back to 1.setStyle({stroke: false}) wouldnât remove stroke and the same for fill. #441Marker bindPopup method wouldnât take offset option into account.TileLayer load event wasnât fired if some tile didnât load (by @lapinos03 and @cfis) #682GeoJSON layer. #685GeoJSON clearLayer (by @runderwood). #617Control setPosition wasnât always working correctly (by @ericmmartinez). #657Util.bind sometimes losing arguments (by @johtso). #588drag event was sometimes fired after dragend. #555TileLayer load event was firing only once (by @lapinos03 and shintonik). #742 #177FeatureGroup popup events where not cleaned up after removing a layer from it (by @danzel). #775DomUtil.removeClass didnât remove trailing spaces (by @jieter). #784moveend listener.LayerGroup addLayer wouldnât check if a layer has already been added (by @danzel). 798Control.Layers didnât work on IE7. #652mousemove events on click in Chrome (by @stsydow). #757setStyle would break the map. #641ImageOverlay wouldnât stretch properly on zoom on Android 2. #651clearLayers for vector layers on a Canvas backend (e.g. on Android 2) would take unreasonable amount of time. #785setLatLngs and similar methods on vector layers on a Canvas backend would not update the layers immediately. #732Control.Layers) for convenient layer switching.map.addLayer(layer, true)) (useful for switching base tile layers).Map zoomstart event (thanks to @Fabiz). #377Map locate method, added ability to watch location continuously and more options. #212inside to Map getBoundsZoom method that allows you to get appropriate zoom for the view to fit inside the given bounds.hasLayer method to Map.Marker zIndexOffset option to be able to set certain markers below/above others. #65urlParams third optional argument to TileLayer constructor for convenience: an object with properties that will be evaluated in the URL template.TileLayer continuousWorld option to disable tile coordinates checking/wrapping.TileLayer tileunload event fired when tile gets removed after panning (by @CodeJosch). #256TileLayer zoomOffset option useful for non-256px tiles (by @msaspence).TileLayer zoomReverse option to reverse zoom numbering (by @Majiir). #406TileLayer.Canvas redraw method (by @mortenbekditlevsen). #459Polyline closestLayerPoint method thatâs can be useful for interaction features (by @anru). #186setLatLngs method to MultiPolyline and MultiPolygon (by @anru). #194getBounds method to Polyline and Polygon (by @JasonSanford). #253getBounds method to FeatureGroup (by @JasonSanford). #557FeatureGroup setStyle method (also inherited by MultiPolyline and MultiPolygon). #353FeatureGroup invoke method to call a particular method on all layers of the group with the given arguments.ImageOverlay load event. #213minWidth option to Popup (by @marphi). #214LatLng constructor to be more tolerant (and throw descriptive error if latitude or longitude canât be interpreted as a number). #136LatLng distanceTo method (great circle distance) (by @mortenbekditlevsen). #462LatLngBounds toBBoxString method for convenience (by @JasonSanford). #263LatLngBounds intersects(otherBounds) method (thanks to @pagameba). #350LatLngBounds extend method to accept other LatLngBounds in addition to LatLng (by @JasonSanford). #553Bounds intersects(otherBounds) method. #461L.Util.template method for simple string template evaluation.DomUtil.removeClass method (by @anru).Klass.superclass instead of this.superclass (by @anru). #179Map boxzoomstart and boxzoomend events (by @zedd45). #554Popup contentupdate event (by @mehmeta). #548shiftDragZoom map option/property renamed to boxZoom.mouseEventToLatLng method (bringed back in 0.4).Circle was rendered with incorrect radius (didnât take projection exagerration into account). #331Map getBounds would work incorrectly on a date line cross. #295GeoJSON pointToLayer option wouldnât work in a GeometryCollection. #391Circle was rendered with incorrect radius (didnât take projection exaggeration into account). #331Marker setIcon was not working properly (by @marphi). #218 #311Marker setLatLng was not working if itâs set before adding the marker to a map. #222Marker setLatLng (by @tjarratt). #272closePopup option (by @jgerigmeyer).Bounds contains method (by @anru). #180Polygon with new L.Polygon() would raise an error.movestart event would fire after zoom animation.setPrefix. #195TileLayer load event wouldnât fire in some edge cases (by @dravnic).movestart didnât fire on panning animation.EPSG:3395 CRS (by @Savvkin). #358setView or panTo to the current center. #231TileLayer.Canvas.TileLayer.WMS layer).EPSG:3857, EPSG:4326 and EPSG:3395 out of the box (through crs option in Map). Thanks to @Miroff & @Komzpa for great advice and explanation regarding this.requestAnimationFrame. #130Circle to be zoom-dependent (with radius in meters); circle of a permanent size is now called CircleMarker.mouseover and mouseout events to map, markers and paths; added map mousemove event.setLatLngs, spliceLatLngs, addLatLng, getLatLngs methods to polylines and polygons.setLatLng and setRadius methods to Circle and CircleMarker.LatLngBounds contains method to accept LatLng in addition to LatLngBounds, the same for Bounds contains and PointLatLngBounds & Bounds to allow their instantiation without arguments (by @snc).TileLayer scheme: 'tms' option (by @tmcw).TileLayer noWrap option to disable wrapping x tile coordinate (by @jasondavies).opacity option and setOpacity method to TileLayer.setLatLng and setIcon methods to Marker.title option to Marker.maxZoom argument to map.locateAndSetView method.locate and locateAndSetView methods (by @JasonSanford).Popup to accept HTML elements in addition to strings as its content.Makefile for building leaflet.js on non-Windows machines (by @tmcw).debug/leaflet-include.js script to allow using it outside of debug folder (by @antonj).L definition to be compatible with CommonJS. #122position: absolute is reset to relative. #100setContent call. #94img { max-width: 100% } rule.Initial Leaflet release.