diff --git a/Info.plist b/Info.plist index 2f89376..5ffc8a7 100644 --- a/Info.plist +++ b/Info.plist @@ -11,7 +11,7 @@ isDashDocset dashIndexFilePath - leafletjs.com/reference-1.3.4.html + leafletjs.com/reference-1.4.0.html isJavaScriptEnabled diff --git a/Leaflet.xml b/Leaflet.xml index 071f838..7c50c62 100644 --- a/Leaflet.xml +++ b/Leaflet.xml @@ -1,4 +1,4 @@ 1.0 - https://github.com/drewda/leaflet-docset/raw/2019.01.30-1.3.4/dist/Leaflet.tgz + https://github.com/drewda/leaflet-docset/raw/2019.01.30-1.4.0/dist/Leaflet.tgz diff --git a/Rakefile b/Rakefile index bd89f6f..11a4dc2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ require 'sqlite3' require 'nokogiri' -FILE_NAME = "reference-1.3.4.html" +FILE_NAME = "reference-1.4.0.html" DOC_URL = "http://leafletjs.com/#{FILE_NAME}" task :default => [ diff --git a/dist/Leaflet.tgz b/dist/Leaflet.tgz index 0cb2674..2a93043 100644 Binary files a/dist/Leaflet.tgz and b/dist/Leaflet.tgz differ diff --git a/dist/leaflet.docset/Contents/Info.plist b/dist/leaflet.docset/Contents/Info.plist index 2f89376..5ffc8a7 100644 --- a/dist/leaflet.docset/Contents/Info.plist +++ b/dist/leaflet.docset/Contents/Info.plist @@ -11,7 +11,7 @@ isDashDocset dashIndexFilePath - leafletjs.com/reference-1.3.4.html + leafletjs.com/reference-1.4.0.html isJavaScriptEnabled diff --git a/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.0.0.html b/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.0.0.html deleted file mode 100644 index a0efa12..0000000 --- a/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.0.0.html +++ /dev/null @@ -1,26691 +0,0 @@ - - - - - - - Documentation - Leaflet - a JavaScript library for interactive maps - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Leaflet

-

an open-source JavaScript library
for mobile-friendly interactive maps

- - - -
- - -

API Reference

- -

This reference reflects Leaflet 1.0.0.

- -

Docs for the legacy 0.7.x versions are available here. - -

-
- -
-

UI Layers

- -

Raster Layers

- -

Vector Layers

- -
-
-

Other Layers

- -

Basic Types

- -

Controls

- -
-
- - - - - - -

Utility

- -

DOM Utility

- -
-
-

Base Classes

- - -

Misc

- -
-
- -

Map

-

The central class of the API — it is used to create a map on a page and manipulate it.

- -
-

Usage example

- -
- - - - - -
// initialize the map on the "map" div with a given center and zoom
-var map = L.map('map', {
-    center: [51.505, -0.09],
-    zoom: 13
-});
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.map(<String> id, <Map options> options?)Instantiates a map object given the DOM ID of a <div> element -and optionally an object literal with Map options.
L.map(<HTMLElement> el, <Map options> options?)Instantiates a map object given an instance of a <div> HTML element -and optionally an object literal with Map options.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
preferCanvas -Boolean - falseWhether Paths should be rendered on a Canvas renderer. -By default, all Paths are rendered in a SVG renderer.
- -
- -

Control options

- - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
attributionControl -Boolean - trueWhether a attribution control is added to the map by default.
zoomControl -Boolean - trueWhether a zoom control is added to the map by default.
- -
- -

Interaction Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
closePopupOnClick -Boolean - trueSet it to false if you don't want popups to close when user clicks the map.
zoomSnap -Number - 1Forces the map's zoom level to always be a multiple of this, particularly -right after a fitBounds() or a pinch-zoom. -By default, the zoom level snaps to the nearest integer; lower values -(e.g. 0.5 or 0.1) allow for greater granularity. A value of 0 -means the zoom level will not be snapped after fitBounds or a pinch-zoom.
zoomDelta -Number - 1Controls how much the map's zoom level will change after a -zoomIn(), zoomOut(), pressing + -or - on the keyboard, or using the zoom controls. -Values smaller than 1 (e.g. 0.5) allow for greater granularity.
trackResize -Boolean - trueWhether the map automatically handles browser window resize to update itself.
boxZoom -Boolean - trueWhether the map can be zoomed to a rectangular area specified by -dragging the mouse while pressing the shift key.
doubleClickZoom -Boolean|String - trueWhether the map can be zoomed in by double clicking on it and -zoomed out by double clicking while holding shift. If passed -'center', double-click zoom will zoom to the center of the - view regardless of where the mouse was.
dragging -Boolean - trueWhether the map be draggable with mouse/touch or not.
- -
- -

Map State Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
crs -CRS - L.CRS.EPSG3857The Coordinate Reference System to use. Don't change this if you're not -sure what it means.
center -LatLng - undefinedInitial geographic center of the map
zoom -Number - undefinedInitial map zoom level
minZoom -Number - undefinedMinimum zoom level of the map. Overrides any minZoom option set on map layers.
maxZoom -Number - undefinedMaximum zoom level of the map. Overrides any maxZoom option set on map layers.
layers -Layer[] - []Array of layers that will be added to the map initially
maxBounds -LatLngBounds - nullWhen this option is set, the map restricts the view to the given -geographical bounds, bouncing the user back when he tries to pan -outside the view. To set the restriction dynamically, use -setMaxBounds method.
renderer -Renderer - *The default method for drawing vector layers on the map. L.SVG -or L.Canvas by default depending on browser support.
- -
- -

Animation Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
fadeAnimation -Boolean - trueWhether the tile fade animation is enabled. By default it's enabled -in all browsers that support CSS3 Transitions except Android.
markerZoomAnimation -Boolean - trueWhether markers animate their zoom with the zoom animation, if disabled -they will disappear for the length of the animation. By default it's -enabled in all browsers that support CSS3 Transitions except Android.
transform3DLimit -Number - 2^23Defines the maximum size of a CSS translation transform. The default -value should not be changed unless a web browser positions layers in -the wrong place after doing a large panBy.
zoomAnimation -Boolean - trueWhether the map zoom animation is enabled. By default it's enabled -in all browsers that support CSS3 Transitions except Android.
zoomAnimationThreshold -Number - 4Won't animate zoom if the zoom difference exceeds this value.
- -
- -

Panning Inertia Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
inertia -Boolean - *If enabled, panning of the map will have an inertia effect where -the map builds momentum while dragging and continues moving in -the same direction for some time. Feels especially nice on touch -devices. Enabled by default unless running on old Android devices.
inertiaDeceleration -Number - 3000The rate with which the inertial movement slows down, in pixels/second².
inertiaMaxSpeed -Number - InfinityMax speed of the inertial movement, in pixels/second.
easeLinearity -Number - 0.2
worldCopyJump -Boolean - falseWith this option enabled, the map tracks when you pan to another "copy" -of the world and seamlessly jumps to the original one so that all overlays -like markers and vector layers are still visible.
maxBoundsViscosity -Number - 0.0If maxBounds is set, this option will control how solid the bounds -are when dragging the map around. The default value of 0.0 allows the -user to drag outside the bounds at normal speed, higher values will -slow down map dragging outside bounds, and 1.0 makes the bounds fully -solid, preventing the user from dragging outside the bounds.
- -
- -

Keyboard Navigation Options

- - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
keyboard -Boolean - trueMakes the map focusable and allows users to navigate the map with keyboard -arrows and +/- keys.
keyboardPanDelta -Number - 80Amount of pixels to pan when pressing an arrow key.
- -
- -

Mousewheel options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
scrollWheelZoom -Boolean|String - trueWhether the map can be zoomed by using the mouse wheel. If passed 'center', -it will zoom to the center of the view regardless of where the mouse was.
wheelDebounceTime -Number - 40Limits the rate at which a wheel can fire (in milliseconds). By default -user can't zoom via wheel more often than once per 40 ms.
wheelPxPerZoomLevel -Number - 60How many scroll pixels (as reported by L.DomEvent.getWheelDelta) -mean a change of one full zoom level. Smaller values will make wheel-zooming -faster (and vice versa).
- -
- -

Touch interaction options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
tap -Boolean - trueEnables mobile hacks for supporting instant taps (fixing 200ms click -delay on iOS/Android) and touch holds (fired as contextmenu events).
tapTolerance -Number - 15The max number of pixels a user can shift his finger during touch -for it to be considered a valid tap.
touchZoom -Boolean|String - *Whether the map can be zoomed by touch-dragging with two fingers. If -passed 'center', it will zoom to the center of the view regardless of -where the touch events (fingers) were. Enabled for touch-capable web -browsers except for old Androids.
bounceAtZoomLimits -Boolean - trueSet it to false if you don't want the map to zoom beyond min/max zoom -and then bounce back when pinch-zooming.
- -
- - -
-

Events

- -
- -

Layer events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
baselayerchange - LayersControlEventFired when the base layer is changed through the layer control.
overlayadd - LayersControlEventFired when an overlay is selected through the layer control.
overlayremove - LayersControlEventFired when an overlay is deselected through the layer control.
layeradd - LayerEventFired when a new layer is added to the map.
layerremove - LayerEventFired when some layer is removed from the map
- -
- -

Map state change events

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
zoomlevelschange - EventFired when the number of zoomlevels on the map is changed due -to adding or removing a layer.
resize - ResizeEventFired when the map is resized.
unload - EventFired when the map is destroyed with remove method.
viewreset - EventFired when the map needs to redraw its content (this usually happens -on map zoom or load). Very useful for creating custom overlays.
load - EventFired when the map is initialized (when its center and zoom are set -for the first time).
zoomstart - EventFired when the map zoom is about to change (e.g. before zoom animation).
movestart - EventFired when the view of the map starts changing (e.g. user starts dragging the map).
zoom - EventFired repeatedly during any change in zoom level, including zoom -and fly animations.
move - EventFired repeatedly during any movement of the map, including pan and -fly animations.
zoomend - EventFired when the map has changed, after any animations.
moveend - EventFired when the center of the map stops changing (e.g. user stopped -dragging the map).
- -
- -

Popup events

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup is opened in the map
popupclose - PopupEventFired when a popup in the map is closed
autopanstart - EventFired when the map starts autopanning when opening a popup.
- -
- -

Tooltip events

- - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip is opened in the map.
tooltipclose - TooltipEventFired when a tooltip in the map is closed.
- -
- -

Interaction events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the map.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the map.
mousedown - MouseEventFired when the user pushes the mouse button on the map.
mouseup - MouseEventFired when the user releases the mouse button on the map.
mouseover - MouseEventFired when the mouse enters the map.
mouseout - MouseEventFired when the mouse leaves the map.
mousemove - MouseEventFired while the mouse moves over the map.
contextmenu - MouseEventFired when the user pushes the right mouse button on the map, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
keypress - KeyboardEventFired when the user presses a key from the keyboard while the map is focused.
preclick - MouseEventFired before mouse click on the map (sometimes useful when you -want something to happen on click before any existing click -handlers start running).
- -
- -

Animation Options

- - - - - - - - - - - - - - - - - -
EventDataDescription
zoomanim - ZoomAnimEventFired on every frame of a zoom animation
- -
- -

Location events

- - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
locationerror - ErrorEventFired when geolocation (using the locate method) failed.
locationfound - LocationEventFired when geolocation (using the locate method) -went successfully.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getRenderer(<Path> layer)Renderer -

Returns the instance of Renderer that should be used to render the given -Path. It will ensure that the renderer options of the map and paths -are respected, and that the renderers do exist on the map.

-
- -
- -

Methods for Layers and Controls

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addControl(<Control> control)this -

Adds the given control to the map

-
removeControl(<Control> control)this -

Removes the given control from the map

-
addLayer(<Layer> layer)this -

Adds the given layer to the map

-
removeLayer(<Layer> layer)this -

Removes the given layer from the map.

-
hasLayer(<Layer> layer)Boolean -

Returns true if the given layer is currently added to the map

-
eachLayer(<Function> fn, <Object> context?)this -

Iterates over the layers of the map, optionally specifying context of the iterator function.

-
map.eachLayer(function(layer){
-    layer.bindPopup('Hello');
-});
-
-
openPopup(<Popup> popup)this -

Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).

-
openPopup(<String|HTMLElement> content, <LatLng> latlng, <Popup options> options?)this -

Creates a popup with the specified content and options and opens it in the given point on a map.

-
closePopup(<Popup> popup?)this -

Closes the popup previously opened with openPopup (or the given one).

-
openTooltip(<Tooltip> tooltip)this -

Opens the specified tooltip.

-
openTooltip(<String|HTMLElement> content, <LatLng> latlng, <Tooltip options> options?)this -

Creates a tooltip with the specified content and options and open it.

-
closeTooltip(<Tooltip> tooltip?)this -

Closes the tooltip given as parameter.

-
- -
- -

Methods for modifying map state

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setView(<LatLng> center, <Number> zoom, <Zoom/pan options> options?)this -

Sets the view of the map (geographical center and zoom) with the given -animation options.

-
setZoom(<Number> zoom, <Zoom/pan options> options)this -

Sets the zoom of the map.

-
zoomIn(<Number> delta?, <Zoom options> options?)this -

Increases the zoom of the map by delta (zoomDelta by default).

-
zoomOut(<Number> delta?, <Zoom options> options?)this -

Decreases the zoom of the map by delta (zoomDelta by default).

-
setZoomAround(<LatLng> latlng, <Number> zoom, <Zoom options> options)this -

Zooms the map while keeping a specified geographical point on the map -stationary (e.g. used internally for scroll zoom and double-click zoom).

-
setZoomAround(<Point> offset, <Number> zoom, <Zoom options> options)this -

Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.

-
fitBounds(<LatLngBounds> bounds, <fitBounds options> options)this -

Sets a map view that contains the given geographical bounds with the -maximum zoom level possible.

-
fitWorld(<fitBounds options> options?)this -

Sets a map view that mostly contains the whole world with the maximum -zoom level possible.

-
panTo(<LatLng> latlng, <Pan options> options?)this -

Pans the map to a given center.

-
panBy(<Point> offset)this -

Pans the map by a given number of pixels (animated).

-
setMaxBounds(<Bounds> bounds)this -

Restricts the map view to the given bounds (see the maxBounds option).

-
setMinZoom(<Number> zoom)this -

Sets the lower limit for the available zoom levels (see the minZoom option).

-
setMaxZoom(<Number> zoom)this -

Sets the upper limit for the available zoom levels (see the maxZoom option).

-
panInsideBounds(<LatLngBounds> bounds, <Pan options> options?)this -

Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.

-
invalidateSize(<Zoom/Pan options> options)this -

Checks if the map container size changed and updates the map if so — -call it after you've changed the map size dynamically, also animating -pan by default. If options.pan is false, panning will not occur. -If options.debounceMoveend is true, it will delay moveend event so -that it doesn't happen often even if the method is called many -times in a row.

-
invalidateSize(<Boolean> animate)this -

Checks if the map container size changed and updates the map if so — -call it after you've changed the map size dynamically, also animating -pan by default.

-
stop()this -

Stops the currently running panTo or flyTo animation, if any.

-
flyTo(<LatLng> latlng, <Number> zoom?, <Zoom/pan options> options?)this -

Sets the view of the map (geographical center and zoom) performing a smooth -pan-zoom animation.

-
flyToBounds(<LatLngBounds> bounds, <fitBounds options> options?)this -

Sets the view of the map with a smooth animation like flyTo, -but takes a bounds parameter like fitBounds.

-
- -
- -

Other Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addHandler(<String> name, <Function> HandlerClass)this -

Adds a new Handler to the map, given its name and constructor function.

-
remove()this -

Destroys the map and clears all related event listeners.

-
createPane(<String> name, <HTMLElement> container?)HTMLElement -

Creates a new map pane with the given name if it doesn't exist already, -then returns it. The pane is created as a children of container, or -as a children of the main map pane if not set.

-
getPane(<String|HTMLElement> pane)HTMLElement -

Returns a map pane, given its name or its HTML element (its identity).

-
getPanes()Object -

Returns a plain object containing the names of all panes as keys and -the panes as values.

-
getContainer()HTMLElement -

Returns the HTML element that contains the map.

-
whenReady(<Function> fn, <Object> context?)this -

Runs the given function fn when the map gets initialized with -a view (center and zoom) and at least one layer, or immediately -if it's already initialized, optionally passing a function context.

-
- -
- -

Methods for Getting Map State

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getCenter()LatLng -

Returns the geographical center of the map view

-
getZoom()Number -

Returns the current zoom level of the map view

-
getBounds()LatLngBounds -

Returns the geographical bounds visible in the current map view

-
getMinZoom()Number -

Returns the minimum zoom level of the map (if set in the minZoom option of the map or of any layers), or 0 by default.

-
getMaxZoom()Number -

Returns the maximum zoom level of the map (if set in the maxZoom option of the map or of any layers).

-
getBoundsZoom(<LatLngBounds> bounds, <Boolean> inside?)Number -

Returns the maximum zoom level on which the given bounds fit to the map -view in its entirety. If inside (optional) is set to true, the method -instead returns the minimum zoom level on which the map view fits into -the given bounds in its entirety.

-
getSize()Point -

Returns the current size of the map container (in pixels).

-
getPixelBounds()Bounds -

Returns the bounds of the current map view in projected pixel -coordinates (sometimes useful in layer and overlay implementations).

-
getPixelOrigin()Point -

Returns the projected pixel coordinates of the top left point of -the map layer (useful in custom layer and overlay implementations).

-
getPixelWorldBounds(<Number> zoom?)Bounds -

Returns the world's bounds in pixel coordinates for zoom level zoom. -If zoom is omitted, the map's current zoom level is used.

-
- -
- -

Conversion Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getZoomScale(<Number> toZoom, <Number> fromZoom)Number -

Returns the scale factor to be applied to a map transition from zoom level -fromZoom to toZoom. Used internally to help with zoom animations.

-
getScaleZoom(<Number> scale, <Number> fromZoom)Number -

Returns the zoom level that the map would end up at, if it is at fromZoom -level and everything is scaled by a factor of scale. Inverse of -getZoomScale.

-
project(<LatLng> latlng, <Number> zoom)Point -

Projects a geographical coordinate LatLng according to the projection -of the map's CRS, then scales it according to zoom and the CRS's -Transformation. The result is pixel coordinate relative to -the CRS origin.

-
unproject(<Point> point, <Number> zoom)LatLng -

Inverse of project.

-
layerPointToLatLng(<Point> point)LatLng -

Given a pixel coordinate relative to the origin pixel, -returns the corresponding geographical coordinate (for the current zoom level).

-
latLngToLayerPoint(<LatLng> latlng)Point -

Given a geographical coordinate, returns the corresponding pixel coordinate -relative to the origin pixel.

-
wrapLatLng(<LatLng> latlng)LatLng -

Returns a LatLng where lat and lng has been wrapped according to the -map's CRS's wrapLat and wrapLng properties, if they are outside the -CRS's bounds. -By default this means longitude is wrapped around the dateline so its -value is between -180 and +180 degrees.

-
distance(<LatLng> latlng1, <LatLng> latlng2)Number -

Returns the distance between two geographical coordinates according to -the map's CRS. By default this measures distance in meters.

-
containerPointToLayerPoint(<Point> point)Point -

Given a pixel coordinate relative to the map container, returns the corresponding -pixel coordinate relative to the origin pixel.

-
layerPointToContainerPoint(<Point> point)Point -

Given a pixel coordinate relative to the origin pixel, -returns the corresponding pixel coordinate relative to the map container.

-
containerPointToLatLng(<Point> point)Point -

Given a pixel coordinate relative to the map container, returns -the corresponding geographical coordinate (for the current zoom level).

-
latLngToContainerPoint(<LatLng> latlng)Point -

Given a geographical coordinate, returns the corresponding pixel coordinate -relative to the map container.

-
mouseEventToContainerPoint(<MouseEvent> ev)Point -

Given a MouseEvent object, returns the pixel coordinate relative to the -map container where the event took place.

-
mouseEventToLayerPoint(<MouseEvent> ev)Point -

Given a MouseEvent object, returns the pixel coordinate relative to -the origin pixel where the event took place.

-
mouseEventToLatLng(<MouseEvent> ev)LatLng -

Given a MouseEvent object, returns geographical coordinate where the -event took place.

-
- -
- -

Geolocation methods

- - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
locate(<Locate options> options?)this -

Tries to locate the user using the Geolocation API, firing a locationfound -event with location data on success or a locationerror event on failure, -and optionally sets the map view to the user's location with respect to -detection accuracy (or to the world view if geolocation failed). -Note that, if your page doesn't use HTTPS, this method will fail in -modern browsers (Chrome 50 and newer) -See Locate options for more details.

-
stopLocate()this -

Stops watching location previously initiated by map.locate({watch: true}) -and aborts resetting the map view if map.locate was called with -{setView: true}.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -
-

Properties

- -
- -

Handlers

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
boxZoom - HandlerBox (shift-drag with mouse) zoom handler.
doubleClickZoom - HandlerDouble click zoom handler.
dragging - HandlerMap dragging handler (by both mouse and touch).
keyboard - HandlerKeyboard navigation handler.
scrollWheelZoom - HandlerScroll wheel zoom handler.
tap - HandlerMobile touch hacks (quick tap and touch hold) handler.
touchZoom - HandlerTouch zoom handler.
- -
- - -
-

Map panes

- -
- - - -
Panes are DOM elements used to control the ordering of layers on the map. You -can access panes with map.getPane or -map.getPanes methods. New panes can be created with the -map.createPane method. -Every map has the following default panes that differ only in zIndex.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaneTypeZ-indexDescription
mapPane -HTMLElement - 'auto'Pane that contains all other map panes
tilePane -HTMLElement - 200Pane for GridLayers and TileLayers
overlayPane -HTMLElement - 400Pane for vector overlays (Paths), like Polylines and Polygons
shadowPane -HTMLElement - 500Pane for overlay shadows (e.g. Marker shadows)
markerPane -HTMLElement - 600Pane for Icons of Markers
tooltipPane -HTMLElement - 650Pane for tooltip.
popupPane -HTMLElement - 700Pane for Popups.
- -
- - -
- -
-

Locate options

- -
- - - -
Some of the geolocation methods for Map take in an options parameter. This -is a plain javascript object with the following optional components:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
watch -Boolean - falseIf true, starts continous watching of location changes (instead of detecting it -once) using W3C watchPosition method. You can later stop watching using -map.stopLocate() method.
setView -Boolean - falseIf true, automatically sets the map view to the user location with respect to -detection accuracy, or to world view if geolocation failed.
maxZoom -Number - InfinityThe maximum zoom for automatic view setting when using setView option.
timeout -Number - 10000Number of milliseconds to wait for a response from geolocation before firing a -locationerror event.
maximumAge -Number - 0Maximum age of detected location. If less than this amount of milliseconds -passed since last geolocation response, locate will return a cached location.
enableHighAccuracy -Boolean - falseEnables high accuracy, see description in the W3C spec.
- -
- - -
- -
-

Zoom options

- -
- - - -
Some of the Map methods which modify the zoom level take in an options -parameter. This is a plain javascript object with the following optional -components:
- - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
animate -Boolean - If not specified, zoom animation will happen if the zoom origin is inside the -current view. If true, the map will attempt animating zoom disregarding where -zoom origin is. Setting false will make it always reset the view completely -without animation.
- -
- - -
- -
-

Pan options

- -
- - - -
Some of the Map methods which modify the center of the map take in an options -parameter. This is a plain javascript object with the following optional -components:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
animate -Boolean - If true, panning will always be animated if possible. If false, it will -not animate panning, either resetting the map view if panning more than a -screen away, or just setting a new offset for the map pane (except for panBy -which always does the latter).
duration -Number - 0.25Duration of animated panning, in seconds.
easeLinearity -Number - 0.25The curvature factor of panning animation easing (third parameter of the -Cubic Bezier curve). 1.0 means linear animation, -the less the more bowed the curve.
noMoveStart -Boolean - falseIf true, panning won't fire movestart event on start (used internally for -panning inertia).
- -
- - -
- -
-

Zoom/pan options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
animate -Boolean - If not specified, zoom animation will happen if the zoom origin is inside the -current view. If true, the map will attempt animating zoom disregarding where -zoom origin is. Setting false will make it always reset the view completely -without animation.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
duration -Number - 0.25Duration of animated panning, in seconds.
easeLinearity -Number - 0.25The curvature factor of panning animation easing (third parameter of the -Cubic Bezier curve). 1.0 means linear animation, -the less the more bowed the curve.
noMoveStart -Boolean - falseIf true, panning won't fire movestart event on start (used internally for -panning inertia).
- -
-
-
- -
- -
-

FitBounds options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
paddingTopLeft -Point - [0, 0]Sets the amount of padding in the top left corner of a map container that -shouldn't be accounted for when setting the view to fit bounds. Useful if you -have some control overlays on the map like a sidebar and you don't want them -to obscure objects you're zooming to.
paddingBottomRight -Point - [0, 0]The same for the bottom right corner of the map.
padding -Point - [0, 0]Equivalent of setting both top left and bottom right padding to the same value.
maxZoom -Number - nullThe maximum possible zoom to use.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
animate -Boolean - If not specified, zoom animation will happen if the zoom origin is inside the -current view. If true, the map will attempt animating zoom disregarding where -zoom origin is. Setting false will make it always reset the view completely -without animation.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
duration -Number - 0.25Duration of animated panning, in seconds.
easeLinearity -Number - 0.25The curvature factor of panning animation easing (third parameter of the -Cubic Bezier curve). 1.0 means linear animation, -the less the more bowed the curve.
noMoveStart -Boolean - falseIf true, panning won't fire movestart event on start (used internally for -panning inertia).
- -
-
-
- -

Marker

-

L.Marker is used to display clickable/draggable icons on the map. Extends Layer.

- -
-

Usage example

- -
- - - - - -
L.marker([50.5, 30.5]).addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.marker(<LatLng> latlng, <Marker options> options?)Instantiates a Marker object given a geographical point and optionally an options object.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
icon -Icon - *Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. If not specified, a new L.Icon.Default is used.
draggable -Boolean - falseWhether the marker is draggable with mouse/touch or not.
keyboard -Boolean - trueWhether the marker can be tabbed to with a keyboard and clicked by pressing enter.
title -String - ''Text for the browser tooltip that appear on marker hover (no tooltip by default).
alt -String - ''Text for the alt attribute of the icon image (useful for accessibility).
zIndexOffset -Number - 0By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively).
opacity -Number - 1.0The opacity of the marker.
riseOnHover -Boolean - falseIf true, the marker will get on top of others when you hover the mouse over it.
riseOffset -Number - 250The z-index offset used for the riseOnHover feature.
pane -String - 'markerPane' -Map pane where the markers icon will be added.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
-

Events

- -
- - - - - - - - - - - - - - - - - - - -
EventDataDescription
move - EventFired when the marker is moved via setLatLng or by dragging. Old and new coordinates are included in event arguments as oldLatLng, latlng.
- -
- -

Dragging events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
dragstart - EventFired when the user starts dragging the marker.
movestart - EventFired when the marker starts moving (because of dragging).
drag - EventFired repeatedly while the user drags the marker.
dragend - DragEndEventFired when the user stops dragging the marker.
moveend - EventFired when the marker stops moving (because of dragging).
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - -
In addition to shared layer methods like addTo() and remove() and popup methods like bindPopup() you can also use the following methods:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getLatLng()LatLng -

Returns the current geographical position of the marker.

-
setLatLng(<LatLng> latlng)this -

Changes the marker position to the given point.

-
setZIndexOffset(<Number> offset)this -

Changes the zIndex offset of the marker.

-
setIcon(<Icon> icon)this -

Changes the marker icon.

-
setOpacity(<Number> opacity)this -

Changes the opacity of the marker.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -
-

Properties

- -
- -

Interaction handlers

- -
Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see Handler methods). Example: -
marker.dragging.disable();
-
-
- - - - - - - - - - - - - - - - -
PropertyTypeDescription
dragging - HandlerMarker dragging handler (by both mouse and touch).
- -
- - -
-

Used to open popups in certain places of the map. Use Map.openPopup to -open popups while making sure that only one popup is open at one time -(recommended for usability), or use Map.addLayer to open as many as you want.

- -
- - -
- - - - - -

If you want to just bind a popup to marker click and then open it, it's really easy:

-
marker.bindPopup(popupContent).openPopup();
-
-

Path overlays like polylines also have a bindPopup method. -Here's a more complicated way to open a popup on a map:

-
var popup = L.popup()
-    .setLatLng(latlng)
-    .setContent('<p>Hello world!<br />This is a nice popup.</p>')
-    .openOn(map);
-
- - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
FactoryDescription
- -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
- -
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
- -
-
-
- -

Tooltip

-

Used to display small texts on top of map layers.

- -
-

Usage example

- -
- - - - - -
marker.bindTooltip("my tooltip text").openTooltip();
-
-

Note about tooltip offset. Leaflet takes two options in consideration -for computing tooltip offseting:

-
    -
  • the offset Tooltip option: it defaults to [0, 0], and it's specific to one tooltip. -Add a positive x offset to move the tooltip to the right, and a positive y offset to -move it to the bottom. Negatives will move to the left and top.
  • -
  • the tooltipAnchor Icon option: this will only be considered for Marker. You -should adapt this value if you use a custom icon.
  • -
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.tooltip(<Tooltip options> options?, <Layer> source?)Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'tooltipPane' -Map pane where the tooltip will be added.
offset -Point - Point(0, 0)Optional offset of the tooltip position.
direction -String - 'auto'Direction where to open the tooltip. Possible values are: right, left, -top, bottom, center, auto. -auto will dynamicaly switch between right and left according to the tooltip -position on the map.
permanent -Boolean - falseWhether to open the tooltip permanently or only on mouseover.
sticky -Boolean - falseIf true, the tooltip will follow the mouse instead of being fixed at the feature center.
interactive -Boolean - falseIf true, the tooltip will listen to the feature events.
opacity -Number - 0.9Tooltip container opacity.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
className -String - ''A custom CSS class name to assign to the popup.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

TileLayer

-

Used to load and display tile layers on the map. Extends GridLayer.

- -
-

Usage example

- -
- - - - - -
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
-
- - - -
- -

URL template

- - - -

A string of the following form:

-
'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
-
-

You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

-
L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
-
- - -
- - -
-

Creation

- -
- -

Extension methods

- - - - - - - - - - - - - - - -
FactoryDescription
L.tilelayer(<String> urlTemplate, <TileLayer options> options?)Instantiates a tile layer object given a URL template and optionally an options object.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
minZoom -Number - 0Minimum zoom number.
maxZoom -Number - 18Maximum zoom number.
maxNativeZoom -Number - nullMaximum zoom number the tile source has available. If it is specified, -the tiles on all zoom levels higher than maxNativeZoom will be loaded -from maxNativeZoom level and auto-scaled.
subdomains -String|String[] - 'abc'Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
errorTileUrl -String - ''URL to the tile image to show in place of the tile that failed to load.
zoomOffset -Number - 0The zoom number used in tile URLs will be offset with this value.
tms -Boolean - falseIf true, inverses Y axis numbering for tiles (turn this on for TMS services).
zoomReverse -Boolean - falseIf set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
detectRetina -Boolean - falseIf true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
crossOrigin -Boolean - falseIf true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
tileSize -Number|Point - 256Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
opacity -Number - 1.0Opacity of the tiles. Can be used in the createTile() function.
updateWhenIdle -Boolean - dependsIf false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
updateWhenZooming -Boolean - trueBy default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
updateInterval -Number - 200Tiles will not update more than once every updateInterval milliseconds when panning.
attribution -String - nullString to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
zIndex -Number - 1The explicit zIndex of the tile layer.
bounds -LatLngBounds - undefinedIf set, tiles will only be loaded inside the set LatLngBounds.
noWrap -Boolean - falseWhether the layer is wrapped around the antimeridian. If true, the -GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around.
pane -String - 'tilePane' -Map pane where the grid layer will be added.
className -String - ''A custom class name to assign to the tile layer. Empty by default.
keepBuffer -Number - 2When panning the map, keep this many rows and columns of tiles before unloading them.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
loading - EventFired when the grid layer starts loading tiles.
tileunload - TileEventFired when a tile is removed (e.g. when a tile goes off the screen).
tileloadstart - TileEventFired when a tile is requested and starts loading.
tileerror - TileErrorEventFired when there is an error loading a tile.
tileload - TileEventFired when a tile loads.
load - EventFired when the grid layer loaded all visible tiles.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setUrl(<String> url, <Boolean> noRedraw?)this -

Updates the layer's URL template and redraws it (unless noRedraw is set to true).

-
createTile(<Object> coords, <Function> done?)HTMLElement -

Called only internally, overrides GridLayer's createTile() -to return an <img> HTML element with the appropiate image URL given coords. The done -callback is called when the tile has been loaded.

-
- -
- -

Extension methods

- -
Layers extending TileLayer might reimplement the following method.
- - - - - - - - - - - - - - - - -
MethodReturnsDescription
getTileUrl(<Object> coords)String -

Called only internally, returns the URL for a tile given its coordinates. -Classes extending TileLayer can override this function to provide custom tile URL naming schemes.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bringToFront()this -

Brings the tile layer to the top of all tile layers.

-
bringToBack()this -

Brings the tile layer to the bottom of all tile layers.

-
getAttribution()String -

Used by the attribution control, returns the attribution option.

-
getContainer()HTMLElement -

Returns the HTML element that contains the tiles for this layer.

-
setOpacity(<Number> opacity)this -

Changes the opacity of the grid layer.

-
setZIndex(<Number> zIndex)this -

Changes the zIndex of the grid layer.

-
isLoading()Boolean -

Returns true if any tile in the grid layer has not finished loading.

-
redraw()this -

Causes the layer to clear all the tiles and request them again.

-
getTileSize()Point -

Normalizes the tileSize option into a point. Used by the createTile() method.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

TileLayer.WMS

-

Used to display WMS services as tile layers on the map. Extends TileLayer.

- -
-

Usage example

- -
- - - - - -
var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
-    layers: 'nexrad-n0r-900913',
-    format: 'image/png',
-    transparent: true,
-    attribution: "Weather data © 2012 IEM Nexrad"
-});
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.tileLayer.wms(<String> baseUrl, <TileLayer.WMS options> options)Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
- -
- - -
-

Options

- -
- - - -
If any custom options not documented here are used, they will be sent to the -WMS server as extra parameters in each request URL. This can be useful for -non-standard vendor WMS parameters.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
layers -String - '' -(required) Comma-separated list of WMS layers to show.
styles -String - ''Comma-separated list of WMS styles.
format -String - 'image/jpeg'WMS image format (use 'image/png' for layers with transparency).
transparent -Boolean - falseIf true, the WMS service will return images with transparency.
version -String - '1.1.1'Version of the WMS service to use
crs -CRS - nullCoordinate Reference System to use for the WMS requests, defaults to -map CRS. Don't change this if you're not sure what it means.
uppercase -Boolean - falseIf true, WMS request parameter keys will be uppercase.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
minZoom -Number - 0Minimum zoom number.
maxZoom -Number - 18Maximum zoom number.
maxNativeZoom -Number - nullMaximum zoom number the tile source has available. If it is specified, -the tiles on all zoom levels higher than maxNativeZoom will be loaded -from maxNativeZoom level and auto-scaled.
subdomains -String|String[] - 'abc'Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
errorTileUrl -String - ''URL to the tile image to show in place of the tile that failed to load.
zoomOffset -Number - 0The zoom number used in tile URLs will be offset with this value.
tms -Boolean - falseIf true, inverses Y axis numbering for tiles (turn this on for TMS services).
zoomReverse -Boolean - falseIf set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
detectRetina -Boolean - falseIf true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
crossOrigin -Boolean - falseIf true, all tiles will have their crossOrigin attribute set to ''. This is needed if you want to access tile pixel data.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
tileSize -Number|Point - 256Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
opacity -Number - 1.0Opacity of the tiles. Can be used in the createTile() function.
updateWhenIdle -Boolean - dependsIf false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
updateWhenZooming -Boolean - trueBy default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
updateInterval -Number - 200Tiles will not update more than once every updateInterval milliseconds when panning.
attribution -String - nullString to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
zIndex -Number - 1The explicit zIndex of the tile layer.
bounds -LatLngBounds - undefinedIf set, tiles will only be loaded inside the set LatLngBounds.
noWrap -Boolean - falseWhether the layer is wrapped around the antimeridian. If true, the -GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around.
pane -String - 'tilePane' -Map pane where the grid layer will be added.
className -String - ''A custom class name to assign to the tile layer. Empty by default.
keepBuffer -Number - 2When panning the map, keep this many rows and columns of tiles before unloading them.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
loading - EventFired when the grid layer starts loading tiles.
tileunload - TileEventFired when a tile is removed (e.g. when a tile goes off the screen).
tileloadstart - TileEventFired when a tile is requested and starts loading.
tileerror - TileErrorEventFired when there is an error loading a tile.
tileload - TileEventFired when a tile loads.
load - EventFired when the grid layer loaded all visible tiles.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setParams(<Object> params, <Boolean> noRedraw?)this -

Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setUrl(<String> url, <Boolean> noRedraw?)this -

Updates the layer's URL template and redraws it (unless noRedraw is set to true).

-
createTile(<Object> coords, <Function> done?)HTMLElement -

Called only internally, overrides GridLayer's createTile() -to return an <img> HTML element with the appropiate image URL given coords. The done -callback is called when the tile has been loaded.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bringToFront()this -

Brings the tile layer to the top of all tile layers.

-
bringToBack()this -

Brings the tile layer to the bottom of all tile layers.

-
getAttribution()String -

Used by the attribution control, returns the attribution option.

-
getContainer()HTMLElement -

Returns the HTML element that contains the tiles for this layer.

-
setOpacity(<Number> opacity)this -

Changes the opacity of the grid layer.

-
setZIndex(<Number> zIndex)this -

Changes the zIndex of the grid layer.

-
isLoading()Boolean -

Returns true if any tile in the grid layer has not finished loading.

-
redraw()this -

Causes the layer to clear all the tiles and request them again.

-
getTileSize()Point -

Normalizes the tileSize option into a point. Used by the createTile() method.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

ImageOverlay

-

Used to load and display a single image over specific bounds of the map. Extends Layer.

- -
-

Usage example

- -
- - - - - -
var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
-    imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
-L.imageOverlay(imageUrl, imageBounds).addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.imageOverlay(<String> imageUrl, <LatLngBounds> bounds, <ImageOverlay options> options?)Instantiates an image overlay object given the URL of the image and the -geographical bounds it is tied to.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
opacity -Number - 1.0The opacity of the image overlay.
alt -String - ''Text for the alt attribute of the image (useful for accessibility).
interactive -Boolean - falseIf true, the image overlay will emit mouse events when clicked or hovered.
attribution -String - nullAn optional string containing HTML to be shown on the Attribution control -
crossOrigin -Boolean - falseIf true, the image will have its crossOrigin attribute set to ''. This is needed if you want to access image pixel data.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setOpacity(<Number> opacity)this -

Sets the opacity of the overlay.

-
bringToFront()this -

Brings the layer to the top of all overlays.

-
bringToBack()this -

Brings the layer to the bottom of all overlays.

-
setUrl(<String> url)this -

Changes the URL of the image.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Path

-

An abstract class that contains options and constants shared between vector -overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer.

- -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Polyline

-

A class for drawing polyline overlays on a map. Extends Path.

- -
-

Usage example

- -
- - - - - -
// create a red polyline from an array of LatLng points
-var latlngs = [
-    [-122.68, 45.51],
-    [-122.43, 37.77],
-    [-118.2, 34.04]
-];
-var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
-// zoom the map to the polyline
-map.fitBounds(polyline.getBounds());
-
-

You can also pass a multi-dimensional array to represent a MultiPolyline shape:

-
// create a red polyline from an array of arrays of LatLng points
-var latlngs = [
-    [[-122.68, 45.51],
-     [-122.43, 37.77],
-     [-118.2, 34.04]],
-    [[-73.91, 40.78],
-     [-87.62, 41.83],
-     [-96.72, 32.76]]
-];
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.polyline(<LatLng[]> latlngs, <Polyline options> options?)Instantiates a polyline object given an array of geographical points and -optionally an options object. You can create a Polyline object with -multiple separate lines (MultiPolyline) by passing an array of arrays -of geographic points.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
smoothFactor -Number - 1.0How much to simplify the polyline on each zoom level. More means -better performance and smoother look, and less means more accurate representation.
noClip -Boolean - falseDisable polyline clipping.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).

-
getLatLngs()LatLng[] -

Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.

-
setLatLngs(<LatLng[]> latlngs)this -

Replaces all the points in the polyline with the given array of geographical points.

-
isEmpty()Boolean -

Returns true if the Polyline has no LatLngs.

-
getCenter()LatLng -

Returns the center (centroid) of the polyline.

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the path.

-
addLatLng(<LatLng> latlng)this -

Adds a given point to the polyline. By default, adds to the first ring of -the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Polygon

-

A class for drawing polygon overlays on a map. Extends Polyline. -Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

- -
-

Usage example

- -
- - - - - -
// create a red polygon from an array of LatLng points
-var latlngs = [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]];
-var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);
-// zoom the map to the polygon
-map.fitBounds(polygon.getBounds());
-
-

You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:

-
var latlngs = [
-  [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]], // outer ring
-  [[-108.58,37.29],[-108.58,40.71],[-102.50,40.71],[-102.50,37.29]] // hole
-];
-
-

Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.

-
var latlngs = [
-  [ // first polygon
-    [[-111.03, 41],[-111.04, 45],[-104.05, 45],[-104.05, 41]], // outer ring
-    [[-108.58,37.29],[-108.58,40.71],[-102.50,40.71],[-102.50,37.29]] // hole
-  ],
-  [ // second polygon
-    [[-109.05, 37],[-109.03, 41],[-102.05, 41],[-102.04, 37],[-109.05, 38]]
-  ]
-];
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.polygon(<LatLng[]> latlngs, <Polyline options> options?)
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
smoothFactor -Number - 1.0How much to simplify the polyline on each zoom level. More means -better performance and smoother look, and less means more accurate representation.
noClip -Boolean - falseDisable polyline clipping.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getLatLngs()LatLng[] -

Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.

-
setLatLngs(<LatLng[]> latlngs)this -

Replaces all the points in the polyline with the given array of geographical points.

-
isEmpty()Boolean -

Returns true if the Polyline has no LatLngs.

-
getCenter()LatLng -

Returns the center (centroid) of the polyline.

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the path.

-
addLatLng(<LatLng> latlng)this -

Adds a given point to the polyline. By default, adds to the first ring of -the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Rectangle

-

A class for drawing rectangle overlays on a map. Extends Polygon.

- -
-

Usage example

- -
- - - - - -
// define rectangle geographical bounds
-var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
-// create an orange rectangle
-L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
-// zoom the map to the rectangle bounds
-map.fitBounds(bounds);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.rectangle(<LatLngBounds> latLngBounds, <Polyline options> options?)
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
smoothFactor -Number - 1.0How much to simplify the polyline on each zoom level. More means -better performance and smoother look, and less means more accurate representation.
noClip -Boolean - falseDisable polyline clipping.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setBounds(<LatLngBounds> latLngBounds)this -

Redraws the rectangle with the passed bounds.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getLatLngs()LatLng[] -

Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.

-
setLatLngs(<LatLng[]> latlngs)this -

Replaces all the points in the polyline with the given array of geographical points.

-
isEmpty()Boolean -

Returns true if the Polyline has no LatLngs.

-
getCenter()LatLng -

Returns the center (centroid) of the polyline.

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the path.

-
addLatLng(<LatLng> latlng)this -

Adds a given point to the polyline. By default, adds to the first ring of -the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Circle

-

A class for drawing circle overlays on a map. Extends CircleMarker. -It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).

- -
-

Usage example

- -
- - - - - -
L.circle([50.5, 30.5], 200).addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.circle(<LatLng> latlng, <Circle options> options?)Instantiates a circle object given a geographical point, and an options object -which contains the circle radius.
L.circle(<LatLng> latlng, <Number> radius, <Circle options> options?)Obsolete way of instantiating a circle, for compatibility with 0.7.x code. -Do not use in new applications or plugins.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
radius -Number - Radius of the circle, in meters.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setRadius(<Number> radius)this -

Sets the radius of a circle. Units are in meters.

-
getRadius()Number -

Returns the current radius of a circle. Units are in meters.

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the path.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

-
setLatLng(<LatLng> latLng)this -

Sets the position of a circle marker to a new location.

-
getLatLng()LatLng -

Returns the current geographical position of the circle marker

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

CircleMarker

-

A circle of a fixed size with radius specified in pixels. Extends Path.

- -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.circleMarker(<LatLng> latlng, <CircleMarker options> options?)Instantiates a circle marker object given a geographical point, and an optional options object.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
radius -Number - 10Radius of the circle marker, in pixels
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
stroke -Boolean - trueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
color -String - '#3388ff'Stroke color
weight -Number - 3Stroke width in pixels
opacity -Number - 1.0Stroke opacity
lineCap -String - 'round'A string that defines shape to be used at the end of the stroke.
lineJoin -String - 'round'A string that defines shape to be used at the corners of the stroke.
dashArray -String - nullA string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
dashOffset -String - nullA string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
fill -Boolean - dependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
fillColor -String - *Fill color. Defaults to the value of the color option
fillOpacity -Number - 0.2Fill opacity.
fillRule -String - 'evenodd'A string that defines how the inside of a shape is determined.
renderer -Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer.
className -String - nullCustom class name set on an element. Only for SVG renderer.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - -
There are several static functions which can be called without instantiating L.GeoJSON:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

-
setLatLng(<LatLng> latLng)this -

Sets the position of a circle marker to a new location.

-
getLatLng()LatLng -

Returns the current geographical position of the circle marker

-
setRadius(<Number> radius)this -

Sets the radius of a circle marker. Units are in pixels.

-
getRadius()Number -

Returns the current radius of the circle

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
redraw()this -

Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.

-
setStyle(<Path options> style)this -

Changes the appearance of a Path based on the options in the Path options object.

-
bringToFront()this -

Brings the layer to the top of all path layers.

-
bringToBack()this -

Brings the layer to the bottom of all path layers.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

SVG

-

Although SVG is not available on IE7 and IE8, these browsers support VML, and the SVG renderer will fall back to VML in this case. -VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility -with old versions of Internet Explorer.

-

Allows vector layers to be displayed with SVG. -Inherits Renderer. -Due to technical limitations, SVG is not -available in all web browsers, notably Android 2.x and 3.x. -Although SVG is not available on IE7 and IE8, these browsers support -VML -(a now deprecated technology), and the SVG renderer will fall back to VML in -this case.

- -
-

Usage example

- -
- - - - - -

Use SVG by default for all paths in the map:

-
var map = L.map('map', {
-    renderer: L.svg();
-});
-
-

Use a SVG renderer with extra padding for specific vector geometries:

-
var map = L.map('map');
-var myRenderer = L.svg({ padding: 0.5 });
-var line = L.polyline( coordinates, { renderer: myRenderer } );
-var circle = L.circle( center, { renderer: myRenderer } );
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.svg(<Renderer options> options?)Creates a SVG renderer with the given options.
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
padding -Number - 0.1How much to extend the clip area around the map view (relative to its size) -e.g. 0.1 would be 10% of map view in each direction
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - -
EventDataDescription
update - EventFired when the renderer updates its bounds, center and zoom, for example when -its map has moved
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -
-

Functions

- -
- - - -
There are several static functions which can be called without instantiating L.SVG:
- - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
create(<String> name)SVGElementReturns a instance of SVGElement, -corresponding to the class name passed. For example, using 'line' will return -an instance of SVGLineElement.
pointsToPath(<Point[]> rings, <Boolean> closed)StringGenerates a SVG path string for multiple rings, with each ring turning -into "M..L..L.." instructions
- -
- - -

Canvas

-

Allows vector layers to be displayed with <canvas>. -Inherits Renderer. -Due to technical limitations, Canvas is not -available in all web browsers, notably IE8, and overlapping geometries might -not display properly in some edge cases.

- -
-

Usage example

- -
- - - - - -

Use Canvas by default for all paths in the map:

-
var map = L.map('map', {
-    renderer: L.canvas()
-});
-
-

Use a Canvas renderer with extra padding for specific vector geometries:

-
var map = L.map('map');
-var myRenderer = L.canvas({ padding: 0.5 });
-var line = L.polyline( coordinates, { renderer: myRenderer } );
-var circle = L.circle( center, { renderer: myRenderer } );
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.canvas(<Renderer options> options?)Creates a Canvas renderer with the given options.
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
padding -Number - 0.1How much to extend the clip area around the map view (relative to its size) -e.g. 0.1 would be 10% of map view in each direction
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - -
EventDataDescription
update - EventFired when the renderer updates its bounds, center and zoom, for example when -its map has moved
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

LayerGroup

-

Used to group several layers and handle them as one. If you add it to the map, -any layers added or removed from the group will be added/removed on the map as -well. Extends Layer.

- -
-

Usage example

- -
- - - - - -
L.layerGroup([marker1, marker2])
-    .addLayer(polyline)
-    .addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.layerGroup(<Layer[]> layers)Create a layer group, optionally given an initial set of layers.
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).

-
addLayer(<Layer> layer)this -

Adds the given layer to the group.

-
removeLayer(<Layer> layer)this -

Removes the given layer from the group.

-
removeLayer(<Number> id)this -

Removes the layer with the given internal ID from the group.

-
hasLayer(<Layer> layer)Boolean -

Returns true if the given layer is currently added to the group.

-
clearLayers()this -

Removes all the layers from the group.

-
invoke(<String> methodName, )this -

Calls methodName on every layer contained in this group, passing any -additional parameters. Has no effect if the layers contained do not -implement methodName.

-
eachLayer(<Function> fn, <Object> context?)this -

Iterates over the layers of the group, optionally specifying context of the iterator function.

-
group.eachLayer(function (layer) {
-    layer.bindPopup('Hello');
-});
-
-
getLayer(<Number> id)Layer -

Returns the layer with the given internal ID.

-
getLayers()Layer[] -

Returns an array of all the layers added to the group.

-
setZIndex(<Number> zIndex)this -

Calls setZIndex on every layer contained in this group, passing the z-index.

-
getLayerId(<Layer> layer)Number -

Returns the internal ID for a layer

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

FeatureGroup

-

Extended LayerGroup that makes it easier to do the same thing to all its member layers:

-
    -
  • -bindPopup binds a popup to all of the layers at once (likewise with bindTooltip)
  • -
  • Events are propagated to the FeatureGroup, so if the group has an event -handler, it will handle events from any of the layers. This includes mouse events -and custom events.
  • -
  • Has layeradd and layerremove events
  • -
- -
-

Usage example

- -
- - - - - -
L.featureGroup([marker1, marker2, polyline])
-    .bindPopup('Hello world!')
-    .on('click', function() { alert('Clicked on a member of the group!'); })
-    .addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.featureGroup(<Layer[]> layers)Create a feature group, optionally given an initial set of layers.
- -
- - -
-

Options

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
layeradd - LayerEventFired when a layer is added to this FeatureGroup -
layerremove - LayerEventFired when a layer is removed from this FeatureGroup -
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setStyle(<Path options> style)this -

Sets the given path options to each layer of the group that has a setStyle method.

-
bringToFront()this -

Brings the layer group to the top of all other layers

-
bringToBack()this -

Brings the layer group to the top of all other layers

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).

-
addLayer(<Layer> layer)this -

Adds the given layer to the group.

-
removeLayer(<Layer> layer)this -

Removes the given layer from the group.

-
removeLayer(<Number> id)this -

Removes the layer with the given internal ID from the group.

-
hasLayer(<Layer> layer)Boolean -

Returns true if the given layer is currently added to the group.

-
clearLayers()this -

Removes all the layers from the group.

-
invoke(<String> methodName, )this -

Calls methodName on every layer contained in this group, passing any -additional parameters. Has no effect if the layers contained do not -implement methodName.

-
eachLayer(<Function> fn, <Object> context?)this -

Iterates over the layers of the group, optionally specifying context of the iterator function.

-
group.eachLayer(function (layer) {
-    layer.bindPopup('Hello');
-});
-
-
getLayer(<Number> id)Layer -

Returns the layer with the given internal ID.

-
getLayers()Layer[] -

Returns an array of all the layers added to the group.

-
setZIndex(<Number> zIndex)this -

Calls setZIndex on every layer contained in this group, passing the z-index.

-
getLayerId(<Layer> layer)Number -

Returns the internal ID for a layer

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

GeoJSON

-

Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse -GeoJSON data and display it on the map. Extends FeatureGroup.

- -
-

Usage example

- -
- - - - - -
L.geoJSON(data, {
-    style: function (feature) {
-        return {color: feature.properties.color};
-    }
-}).bindPopup(function (layer) {
-    return layer.feature.properties.description;
-}).addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.geoJSON(<Object> geojson?, <GeoJSON options> options?)Creates a GeoJSON layer. Optionally accepts an object in -GeoJSON format to display on the map -(you can alternatively add it later with addData method) and an options object.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pointToLayer -Function - *A Function defining how GeoJSON points spawn Leaflet layers. It is internally -called when data is added, passing the GeoJSON point feature and its LatLng. -The default is to spawn a default Marker: -
function(geoJsonPoint, latlng) {
-    return L.marker(latlng);
-}
-
-
style -Function - *A Function defining the Path options for styling GeoJSON lines and polygons, -called internally when data is added. -The default value is to not override any defaults: -
function (geoJsonFeature) {
-    return {}
-}
-
-
onEachFeature -Function - *A Function that will be called once for each created Feature, after it has -been created and styled. Useful for attaching events and popups to features. -The default is to do nothing with the newly created layers: -
function (feature, layer) {}
-
-
filter -Function - *A Function that will be used to decide whether to show a feature or not. -The default is to show all features: -
function (geoJsonFeature) {
-    return true;
-}
-
-
coordsToLatLng -Function - *A Function that will be used for converting GeoJSON coordinates to LatLngs. -The default is the coordsToLatLng static method.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
layeradd - LayerEventFired when a layer is added to this FeatureGroup -
layerremove - LayerEventFired when a layer is removed from this FeatureGroup -
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setStyle(<Path options> style)this -

Sets the given path options to each layer of the group that has a setStyle method.

-
bringToFront()this -

Brings the layer group to the top of all other layers

-
bringToBack()this -

Brings the layer group to the top of all other layers

-
getBounds()LatLngBounds -

Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
toGeoJSON()Object -

Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).

-
addLayer(<Layer> layer)this -

Adds the given layer to the group.

-
removeLayer(<Layer> layer)this -

Removes the given layer from the group.

-
removeLayer(<Number> id)this -

Removes the layer with the given internal ID from the group.

-
hasLayer(<Layer> layer)Boolean -

Returns true if the given layer is currently added to the group.

-
clearLayers()this -

Removes all the layers from the group.

-
invoke(<String> methodName, )this -

Calls methodName on every layer contained in this group, passing any -additional parameters. Has no effect if the layers contained do not -implement methodName.

-
eachLayer(<Function> fn, <Object> context?)this -

Iterates over the layers of the group, optionally specifying context of the iterator function.

-
group.eachLayer(function (layer) {
-    layer.bindPopup('Hello');
-});
-
-
getLayer(<Number> id)Layer -

Returns the layer with the given internal ID.

-
getLayers()Layer[] -

Returns an array of all the layers added to the group.

-
setZIndex(<Number> zIndex)this -

Calls setZIndex on every layer contained in this group, passing the z-index.

-
getLayerId(<Layer> layer)Number -

Returns the internal ID for a layer

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
addData(data)LayerAdds a GeoJSON object to the layer.
resetStyle(layer)LayerResets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
setStyle(style)LayerChanges styles of GeoJSON vector layers with the given style function.
geometryToLayer(<Object> featureData, <GeoJSON options> options?)LayerCreates a Layer from a given GeoJSON feature. Can use a custom -pointToLayer and/or coordsToLatLng -functions if provided as options.
coordsToLatLng(<Array> coords)LatLngCreates a LatLng object from an array of 2 numbers (longitude, latitude) -or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
coordsToLatLngs(<Array> coords, <Number> levelsDeep?, <Function> coordsToLatLng?)ArrayCreates a multidimensional array of LatLngs from a GeoJSON coordinates array. -levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default). -Can use a custom coordsToLatLng function.
latLngToCoords(<LatLng> latlng)ArrayReverse of coordsToLatLng -
latLngsToCoords(<Array> latlngs, <Number> levelsDeep?, <Boolean> closed?)ArrayReverse of coordsToLatLngs -closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default.
asFeature(<Object> geojson)ObjectNormalize GeoJSON geometries/features into GeoJSON features.
- -
- - -

GridLayer

-

Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces TileLayer.Canvas. -GridLayer can be extended to create a tiled grid of HTML elements like <canvas>, <img> or <div>. GridLayer will handle creating and animating these DOM elements for you.

- -
-

Usage example

- -
- -

Synchronous usage

- - - -

To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.

-
var CanvasLayer = L.GridLayer.extend({
-    createTile: function(coords){
-        // create a <canvas> element for drawing
-        var tile = L.DomUtil.create('canvas', 'leaflet-tile');
-        // setup tile width and height according to the options
-        var size = this.getTileSize();
-        tile.width = size.x;
-        tile.height = size.y;
-        // get a canvas context and draw something on it using coords.x, coords.y and coords.z
-        var ctx = tile.getContext('2d');
-        // return the tile so it can be rendered on screen
-        return tile;
-    }
-});
-
- - - -
- -

Asynchronous usage

- - - -

Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the done() callback.

-
var CanvasLayer = L.GridLayer.extend({
-    createTile: function(coords, done){
-        var error;
-        // create a <canvas> element for drawing
-        var tile = L.DomUtil.create('canvas', 'leaflet-tile');
-        // setup tile width and height according to the options
-        var size = this.getTileSize();
-        tile.width = size.x;
-        tile.height = size.y;
-        // draw something asynchronously and pass the tile to the done() callback
-        setTimeout(function() {
-            done(error, tile);
-        }, 1000);
-        return tile;
-    }
-});
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.gridLayer(<GridLayer options> options?)Creates a new instance of GridLayer with the supplied options.
- -
- - -
-

Options

- -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
tileSize -Number|Point - 256Width and height of tiles in the grid. Use a number if width and height are equal, or L.point(width, height) otherwise.
opacity -Number - 1.0Opacity of the tiles. Can be used in the createTile() function.
updateWhenIdle -Boolean - dependsIf false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile browsers, otherwise false.
updateWhenZooming -Boolean - trueBy default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
updateInterval -Number - 200Tiles will not update more than once every updateInterval milliseconds when panning.
attribution -String - nullString to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".
zIndex -Number - 1The explicit zIndex of the tile layer.
bounds -LatLngBounds - undefinedIf set, tiles will only be loaded inside the set LatLngBounds.
minZoom -Number - 0The minimum zoom level that tiles will be loaded at. By default the entire map.
maxZoom -Number - undefinedThe maximum zoom level that tiles will be loaded at.
noWrap -Boolean - falseWhether the layer is wrapped around the antimeridian. If true, the -GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around.
pane -String - 'tilePane' -Map pane where the grid layer will be added.
className -String - ''A custom class name to assign to the tile layer. Empty by default.
keepBuffer -Number - 2When panning the map, keep this many rows and columns of tiles before unloading them.
- -
- - -
-

Events

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
loading - EventFired when the grid layer starts loading tiles.
tileunload - TileEventFired when a tile is removed (e.g. when a tile goes off the screen).
tileloadstart - TileEventFired when a tile is requested and starts loading.
tileerror - TileErrorEventFired when there is an error loading a tile.
tileload - TileEventFired when a tile loads.
load - EventFired when the grid layer loaded all visible tiles.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bringToFront()this -

Brings the tile layer to the top of all tile layers.

-
bringToBack()this -

Brings the tile layer to the bottom of all tile layers.

-
getAttribution()String -

Used by the attribution control, returns the attribution option.

-
getContainer()HTMLElement -

Returns the HTML element that contains the tiles for this layer.

-
setOpacity(<Number> opacity)this -

Changes the opacity of the grid layer.

-
setZIndex(<Number> zIndex)this -

Changes the zIndex of the grid layer.

-
isLoading()Boolean -

Returns true if any tile in the grid layer has not finished loading.

-
redraw()this -

Causes the layer to clear all the tiles and request them again.

-
getTileSize()Point -

Normalizes the tileSize option into a point. Used by the createTile() method.

-
- -
- -

Extension methods

- -
Layers extending GridLayer shall reimplement the following method.
- - - - - - - - - - - - - - - - -
MethodReturnsDescription
createTile(<Object> coords, <Function> done?)HTMLElement -

Called only internally, must be overriden by classes extending GridLayer. -Returns the HTMLElement corresponding to the given coords. If the done callback -is specified, it must be called when the tile has finished loading and drawing.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

LatLng

-

Represents a geographical point with a certain latitude and longitude.

- -
-

Usage example

- -
- - - - - -
var latlng = L.latLng(50.5, 30.5);
-
-

All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:

-
map.panTo([50, 30]);
-map.panTo({lon: 30, lat: 50});
-map.panTo({lat: 50, lng: 30});
-map.panTo(L.latLng(50, 30));
-
- - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.latLng(<Number> latitude, <Number> longitude, <Number> altitude?)Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
L.latLng(<Array> coords)Expects an array of the form [Number, Number] or [Number, Number, Number] instead.
L.latLng(<Object> coords)Expects an plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
equals(<LatLng> otherLatLng, <Number> maxMargin?)Boolean -

Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overriden by setting maxMargin to a small number.

-
toString()String -

Returns a string representation of the point (for debugging purposes).

-
distanceTo(<LatLng> otherLatLng)Number -

Returns the distance (in meters) to the given LatLng calculated using the Haversine formula.

-
wrap()LatLng -

Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.

-
toBounds(<Number> sizeInMeters)LatLngBounds -

Returns a new LatLngBounds object in which each boundary is sizeInMeters meters apart from the LatLng.

-
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
lat - NumberLatitude in degrees
lng - NumberLongitude in degrees
alt - NumberAltitude in meters (optional)
- -
- - -

LatLngBounds

-

Represents a rectangular geographical area on a map.

- -
-

Usage example

- -
- - - - - -
var southWest = L.latLng(40.712, -74.227),
-northEast = L.latLng(40.774, -74.125),
-bounds = L.latLngBounds(southWest, northEast);
-
-

All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:

-
map.fitBounds([
-    [40.712, -74.227],
-    [40.774, -74.125]
-]);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.latLngBounds(<LatLng> southWest, <LatLng> northEast)Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.
L.latLngBounds(<LatLng[]> latlngs)Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
extend(<LatLng> latlng)this -

Extend the bounds to contain the given point

-
extend(<LatLngBounds> otherBounds)this -

Extend the bounds to contain the given bounds

-
pad(<Number> bufferRatio)LatLngBounds -

Returns bigger bounds created by extending the current bounds by a given percentage in each direction.

-
getCenter()LatLng -

Returns the center point of the bounds.

-
getSouthWest()LatLng -

Returns the south-west point of the bounds.

-
getNorthEast()LatLng -

Returns the north-east point of the bounds.

-
getNorthWest()LatLng -

Returns the north-west point of the bounds.

-
getSouthEast()LatLng -

Returns the south-east point of the bounds.

-
getWest()Number -

Returns the west longitude of the bounds

-
getSouth()Number -

Returns the south latitude of the bounds

-
getEast()Number -

Returns the east longitude of the bounds

-
getNorth()Number -

Returns the north latitude of the bounds

-
contains(<LatLngBounds> otherBounds)Boolean -

Returns true if the rectangle contains the given one.

-
contains(<LatLng> latlng)Boolean -

Returns true if the rectangle contains the given point.

-
intersects(<LatLngBounds> otherBounds)Boolean -

Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.

-
overlaps(<Bounds> otherBounds)Boolean -

Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.

-
toBBoxString()String -

Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.

-
equals(<LatLngBounds> otherBounds)Boolean -

Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds.

-
isValid()Boolean -

Returns true if the bounds are properly initialized.

-
- -
- - -

Point

-

Represents a point with x and y coordinates in pixels.

- -
-

Usage example

- -
- - - - - -
var point = L.point(200, 300);
-
-

All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

-
map.panBy([200, 300]);
-map.panBy(L.point(200, 300));
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.point(<Number> x, <Number> y, <Boolean> round?)Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
L.point(<Number[]> coords)Expects an array of the form [x, y] instead.
L.point(<Object> coords)Expects a plain object of the form {x: Number, y: Number} instead.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
clone()Point -

Returns a copy of the current point.

-
add(<Point> otherPoint)Point -

Returns the result of addition of the current and the given points.

-
subtract(<Point> otherPoint)Point -

Returns the result of subtraction of the given point from the current.

-
divideBy(<Number> num)Point -

Returns the result of division of the current point by the given number.

-
multiplyBy(<Number> num)Point -

Returns the result of multiplication of the current point by the given number.

-
scaleBy(<Point> scale)Point -

Multiply each coordinate of the current point by each coordinate of -scale. In linear algebra terms, multiply the point by the -scaling matrix -defined by scale.

-
unscaleBy(<Point> scale)Point -

Inverse of scaleBy. Divide each coordinate of the current point by -each coordinate of scale.

-
round()Point -

Returns a copy of the current point with rounded coordinates.

-
floor()Point -

Returns a copy of the current point with floored coordinates (rounded down).

-
ceil()Point -

Returns a copy of the current point with ceiled coordinates (rounded up).

-
distanceTo(<Point> otherPoint)Number -

Returns the cartesian distance between the current and the given points.

-
equals(<Point> otherPoint)Boolean -

Returns true if the given point has the same coordinates.

-
contains(<Point> otherPoint)Boolean -

Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).

-
toString()String -

Returns a string representation of the point for debugging purposes.

-
- -
- - -

Bounds

-

Represents a rectangular area in pixel coordinates.

- -
-

Usage example

- -
- - - - - -
var p1 = L.point(10, 10),
-p2 = L.point(40, 60),
-bounds = L.bounds(p1, p2);
-
-

All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:

-
otherBounds.intersects([[10, 10], [40, 60]]);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - - - - - -
FactoryDescription
L.bounds(<Point> topLeft, <Point> bottomRight)Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
L.bounds(<Point[]> points)Creates a Bounds object from the points it contains
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
extend(<Point> point)this -

Extends the bounds to contain the given point.

-
getCenter(<Boolean> round?)Point -

Returns the center point of the bounds.

-
getBottomLeft()Point -

Returns the bottom-left point of the bounds.

-
getTopRight()Point -

Returns the top-right point of the bounds.

-
getSize()Point -

Returns the size of the given bounds

-
contains(<Bounds> otherBounds)Boolean -

Returns true if the rectangle contains the given one.

-
contains(<Point> point)Boolean -

Returns true if the rectangle contains the given point.

-
intersects(<Bounds> otherBounds)Boolean -

Returns true if the rectangle intersects the given bounds. Two bounds -intersect if they have at least one point in common.

-
overlaps(<Bounds> otherBounds)Boolean -

Returns true if the rectangle overlaps the given bounds. Two bounds -overlap if their intersection is an area.

-
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
min - PointThe top left corner of the rectangle.
max - PointThe bottom right corner of the rectangle.
- -
- - -

Icon

-

Represents an icon to provide when creating a marker.

- -
-

Usage example

- -
- - - - - -
var myIcon = L.icon({
-    iconUrl: 'my-icon.png',
-    iconSize: [38, 95],
-    iconAnchor: [22, 94],
-    popupAnchor: [-3, -76],
-    shadowUrl: 'my-icon-shadow.png',
-    shadowSize: [68, 95],
-    shadowAnchor: [22, 94]
-});
-L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
-
-

L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.

- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.icon(<Icon options> options)Creates an icon instance with the given options.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
iconUrl -String - null -(required) The URL to the icon image (absolute or relative to your script path).
iconRetinaUrl -String - nullThe URL to a retina sized version of the icon image (absolute or relative to your -script path). Used for Retina screen devices.
iconSize -Point - nullSize of the icon image in pixels.
iconAnchor -Point - nullThe coordinates of the "tip" of the icon (relative to its top left corner). The icon -will be aligned so that this point is at the marker's geographical location. Centered -by default if size is specified, also can be set in CSS with negative margins.
popupAnchor -Point - nullThe coordinates of the point from which popups will "open", relative to the icon anchor.
shadowUrl -String - nullThe URL to the icon shadow image. If not specified, no shadow image will be created.
shadowRetinaUrl -String - null
shadowSize -Point - nullSize of the shadow image in pixels.
shadowAnchor -Point - nullThe coordinates of the "tip" of the shadow (relative to its top left corner) (the same -as iconAnchor if not specified).
className -String - ''A custom class name to assign to both icon and shadow images. Empty by default.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
createIcon(<HTMLElement> oldIcon?)HTMLElement -

Called internally when the icon has to be shown, returns a <img> HTML element -styled according to the options.

-
createShadow(<HTMLElement> oldIcon?)HTMLElement -

As createIcon, but for the shadow beneath it.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -
- -
-

Icon.Default

- -
- - - -
A trivial subclass of Icon, represents the icon to use in Markers when -no icon is specified. Points to the blue marker image distributed with Leaflet -releases. -In order to change the default icon, just change the properties of L.Icon.Default.prototype.options -(which is a set of Icon options).
- - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
imagePath -String - -L.Icon.Default will try to auto-detect the absolute location of the -blue icon images. If you are placing these images in a non-standard -way, set this option to point to the right absolute path.
- -
- - -

DivIcon

-

Represents a lightweight icon for markers that uses a simple <div> -element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.

- -
-

Usage example

- -
- - - - - -
var myIcon = L.divIcon({className: 'my-div-icon'});
-// you can set .my-div-icon styles in CSS
-L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
-
-

By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.

- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.divIcon(<DivIcon options> options)Creates a DivIcon instance with the given options.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
html -String - ''Custom HTML code to put inside the div element, empty by default.
bgPos -Point - [0, 0]Optional relative position of the background, in pixels
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
iconUrl -String - null -(required) The URL to the icon image (absolute or relative to your script path).
iconRetinaUrl -String - nullThe URL to a retina sized version of the icon image (absolute or relative to your -script path). Used for Retina screen devices.
iconSize -Point - nullSize of the icon image in pixels.
iconAnchor -Point - nullThe coordinates of the "tip" of the icon (relative to its top left corner). The icon -will be aligned so that this point is at the marker's geographical location. Centered -by default if size is specified, also can be set in CSS with negative margins.
popupAnchor -Point - nullThe coordinates of the point from which popups will "open", relative to the icon anchor.
shadowUrl -String - nullThe URL to the icon shadow image. If not specified, no shadow image will be created.
shadowRetinaUrl -String - null
shadowSize -Point - nullSize of the shadow image in pixels.
shadowAnchor -Point - nullThe coordinates of the "tip" of the shadow (relative to its top left corner) (the same -as iconAnchor if not specified).
className -String - ''A custom class name to assign to both icon and shadow images. Empty by default.
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
createIcon(<HTMLElement> oldIcon?)HTMLElement -

Called internally when the icon has to be shown, returns a <img> HTML element -styled according to the options.

-
createShadow(<HTMLElement> oldIcon?)HTMLElement -

As createIcon, but for the shadow beneath it.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Control.Zoom

-

A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control.

- -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.control.zoom(<Control.Zoom options> options)Creates a zoom control
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
zoomInText -String - '+'The text set on the 'zoom in' button.
zoomInTitle -String - 'Zoom in'The title set on the 'zoom in' button.
zoomOutText -String - '-'The text set on the 'zoom out' button.
zoomOutTitle -String - 'Zoom out'The title set on the 'zoom out' button.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
position -String - 'topright'The position of the control (one of the map corners). Possible values are 'topleft', -'topright', 'bottomleft' or 'bottomright' -
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getPosition()string -

Returns the position of the control.

-
setPosition(<string> position)this -

Sets the position of the control.

-
getContainer()HTMLElement -

Returns the HTMLElement that contains the control.

-
addTo(<Map> map)this -

Adds the control to the given map.

-
remove()this -

Removes the control from the map it is currently active on.

-
- -
-
-
- -

Control.Attribution

-

The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.

- -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.control.attribution(<Control.Attribution options> options)Creates an attribution control.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
prefix -String - 'Leaflet'The HTML text shown before the attributions. Pass false to disable.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
position -String - 'topright'The position of the control (one of the map corners). Possible values are 'topleft', -'topright', 'bottomleft' or 'bottomright' -
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setPrefix(<String> prefix)this -

Sets the text before the attributions.

-
addAttribution(<String> text)this -

Adds an attribution text (e.g. 'Vector data &copy; Mapbox').

-
removeAttribution(<String> text)this -

Removes an attribution text.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getPosition()string -

Returns the position of the control.

-
setPosition(<string> position)this -

Sets the position of the control.

-
getContainer()HTMLElement -

Returns the HTMLElement that contains the control.

-
addTo(<Map> map)this -

Adds the control to the given map.

-
remove()this -

Removes the control from the map it is currently active on.

-
- -
-
-
- -

Control.Layers

-

The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

- -
-

Usage example

- -
- - - - - -
var baseLayers = {
-    "Mapbox": mapbox,
-    "OpenStreetMap": osm
-};
-var overlays = {
-    "Marker": marker,
-    "Roads": roadsLayer
-};
-L.control.layers(baseLayers, overlays).addTo(map);
-
-

The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:

-
{
-    "<someName1>": layer1,
-    "<someName2>": layer2
-}
-
-

The layer names can contain HTML, which allows you to add additional styling to the items:

-
{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.control.layers(<Object> baselayers?, <Object> overlays?, <Control.Layers options> options?)Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
collapsed -Boolean - trueIf true, the control will be collapsed into an icon and expanded on mouse hover or touch.
autoZIndex -Boolean - trueIf true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
hideSingleBase -Boolean - falseIf true, the base layers in the control will be hidden when there is only one.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
position -String - 'topright'The position of the control (one of the map corners). Possible values are 'topleft', -'topright', 'bottomleft' or 'bottomright' -
- -
-
-
- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addBaseLayer(<Layer> layer, <String> name)this -

Adds a base layer (radio button entry) with the given name to the control.

-
addOverlay(<Layer> layer, <String> name)this -

Adds an overlay (checkbox entry) with the given name to the control.

-
removeLayer(<Layer> layer)this -

Remove the given layer from the control.

-
expand()this -

Expand the control container if collapsed.

-
collapse()this -

Collapse the control container if expanded.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getPosition()string -

Returns the position of the control.

-
setPosition(<string> position)this -

Sets the position of the control.

-
getContainer()HTMLElement -

Returns the HTMLElement that contains the control.

-
addTo(<Map> map)this -

Adds the control to the given map.

-
remove()this -

Removes the control from the map it is currently active on.

-
- -
-
-
- -

Control.Scale

-

A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control.

- -
-

Usage example

- -
- - - - - -
L.control.scale().addTo(map);
-
- - - -
- - -
-

Creation

- -
- - - - - - - - - - - - - - - - - -
FactoryDescription
L.control.scale(<Control.Scale options> options?)Creates an scale control with the given options.
- -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
maxWidth -Number - 100Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
metric -Boolean - TrueWhether to show the metric scale line (m/km).
imperial -Boolean - TrueWhether to show the imperial scale line (mi/ft).
updateWhenIdle -Boolean - falseIf true, the control is updated on moveend, otherwise it's always up-to-date (updated on move).
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
position -String - 'topright'The position of the control (one of the map corners). Possible values are 'topleft', -'topright', 'bottomleft' or 'bottomright' -
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getPosition()string -

Returns the position of the control.

-
setPosition(<string> position)this -

Sets the position of the control.

-
getContainer()HTMLElement -

Returns the HTMLElement that contains the control.

-
addTo(<Map> map)this -

Adds the control to the given map.

-
remove()this -

Removes the control from the map it is currently active on.

-
- -
-
-
- -

Browser

-

A namespace with static properties for browser/feature detection used by Leaflet internally.

- -
-

Usage example

- -
- - - - - -
if (L.Browser.ielt9) {
-  alert('Upgrade your browser, dude!');
-}
-
- - - -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
ie - Boolean -true for all Internet Explorer versions (not Edge).
ielt9 - Boolean -true for Internet Explorer versions less than 9.
edge - Boolean -true for the Edge web browser.
webkit - Boolean -true for webkit-based browsers like Chrome and Safari (including mobile versions).
gecko - Boolean -true for gecko-based browsers like Firefox.
android - Boolean -true for any browser running on an Android platform.
android23 - Boolean -true for browsers running on Android 2 or Android 3.
chrome - Boolean -true for the Chrome browser.
safari - Boolean -true for the Safari browser.
win - Boolean -true when the browser is running in a Windows platform
ie3d - Boolean -true for all Internet Explorer versions supporting CSS transforms.
webkit3d - Boolean -true for webkit-based browsers supporting CSS transforms.
gecko3d - Boolean -true for gecko-based browsers supporting CSS transforms.
opera12 - Boolean -true for the Opera browser supporting CSS transforms (version 12 or later).
any3d - Boolean -true for all browsers supporting CSS transforms.
mobile - Boolean -true for all browsers running in a mobile device.
mobileWebkit - Boolean -true for all webkit-based browsers in a mobile device.
mobileWebkit3d - Boolean -true for all webkit-based browsers in a mobile device supporting CSS transforms.
mobileOpera - Boolean -true for the Opera browser in a mobile device.
mobileGecko - Boolean -true for gecko-based browsers running in a mobile device.
touch - Boolean -true for all browsers supporting touch events.
msPointer - Boolean -true for browsers implementing the Microsoft touch events model (notably IE10).
pointer - Boolean -true for all browsers supporting pointer events.
retina - Boolean -true for browsers on a high-resolution "retina" screen.
canvas - Boolean -true when the browser supports <canvas>.
vml - Boolean -true if the browser supports VML.
svg - Boolean -true when the browser supports SVG.
- -
- - -

Util

-

Various utility functions, used by Leaflet internally.

- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
extend(<Object> dest, <Object> src?)ObjectMerges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut.
create(<Object> proto, <Object> properties?)ObjectCompatibility polyfill for Object.create -
bind(<Function> fn, )FunctionReturns a new function bound to the arguments passed, like Function.prototype.bind. -Has a L.bind() shortcut.
stamp(<Object> obj)NumberReturns the unique ID of an object, assiging it one if it doesn't have it.
throttle(<Function> fn, <Number> time, <Object> context)FunctionReturns a function which executes function fn with the given scope context -(so that the this keyword refers to context inside fn's code). The function -fn will be called no more than one time per given amount of time. The arguments -received by the bound function will be any arguments passed when binding the -function, followed by any arguments passed when invoking the bound function. -Has an L.bind shortcut.
wrapNum(<Number> num, <Number[]> range, <Boolean> includeMax?)NumberReturns the number num modulo range in such a way so it lies within -range[0] and range[1]. The returned value will be always smaller than -range[1] unless includeMax is set to true.
falseFn()FunctionReturns a function which always returns false.
formatNum(<Number> num, <Number> digits?)NumberReturns the number num rounded to digits decimals, or to 5 decimals by default.
trim(<String> str)StringCompatibility polyfill for String.prototype.trim -
splitWords(<String> str)String[]Trims and splits the string on whitespace and returns the array of parts.
setOptions(<Object> obj, <Object> options)ObjectMerges the given properties to the options of the obj object, returning the resulting options. See Class options. Has an L.setOptions shortcut.
getParamString(<Object> obj, <String> existingUrl?, <Boolean> uppercase?)StringConverts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} -translates to '?a=foo&b=bar'. If existingUrl is set, the parameters will -be appended at the end. If uppercase is true, the parameter names will -be uppercased (e.g. '?A=foo&B=bar')
template(<String> str, <Object> data)StringSimple templating facility, accepts a template string of the form 'Hello {a}, {b}' -and a data object like {a: 'foo', b: 'bar'}, returns evaluated string -('Hello foo, bar'). You can also specify functions instead of strings for -data values — they will be evaluated passing data as an argument.
isArray(obj)BooleanCompatibility polyfill for Array.isArray -
indexOf(<Array> array, <Object> el)NumberCompatibility polyfill for Array.prototype.indexOf -
requestAnimFrame(<Function> fn, <Object> context?, <Boolean> immediate?)NumberSchedules fn to be executed when the browser repaints. fn is bound to -context if given. When immediate is set, fn is called immediately if -the browser doesn't have native support for -window.requestAnimationFrame, -otherwise it's delayed. Returns a request ID that can be used to cancel the request.
cancelAnimFrame(<Number> id)undefinedCancels a previous requestAnimFrame. See also window.cancelAnimationFrame.
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
lastId - NumberLast unique ID used by stamp() -
emptyImageUrl - StringData URI string containing a base64-encoded empty GIF image. -Used as a hack to free memory from unused images on WebKit-powered -mobile devices (by setting image src to this string).
- -
- - -

Transformation

-

Represents an affine transformation: a set of coefficients a, b, c, d -for transforming a point of a form (x, y) into (a*x + b, c*y + d) and doing -the reverse. Used by Leaflet in its projections code.

- -
-

Usage example

- -
- - - - - -
var transformation = new L.Transformation(2, 5, -1, 10),
-    p = L.point(1, 2),
-    p2 = transformation.transform(p), //  L.point(7, 8)
-    p3 = transformation.untransform(p2); //  L.point(1, 2)
-
- - - -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
transform(<Point> point, <Number> scale?)Point -

Returns a transformed point, optionally multiplied by the given scale. -Only accepts real L.Point instances, not arrays.

-
untransform(<Point> point, <Number> scale?)Point -

Returns the reverse transformation of the given point, optionally divided -by the given scale. Only accepts real L.Point instances, not arrays.

-
- -
- - -

LineUtil

-

Various utility functions for polyine points processing, used by Leaflet internally to make polylines lightning-fast.

- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
simplify(<Point[]> points, <Number> tolerance)Point[]Dramatically reduces the number of points in a polyline while retaining -its shape and returns a new array of simplified points, using the -Douglas-Peucker algorithm. -Used for a huge performance boost when processing/displaying Leaflet polylines for -each zoom level and also reducing visual noise. tolerance affects the amount of -simplification (lesser value means higher quality but slower and with more points). -Also released as a separated micro-library Simplify.js.
pointToSegmentDistance(<Point> p, <Point> p1, <Point> p2)NumberReturns the distance between point p and segment p1 to p2.
closestPointOnSegment(<Point> p, <Point> p1, <Point> p2)NumberReturns the closest point from a point p on a segment p1 to p2.
clipSegment(<Point> a, <Point> b, <Bounds> bounds, <Boolean> useLastCode?, <Boolean> round?)Point[]|BooleanClips the segment a to b by rectangular bounds with the -Cohen-Sutherland algorithm -(modifying the segment points directly!). Used by Leaflet to only show polyline -points that are on the screen or near, increasing performance.
- -
- - -

PolyUtil

-

Various utility functions for polygon geometries.

- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
clipPolygon(<Point[]> points, <Bounds> bounds, <Boolean> round?)Point[]Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgeman algorithm). -Used by Leaflet to only show polygon points that are on the screen or near, increasing -performance. Note that polygon points needs different algorithm for clipping -than polyline, so there's a seperate method for it.
- -
- - -

DomEvent

-

Utility functions to work with the DOM events, used by Leaflet internally.

- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
on(<HTMLElement> el, <String> types, <Function> fn, <Object> context?)thisAdds a listener function (fn) to a particular DOM event type of the -element el. You can optionally specify the context of the listener -(object the this keyword will point to). You can also pass several -space-separated types (e.g. 'click dblclick').
on(<HTMLElement> el, <Object> eventMap, <Object> context?)thisAdds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} -
off(<HTMLElement> el, <String> types, <Function> fn, <Object> context?)thisRemoves a previously added listener function. If no function is specified, -it will remove all the listeners of that particular DOM event from the element. -Note that if you passed a custom context to on, you must pass the same -context to off in order to remove the listener.
off(<HTMLElement> el, <Object> eventMap, <Object> context?)thisRemoves a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} -
stopPropagation(<DOMEvent> ev)thisStop the given event from propagation to parent elements. Used inside the listener functions: -
L.DomEvent.on(div, 'click', function (ev) {
-    L.DomEvent.stopPropagation(ev);
-});
-
-
disableScrollPropagation(<HTMLElement> el)thisAdds stopPropagation to the element's 'mousewheel' events (plus browser variants).
disableClickPropagation(<HTMLElement> el)thisAdds stopPropagation to the element's 'click', 'doubleclick', -'mousedown' and 'touchstart' events (plus browser variants).
preventDefault(<DOMEvent> ev)thisPrevents the default action of the DOM Event ev from happening (such as -following a link in the href of the a element, or doing a POST request -with page reload when a <form> is submitted). -Use it inside listener functions.
stop(ev)thisDoes stopPropagation and preventDefault at the same time.
getMousePosition(<DOMEvent> ev, <HTMLElement> container?)PointGets normalized mouse position from a DOM event relative to the -container or to the whole page if not specified.
getWheelDelta(<DOMEvent> ev)NumberGets normalized wheel delta from a mousewheel DOM event, in vertical -pixels scrolled (negative if scrolling down). -Events from pointing devices without precise scrolling are mapped to -a best guess of 60 pixels.
addListener()thisAlias to L.DomEvent.on -
removeListener()thisAlias to L.DomEvent.off -
- -
- - -

DomUtil

-

Utility functions to work with the DOM -tree, used by Leaflet internally. -Most functions expecting or returning a HTMLElement also work for -SVG elements. The only difference is that classes refer to CSS classes -in HTML and SVG classes in SVG.

- -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
get(<String|HTMLElement> id)HTMLElementReturns an element given its DOM id, or returns the element itself -if it was passed directly.
getStyle(<HTMLElement> el, <String> styleAttrib)StringReturns the value for a certain style attribute on an element, -including computed values or values set through CSS.
create(<String> tagName, <String> className?, <HTMLElement> container?)HTMLElementCreates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
remove(<HTMLElement> el)Removes el from its parent element
empty(<HTMLElement> el)Removes all of el's children elements from el -
toFront(<HTMLElement> el)Makes el the last children of its parent, so it renders in front of the other children.
toBack(<HTMLElement> el)Makes el the first children of its parent, so it renders back from the other children.
hasClass(<HTMLElement> el, <String> name)BooleanReturns true if the element's class attribute contains name.
addClass(<HTMLElement> el, <String> name)Adds name to the element's class attribute.
removeClass(<HTMLElement> el, <String> name)Removes name from the element's class attribute.
setClass(<HTMLElement> el, <String> name)Sets the element's class.
getClass(<HTMLElement> el)StringReturns the element's class.
setOpacity(<HTMLElement> el, <Number> opacity)Set the opacity of an element (including old IE support). -opacity must be a number from 0 to 1.
testProp(<String[]> props)String|falseGoes through the array of style names and returns the first name -that is a valid style name for an element. If no such name is found, -it returns false. Useful for vendor-prefixed styles like transform.
setTransform(<HTMLElement> el, <Point> offset, <Number> scale?)Resets the 3D CSS transform of el so it is translated by offset pixels -and optionally scaled by scale. Does not have an effect if the -browser doesn't support 3D CSS transforms.
setPosition(<HTMLElement> el, <Point> position)Sets the position of el to coordinates specified by position, -using CSS translate or top/left positioning depending on the browser -(used by Leaflet internally to position its layers).
getPosition(<HTMLElement> el)PointReturns the coordinates of an element previously positioned with setPosition.
disableTextSelection()Prevents the user from generating selectstart DOM events, usually generated -when the user drags the mouse through a page with text. Used internally -by Leaflet to override the behaviour of any click-and-drag interaction on -the map. Affects drag interactions on the whole document.
enableTextSelection()Cancels the effects of a previous L.DomUtil.disableTextSelection.
disableImageDrag()As L.DomUtil.disableTextSelection, but -for dragstart DOM events, usually generated when the user drags an image.
enableImageDrag()Cancels the effects of a previous L.DomUtil.disableImageDrag.
preventOutline(<HTMLElement> el)Makes the outline -of the element el invisible. Used internally by Leaflet to prevent -focusable elements from displaying an outline when the user performs a -drag interaction on them.
restoreOutline()Cancels the effects of a previous L.DomUtil.preventOutline.
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
TRANSFORM - StringVendor-prefixed fransform style name (e.g. 'webkitTransform' for WebKit).
TRANSITION - StringVendor-prefixed transform style name.
- -
- - -

PosAnimation

-

Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.

- -
-

Usage example

- -
- - - - - -
var fx = new L.PosAnimation();
-fx.run(el, [300, 500], 0.5);
-
- - - -
- - -
-

Constructor

- -
- - - - - - - - - - - - - - - - - -
ConstructorDescription
L.PosAnimation()Creates a PosAnimation object.
- - -
- - -
-

Events

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
start - EventFired when the animation starts
step - EventFired continuously during the animation.
end - EventFired when the animation ends.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
run(<HTMLElement> el, <Point> newPos, <Number> duration?, <Number> easeLinearity?) -

Run an animation of a given element to a new position, optionally setting -duration in seconds (0.25 by default) and easing linearity factor (3rd -argument of the cubic bezier curve, -0.5 by default).

-
stop() -

Stops the animation (if currently running).

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Draggable

-

A class for making DOM elements draggable (including touch support). -Used internally for map and marker dragging. Only works for elements -that were positioned with L.DomUtil.setPosition.

- -
-

Usage example

- -
- - - - - -
var draggable = new L.Draggable(elementToDrag);
-draggable.enable();
-
- - - -
- - -
-

Constructor

- -
- - - - - - - - - - - - - - - - - -
ConstructorDescription
L.Draggable(<HTMLElement> el, <HTMLElement> dragHandle?, <Boolean> preventOutline)Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default).
- - -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
clickTolerance -Number - 3The max number of pixels a user can shift the mouse pointer during a click -for it to be considered a valid click (as opposed to a mouse drag).
- -
- - -
-

Events

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
down - EventFired when a drag is about to start.
dragstart - EventFired when a drag starts
predrag - EventFired continuously during dragging before each corresponding -update of the element's position.
drag - EventFired continuously during dragging.
dragend - DragEndEventFired when the drag ends.
- -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
enable() -

Enables the dragging ability

-
disable() -

Disables the dragging ability

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Class

-

L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here. -In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.

- -
-

Usage example

- -
- - - - - -
var MyClass = L.Class.extend({
-initialize: function (greeter) {
-    this.greeter = greeter;
-    // class constructor
-},
-greet: function (name) {
-    alert(this.greeter + ', ' + name)
-    }
-});
-// create instance of MyClass, passing "Hello" to the constructor
-var a = new MyClass("Hello");
-// call greet method, alerting "Hello, World"
-a.greet("World");
-
- - - -
- -

Class Factories

- - - -

You may have noticed that Leaflet objects are created without using -the new keyword. This is achieved by complementing each class with a -lowercase factory method:

-
new L.Map('map'); // becomes:
-L.map('map');
-
-

The factories are implemented very easily, and you can do this for your own classes:

-
L.map = function (id, options) {
-    return new L.Map(id, options);
-};
-
- - - -
- -

Inheritance

- - - -

You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

-
var MyChildClass = MyClass.extend({
-    // ... new properties and methods
-});
-
-

This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:

-
var a = new MyChildClass();
-a instanceof MyChildClass; // true
-a instanceof MyClass; // true
-
-

You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:

-
var MyChildClass = MyClass.extend({
-    initialize: function () {
-        MyClass.prototype.initialize.call(this, "Yo");
-    },
-    greet: function (name) {
-        MyClass.prototype.greet.call(this, 'bro ' + name + '!');
-    }
-});
-var a = new MyChildClass();
-a.greet('Jason'); // alerts "Yo, bro Jason!"
-
- - -
- -

Options

- - - -

options is a special property that unlike other objects that you pass -to extend will be merged with the parent one instead of overriding it -completely, which makes managing configuration of objects and default -values convenient:

-
var MyClass = L.Class.extend({
-    options: {
-        myOption1: 'foo',
-        myOption2: 'bar'
-    }
-});
-var MyChildClass = L.Class.extend({
-    options: {
-        myOption1: 'baz',
-        myOption3: 5
-    }
-});
-var a = new MyChildClass();
-a.options.myOption1; // 'baz'
-a.options.myOption2; // 'bar'
-a.options.myOption3; // 5
-
-

There's also L.Util.setOptions, a method for -conveniently merging options passed to constructor with the defaults -defines in the class:

-
var MyClass = L.Class.extend({
-    options: {
-        foo: 'bar',
-        bla: 5
-    },
-    initialize: function (options) {
-        L.Util.setOptions(this, options);
-        ...
-    }
-});
-var a = new MyClass({bla: 10});
-a.options; // {foo: 'bar', bla: 10}
-
- - - -
- -

Includes

- - - -

includes is a special class property that merges all specified objects into the class (such objects are called mixins).

-
 var MyMixin = {
-    foo: function () { ... },
-    bar: 5
-};
-var MyClass = L.Class.extend({
-    includes: MyMixin
-});
-var a = new MyClass();
-a.foo();
-
-

You can also do such includes in runtime with the include method:

-
MyClass.include(MyMixin);
-
-

statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:

-
var MyClass = L.Class.extend({
-    statics: {
-        FOO: 'bar',
-        BLA: 5
-    }
-});
-MyClass.FOO; // 'bar'
-
- - - -
- -

Constructor hooks

- - - -

If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline). Leaflet comes with a way to do it easily using the addInitHook method:

-
MyClass.addInitHook(function () {
-    // ... do something in constructor additionally
-    // e.g. add event listeners, set custom properties etc.
-});
-
-

You can also use the following shortcut when you just need to make one additional method call:

-
MyClass.addInitHook('methodName', arg1, arg2, …);
-
- - - -
- - -
-

Functions

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunctionReturnsDescription
extend(<Object> props)Function -Extends the current class given the properties to be included. -Returns a Javascript function that is a class constructor (to be called with new).
include(<Object> properties)this -Includes a mixin into the current class.
mergeOptions(<Object> options)this -Merges options into the defaults of the class.
addInitHook(<Function> fn)thisAdds a constructor hook to the class.
- -
- - -

Evented

-

A set of methods shared between event-powered classes (like Map and Marker). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).

- -
-

Usage example

- -
- - - - - -
map.on('click', function(e) {
-    alert(e.latlng);
-} );
-
-

Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:

-
function onClick(e) { ... }
-map.on('click', onClick);
-map.off('click', onClick);
-
- - - -
- - -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
- - -

Layer

-

A set of methods from the Layer base class that all Leaflet layers use. -Inherits all methods, options and events from L.Evented.

- -
-

Usage example

- -
- - - - - -
var layer = L.Marker(latlng).addTo(map);
-layer.addTo(map);
-layer.remove();
-
- - - -
- - -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
- - -
-

Events

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
- -

Popup events

- - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
- -

Tooltip events

- - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
- - -
-

Methods

- -
- - - -
Classes extending L.Layer will inherit the following methods:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
- -

Popup methods

- -
All layers share a set of methods convenient for binding popups to it. -
var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);
-layer.openPopup();
-layer.closePopup();
-
-

Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
- -

Tooltip methods

- -
All layers share a set of methods convenient for binding tooltips to it. -
var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);
-layer.openTooltip();
-layer.closeTooltip();
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
- -

Extension methods

- -
Every layer should extend from L.Layer and (re-)implement the following methods.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
onAdd(<Map> map)this -

Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

-
onRemove(<Map> map)this -

Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

-
getEvents()Object -

This optional method should return an object like { viewreset: this._reset } for addEventListener. The event handlers in this object will be automatically added and removed from the map with your layer.

-
getAttribution()String -

This optional method should return a string containing HTML to be shown on the Attribution control whenever the layer is visible.

-
beforeAdd(<Map> map)this -

Optional method. Called on map.addLayer(layer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.

-
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Interactive layer

-

Some Layers can be made interactive - when the user interacts -with such a layer, mouse events like click and mouseover can be handled. -Use the event handling methods to handle these events.

- -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
interactive -Boolean - trueIf false, the layer will not emit mouse events and will act as a part of the underlying map.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- -
- -

Mouse events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
click - MouseEventFired when the user clicks (or taps) the layer.
dblclick - MouseEventFired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventFired when the user pushes the mouse button on the layer.
mouseover - MouseEventFired when the mouse enters the layer.
mouseout - MouseEventFired when the mouse leaves the layer.
contextmenu - MouseEventFired when the user right-clicks on the layer, prevents -default browser context menu from showing if there are listeners on -this event. Also fired on mobile when the user holds a single touch -for a second (also called long press).
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Control

-

L.Control is a base class for implementing map controls. Handles positioning. -All other controls extend from this class.

- -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
position -String - 'topright'The position of the control (one of the map corners). Possible values are 'topleft', -'topright', 'bottomleft' or 'bottomright' -
- -
- - -
-

Methods

- -
- - - -
Classes extending L.Control will inherit the following methods:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
getPosition()string -

Returns the position of the control.

-
setPosition(<string> position)this -

Sets the position of the control.

-
getContainer()HTMLElement -

Returns the HTMLElement that contains the control.

-
addTo(<Map> map)this -

Adds the control to the given map.

-
remove()this -

Removes the control from the map it is currently active on.

-
- -
- -

Extension methods

- -
Every control should extend from L.Control and (re-)implement the following methods.
- - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
onAdd(<Map> map)HTMLElement -

Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map).

-
onRemove(<Map> map) -

Optional method. Should contain all clean up code that removes the listeners previously added in onAdd. Called on control.remove().

-
- -
- - -

Handler

-

Abstract class for map interaction handlers

- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
enable()this -

Enables the handler

-
disable()this -

Disables the handler

-
enabled()Boolean -

Returns true if the handler is enabled

-
- -
- -

Extension methods

- -
Classes inheriting from Handler must implement the two following methods:
- - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addHooks() -

Called when the handler is enabled, should add event hooks.

-
removeHooks() -

Called when the handler is disabled, should remove the event hooks added previously.

-
- -
- - -

Projection

-

An object with methods for projecting geographical coordinates of the world onto -a flat surface (and back). See Map projection.

- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
project(<LatLng> latlng)Point -

Projects geographical coordinates into a 2D point.

-
unproject(<Point> point)LatLng -

The inverse of project. Projects a 2D point into a geographical location.

-
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
bounds - LatLngBoundsThe bounds where the projection is valid
- -
- - -
-

Defined projections

- -
- - - -
Leaflet comes with a set of already defined Projections out of the box:
- - - - - - - - - - - - - - - - - - - - - - -
ProjectionDescription
L.Projection.LonLatEquirectangular, or Plate Carree projection — the most simple projection, -mostly used by GIS enthusiasts. Directly maps x as longitude, and y as -latitude. Also suitable for flat worlds, e.g. game maps. Used by the -EPSG:3395 and Simple CRS.
L.Projection.MercatorElliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
L.Projection.SphericalMercatorSpherical Mercator projection — the most common projection for online maps, -used by almost all free and commercial tile providers. Assumes that Earth is -a sphere. Used by the EPSG:3857 CRS.
- -
- - -

CRS

-

Abstract class that defines coordinate reference systems for projecting -geographical points into pixel (screen) coordinates and back (and to -coordinates in other units for WMS services). See -spatial reference system. -Leaflet defines the most usual CRSs by default. If you want to use a -CRS not defined by default, take a look at the -Proj4Leaflet plugin.

- -
-

Methods

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
latLngToPoint(<LatLng> latlng, <Number> zoom)Point -

Projects geographical coordinates into pixel coordinates for a given zoom.

-
pointToLatLng(<Point> point, <Number> zoom)LatLng -

The inverse of latLngToPoint. Projects pixel coordinates on a given -zoom into geographical coordinates.

-
project(<LatLng> latlng)Point -

Projects geographical coordinates into coordinates in units accepted for -this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).

-
unproject(<Point> point)LatLng -

Given a projected coordinate returns the corresponding LatLng. -The inverse of project.

-
scale(<Number> zoom)Number -

Returns the scale used when transforming projected coordinates into -pixel coordinates for a particular zoom. For example, it returns -256 * 2^zoom for Mercator-based CRS.

-
zoom(<Number> scale)Number -

Inverse of scale(), returns the zoom level corresponding to a scale -factor of scale.

-
getProjectedBounds(<Number> zoom)Bounds -

Returns the projection's bounds scaled and transformed for the provided zoom.

-
distance(<LatLng> latlng1, <LatLng> latlng2)Number -

Returns the distance between two geographical coordinates.

-
wrapLatLng(<LatLng> latlng)LatLng -

Returns a LatLng where lat and lng has been wrapped according to the -CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.

-
- -
- - -
-

Properties

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
code - StringStandard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')
wrapLng - Number[]An array of two numbers defining whether the longitude (horizontal) coordinate -axis wraps around a given range and how. Defaults to [-180, 180] in most -geographical CRSs. If undefined, the longitude axis does not wrap around.
wrapLat - Number[]Like wrapLng, but for the latitude (vertical) axis.
infinite - BooleanIf true, the coordinate space will be unbounded (infinite in both axes)
- -
- - -
-

Defined CRSs

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CRSDescription
L.CRS.EPSG3395Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
L.CRS.EPSG3857The most common CRS for online maps, used by almost all free and commercial -tile providers. Uses Spherical Mercator projection. Set in by default in -Map's crs option.
L.CRS.EPSG4326A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
L.CRS.EarthServes as the base for CRS that are global such that they cover the earth. -Can only be used as the base for other CRS and cannot be used directly, -since it does not have a code, projection or transformation. distance() returns -meters.
L.CRS.SimpleA simple CRS that maps longitude and latitude into x and y directly. -May be used for maps of flat surfaces (e.g. game maps). Note that the y -axis should still be inverted (going from bottom to top). distance() returns -simple euclidean distance.
- -
- - -

Renderer

-

Base class for vector renderer implementations (SVG, Canvas). Handles the -DOM container of the renderer, its bounds, and its zoom animation. -A Renderer works as an implicit layer group for all Paths - the renderer -itself can be added or removed to the map. All paths use a renderer, which can -be implicit (the map will decide the type of renderer and use it automatically) -or explicit (using the renderer option of the path). -Do not use this class directly, use SVG and Canvas instead.

- -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
padding -Number - 0.1How much to extend the clip area around the map view (relative to its size) -e.g. 0.1 would be 10% of map view in each direction
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
pane -String - 'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -
-
-
- -
-

Events

- -
- - - - - - - - - - - - - - - - - - - -
EventDataDescription
update - EventFired when the renderer updates its bounds, center and zoom, for example when -its map has moved
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Event objects

-

Whenever a class inheriting from Evented fires an event, a listener function -will be called with an event argument, which is a plain object containing -information about the event. For example:

-
map.on('click', function(ev) {
-    alert(ev.latlng); // ev is an event object (MouseEvent in this case)
-});
-
-

The information available depends on the event type:

- - - -
-

Event

- -
- - - -
The base event object. All other event objects contain these properties too.
- - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
- - -
- -
-

KeyboardEvent

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
originalEvent - DOMEventThe original DOM KeyboardEvent that triggered this Leaflet event.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

MouseEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
latlng - LatLngThe geographical point where the mouse event occured.
layerPoint - PointPixel coordinates of the point where the mouse event occured relative to the map layer.
containerPoint - PointPixel coordinates of the point where the mouse event occured relative to the map сontainer.
originalEvent - DOMEventThe original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

LocationEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
latlng - LatLngDetected geographical location of the user.
bounds - LatLngBoundsGeographical bounds of the area user is located in (with respect to the accuracy of location).
accuracy - NumberAccuracy of location in meters.
altitude - NumberHeight of the position above the WGS84 ellipsoid in meters.
altitudeAccuracy - NumberAccuracy of altitude in meters.
heading - NumberThe direction of travel in degrees counting clockwise from true North.
speed - NumberCurrent velocity in meters per second.
timestamp - NumberThe time when the position was acquired.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

ErrorEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
message - StringError message.
code - NumberError code (if applicable).
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

LayerEvent

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
layer - LayerThe layer that was added or removed.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

LayersControlEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
layer - LayerThe layer that was added or removed.
name - StringThe name of the layer that was added or removed.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

TileEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
tile - HTMLElementThe tile element (image).
coords - PointPoint object with the tile's x, y, and z (zoom level) coordinates.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

TileErrorEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
tile - HTMLElementThe tile element (image).
coords - PointPoint object with the tile's x, y, and z (zoom level) coordinates.
error - *Error passed to the tile's done() callback.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

ResizeEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
oldSize - PointThe old size before resize event.
newSize - PointThe new size after the resize event.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

GeoJSONEvent

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
layer - LayerThe layer for the GeoJSON feature that is being added to the map.
properties - ObjectGeoJSON properties of the feature.
geometryType - StringGeoJSON geometry type of the feature.
id - StringGeoJSON ID of the feature (if present).
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

PopupEvent

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
popup - PopupThe popup that was opened or closed.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

TooltipEvent

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
tooltip - TooltipThe tooltip that was opened or closed.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -
- -
-

DragEndEvent

- -
- - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
distance - NumberThe distance in pixels the draggable element was moved by.
- -
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
type - StringThe event type (e.g. 'click').
target - ObjectThe object that fired the event.
- -
-
-
- -

DivOverlay

-

Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.

- -
-

Options

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionTypeDefaultDescription
offset -Point - Point(0, 7)The offset of the popup position. Useful to control the anchor -of the popup when opening it on some overlays.
className -String - ''A custom CSS class name to assign to the popup.
pane -String - 'popupPane' -Map pane where the popup will be added.
- -
- - -
-

Events

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
add - EventFired after the layer is added to a map
remove - EventFired after the layer is removed from a map
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
popupopen - PopupEventFired when a popup bound to this layer is opened
popupclose - PopupEventFired when a popup bound to this layer is closed
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
EventDataDescription
tooltipopen - TooltipEventFired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventFired when a tooltip bound to this layer is closed.
- -
-
-
- -
-

Methods

- - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)this -

Adds the layer to the given map

-
remove()this -

Removes the layer from the map it is currently active on.

-
removeFrom(<Map> map)this -

Removes the layer from the given map

-
getPane(<String> name?)HTMLElement -

Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)this -

Binds a popup to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindPopup()this -

Removes the popup previously bound with bindPopup.

-
openPopup(<LatLng> latlng?)this -

Opens the bound popup at the specificed latlng or at the default popup anchor if no latlng is passed.

-
closePopup()this -

Closes the popup bound to this layer if it is open.

-
togglePopup()this -

Opens or closes the popup bound to this layer depending on its current state.

-
isPopupOpen()boolean -

Returns true if the popup bound to this layer is currently open.

-
setPopupContent(<String|HTMLElement|Popup> content)this -

Sets the content of the popup bound to this layer.

-
getPopup()Popup -

Returns the popup bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)this -

Binds a tooltip to the layer with the passed content and sets up the -neccessary event listeners. If a Function is passed it will receive -the layer as the first argument and should return a String or HTMLElement.

-
unbindTooltip()this -

Removes the tooltip previously bound with bindTooltip.

-
openTooltip(<LatLng> latlng?)this -

Opens the bound tooltip at the specificed latlng or at the default tooltip anchor if no latlng is passed.

-
closeTooltip()this -

Closes the tooltip bound to this layer if it is open.

-
toggleTooltip()this -

Opens or closes the tooltip bound to this layer depending on its current state.

-
isTooltipOpen()boolean -

Returns true if the tooltip bound to this layer is currently open.

-
setTooltipContent(<String|HTMLElement|Tooltip> content)this -

Sets the content of the tooltip bound to this layer.

-
getTooltip()Tooltip -

Returns the tooltip bound to this layer.

-
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
on(<String> type, <Function> fn, <Object> context?)this -

Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

-
on(<Object> eventMap)this -

Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

-
off(<String> type, <Function> fn?, <Object> context?)this -

Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

-
off(<Object> eventMap)this -

Removes a set of type/listener pairs.

-
off()this -

Removes all listeners to all events on the object.

-
fire(<String> type, <Object> data?, <Boolean> propagate?)this -

Fires an event of the specified type. You can optionally provide an data -object — the first argument of the listener function will contain its -properties. The event might can optionally be propagated to event parents.

-
listens(<String> type)Boolean -

Returns true if a particular event type has any listeners attached to it.

-
once()this -

Behaves as on(…), except the listener will only get fired once and then removed.

-
addEventParent(<Evented> obj)this -

Adds an event parent - an Evented that will receive propagated events

-
removeEventParent(<Evented> obj)this -

Removes an event parent, so it will stop receiving propagated events

-
addEventListener()this -

Alias to on(…)

-
removeEventListener()this -

Alias to off(…)

-
clearAllEventListeners()this -

Alias to off()

-
addOneTimeEventListener()this -

Alias to once(…)

-
fireEvent()this -

Alias to fire(…)

-
hasEventListeners()Boolean -

Alias to listens(…)

-
- -
-
-
- -

Global Switches

-

Global switches are created for rare cases and generally make -Leaflet to not detect a particular browser feature even if it's -there. You need to set the switch as a global variable to true -before including Leaflet on the page, like this:

-
<script>L_NO_TOUCH = true;</script>
-<script src="leaflet.js"></script>
-
- - - - - - - - - - - - - - - - - -
SwitchDescription
L_NO_TOUCHForces Leaflet to not use touch events even if it detects them.
L_DISABLE_3DForces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
- -

noConflict

-

This method restores the L global variable to the original value -it had before Leaflet inclusion, and returns the real Leaflet -namespace so you can put it elsewhere, like this:

-
<script src='libs/l.js'>
-<!-- L points to some other library -->
-<script src='leaflet.js'>
-<!-- you include Leaflet, it replaces the L variable to Leaflet namespace -->
-<script>
-var Leaflet = L.noConflict();
-// now L points to that other library again, and you can use Leaflet.Map etc.
-</script>
-
- -

version

-

A constant that represents the Leaflet version in use.

-
L.version; // contains "1.0.0" (or whatever version is currently in use)
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - diff --git a/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.3.4.html b/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.4.0.html similarity index 85% rename from dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.3.4.html rename to dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.4.0.html index 28d9ba9..4d9a16d 100644 --- a/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.3.4.html +++ b/dist/leaflet.docset/Contents/Resources/Documents/leafletjs.com/reference-1.4.0.html @@ -54,80 +54,80 @@

an open-source JavaScript library
for mobile-friendly in

Leaflet API reference

-

This reference reflects Leaflet 1.3.4. Check this list if you are using a different version of Leaflet.

+

This reference reflects Leaflet 1.4.0. Check this list if you are using a different version of Leaflet.

@@ -139,41 +139,41 @@

Controls

Utility

DOM Utility

@@ -258,8 +258,8 @@

Options

Boolean false - Whether Paths should be rendered on a Canvas renderer. -By default, all Paths are rendered in a SVG renderer. + Whether Paths should be rendered on a Canvas renderer. +By default, all Paths are rendered in a SVG renderer. @@ -285,7 +285,7 @@

Control options

Boolean true - Whether a attribution control is added to the map by default. + Whether a attribution control is added to the map by default. zoomControl @@ -293,7 +293,7 @@

Control options

Boolean true - Whether a zoom control is added to the map by default. + Whether a zoom control is added to the map by default. @@ -356,7 +356,7 @@

Interaction Options

1 Forces the map's zoom level to always be a multiple of this, particularly -right after a fitBounds() or a pinch-zoom. +right after a fitBounds() or a pinch-zoom. By default, the zoom level snaps to the nearest integer; lower values (e.g. 0.5 or 0.1) allow for greater granularity. A value of 0 means the zoom level will not be snapped after fitBounds or a pinch-zoom. @@ -368,8 +368,8 @@

Interaction Options

1 Controls how much the map's zoom level will change after a -zoomIn(), zoomOut(), pressing + -or - on the keyboard, or using the zoom controls. +zoomIn(), zoomOut(), pressing + +or - on the keyboard, or using the zoom controls. Values smaller than 1 (e.g. 0.5) allow for greater granularity. @@ -532,7 +532,7 @@

Mousewheel options

Number 60 - How many scroll pixels (as reported by L.DomEvent.getWheelDelta) + How many scroll pixels (as reported by L.DomEvent.getWheelDelta) mean a change of one full zoom level. Smaller values will make wheel-zooming faster (and vice versa). @@ -613,16 +613,16 @@

Map State Options

crs -CRS +CRS L.CRS.EPSG3857 - The Coordinate Reference System to use. Don't change this if you're not + The Coordinate Reference System to use. Don't change this if you're not sure what it means. center -LatLng +LatLng undefined Initial geographic center of the map @@ -642,7 +642,7 @@

Map State Options

* Minimum zoom level of the map. -If not specified and at least one GridLayer or TileLayer is in the map, +If not specified and at least one GridLayer or TileLayer is in the map, the lowest of their minZoom options will be used instead. @@ -652,7 +652,7 @@

Map State Options

* Maximum zoom level of the map. -If not specified and at least one GridLayer or TileLayer is in the map, +If not specified and at least one GridLayer or TileLayer is in the map, the highest of their maxZoom options will be used instead. @@ -666,22 +666,22 @@

Map State Options

maxBounds -LatLngBounds +LatLngBounds null When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back if the user tries to pan outside the view. To set the restriction dynamically, use -setMaxBounds method. +setMaxBounds method. renderer -Renderer +Renderer * - The default method for drawing vector layers on the map. L.SVG -or L.Canvas by default depending on browser support. + The default method for drawing vector layers on the map. L.SVG +or L.Canvas by default depending on browser support. @@ -772,31 +772,31 @@

Layer events

baselayerchange - LayersControlEvent - Fired when the base layer is changed through the layer control. + LayersControlEvent + Fired when the base layer is changed through the layer control. overlayadd - LayersControlEvent - Fired when an overlay is selected through the layer control. + LayersControlEvent + Fired when an overlay is selected through the layer control. overlayremove - LayersControlEvent - Fired when an overlay is deselected through the layer control. + LayersControlEvent + Fired when an overlay is deselected through the layer control. layeradd - LayerEvent + LayerEvent Fired when a new layer is added to the map. layerremove - LayerEvent + LayerEvent Fired when some layer is removed from the map @@ -820,72 +820,72 @@

Map state change events

zoomlevelschange - Event + Event Fired when the number of zoomlevels on the map is changed due to adding or removing a layer. resize - ResizeEvent + ResizeEvent Fired when the map is resized. unload - Event - Fired when the map is destroyed with remove method. + Event + Fired when the map is destroyed with remove method. viewreset - Event + Event Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays. load - Event + Event Fired when the map is initialized (when its center and zoom are set for the first time). zoomstart - Event + Event Fired when the map zoom is about to change (e.g. before zoom animation). movestart - Event + Event Fired when the view of the map starts changing (e.g. user starts dragging the map). zoom - Event + Event Fired repeatedly during any change in zoom level, including zoom and fly animations. move - Event + Event Fired repeatedly during any movement of the map, including pan and fly animations. zoomend - Event + Event Fired when the map has changed, after any animations. moveend - Event + Event Fired when the center of the map stops changing (e.g. user stopped dragging the map). @@ -909,19 +909,19 @@

Popup events

popupopen - PopupEvent + PopupEvent Fired when a popup is opened in the map popupclose - PopupEvent + PopupEvent Fired when a popup in the map is closed autopanstart - Event + Event Fired when the map starts autopanning when opening a popup. @@ -944,13 +944,13 @@

Tooltip events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip is opened in the map. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip in the map is closed. @@ -973,14 +973,14 @@

Location events

locationerror - ErrorEvent - Fired when geolocation (using the locate method) failed. + ErrorEvent + Fired when geolocation (using the locate method) failed. locationfound - LocationEvent - Fired when geolocation (using the locate method) + LocationEvent + Fired when geolocation (using the locate method) went successfully. @@ -1003,49 +1003,49 @@

Interaction events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the map. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the map. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the map. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button on the map. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the map. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the map. mousemove - MouseEvent + MouseEvent Fired while the mouse moves over the map. contextmenu - MouseEvent + MouseEvent Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -1054,13 +1054,13 @@

Interaction events

keypress - KeyboardEvent + KeyboardEvent Fired when the user presses a key from the keyboard while the map is focused. preclick - MouseEvent + MouseEvent Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running). @@ -1085,8 +1085,8 @@

Other Methods

zoomanim - ZoomAnimEvent - Fired on every frame of a zoom animation + ZoomAnimEvent + Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom. @@ -1113,11 +1113,11 @@

Methods

- getRenderer(<Path> layer) - Renderer + getRenderer(<Path> layer) + Renderer -

Returns the instance of Renderer that should be used to render the given -Path. It will ensure that the renderer options of the map and paths +

Returns the instance of Renderer that should be used to render the given +Path. It will ensure that the renderer options of the map and paths are respected, and that the renderers do exist on the map.

@@ -1140,35 +1140,35 @@

Methods for Layers and Controls

- addControl(<Control> control) + addControl(<Control> control) this

Adds the given control to the map

- removeControl(<Control> control) + removeControl(<Control> control) this

Removes the given control from the map

- addLayer(<Layer> layer) + addLayer(<Layer> layer) this

Adds the given layer to the map

- removeLayer(<Layer> layer) + removeLayer(<Layer> layer) this

Removes the given layer from the map.

- hasLayer(<Layer> layer) + hasLayer(<Layer> layer) Boolean

Returns true if the given layer is currently added to the map

@@ -1186,42 +1186,42 @@

Methods for Layers and Controls

- openPopup(<Popup> popup) + openPopup(<Popup> popup) this

Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).

- openPopup(<String|HTMLElement> content, <LatLng> latlng, <Popup options> options?) + openPopup(<String|HTMLElement> content, <LatLng> latlng, <Popup options> options?) this

Creates a popup with the specified content and options and opens it in the given point on a map.

- closePopup(<Popup> popup?) + closePopup(<Popup> popup?) this -

Closes the popup previously opened with openPopup (or the given one).

+

Closes the popup previously opened with openPopup (or the given one).

- openTooltip(<Tooltip> tooltip) + openTooltip(<Tooltip> tooltip) this

Opens the specified tooltip.

- openTooltip(<String|HTMLElement> content, <LatLng> latlng, <Tooltip options> options?) + openTooltip(<String|HTMLElement> content, <LatLng> latlng, <Tooltip options> options?) this

Creates a tooltip with the specified content and options and open it.

- closeTooltip(<Tooltip> tooltip?) + closeTooltip(<Tooltip> tooltip?) this

Closes the tooltip given as parameter.

@@ -1245,7 +1245,7 @@

Methods for modifying map state

- setView(<LatLng> center, <Number> zoom, <Zoom/pan options> options?) + setView(<LatLng> center, <Number> zoom, <Zoom/pan options> options?) this

Sets the view of the map (geographical center and zoom) with the given @@ -1253,28 +1253,28 @@

Methods for modifying map state

- setZoom(<Number> zoom, <Zoom/pan options> options?) + setZoom(<Number> zoom, <Zoom/pan options> options?) this

Sets the zoom of the map.

- zoomIn(<Number> delta?, <Zoom options> options?) + zoomIn(<Number> delta?, <Zoom options> options?) this -

Increases the zoom of the map by delta (zoomDelta by default).

+

Increases the zoom of the map by delta (zoomDelta by default).

- zoomOut(<Number> delta?, <Zoom options> options?) + zoomOut(<Number> delta?, <Zoom options> options?) this -

Decreases the zoom of the map by delta (zoomDelta by default).

+

Decreases the zoom of the map by delta (zoomDelta by default).

- setZoomAround(<LatLng> latlng, <Number> zoom, <Zoom options> options) + setZoomAround(<LatLng> latlng, <Number> zoom, <Zoom options> options) this

Zooms the map while keeping a specified geographical point on the map @@ -1282,14 +1282,14 @@

Methods for modifying map state

- setZoomAround(<Point> offset, <Number> zoom, <Zoom options> options) + setZoomAround(<Point> offset, <Number> zoom, <Zoom options> options) this

Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.

- fitBounds(<LatLngBounds> bounds, <fitBounds options> options?) + fitBounds(<LatLngBounds> bounds, <fitBounds options> options?) this

Sets a map view that contains the given geographical bounds with the @@ -1297,7 +1297,7 @@

Methods for modifying map state

- fitWorld(<fitBounds options> options?) + fitWorld(<fitBounds options> options?) this

Sets a map view that mostly contains the whole world with the maximum @@ -1305,21 +1305,21 @@

Methods for modifying map state

- panTo(<LatLng> latlng, <Pan options> options?) + panTo(<LatLng> latlng, <Pan options> options?) this

Pans the map to a given center.

- panBy(<Point> offset, <Pan options> options?) + panBy(<Point> offset, <Pan options> options?) this

Pans the map by a given number of pixels (animated).

- flyTo(<LatLng> latlng, <Number> zoom?, <Zoom/pan options> options?) + flyTo(<LatLng> latlng, <Number> zoom?, <Zoom/pan options> options?) this

Sets the view of the map (geographical center and zoom) performing a smooth @@ -1327,43 +1327,54 @@

Methods for modifying map state

- flyToBounds(<LatLngBounds> bounds, <fitBounds options> options?) + flyToBounds(<LatLngBounds> bounds, <fitBounds options> options?) this -

Sets the view of the map with a smooth animation like flyTo, -but takes a bounds parameter like fitBounds.

+

Sets the view of the map with a smooth animation like flyTo, +but takes a bounds parameter like fitBounds.

- setMaxBounds(<Bounds> bounds) + setMaxBounds(<Bounds> bounds) this -

Restricts the map view to the given bounds (see the maxBounds option).

+

Restricts the map view to the given bounds (see the maxBounds option).

setMinZoom(<Number> zoom) this -

Sets the lower limit for the available zoom levels (see the minZoom option).

+

Sets the lower limit for the available zoom levels (see the minZoom option).

setMaxZoom(<Number> zoom) this -

Sets the upper limit for the available zoom levels (see the maxZoom option).

+

Sets the upper limit for the available zoom levels (see the maxZoom option).

- panInsideBounds(<LatLngBounds> bounds, <Pan options> options?) + panInsideBounds(<LatLngBounds> bounds, <Pan options> options?) this

Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.

+ + + + panInside(<LatLng> latlng, <options> options?) + this + +

Pans the map the minimum amount to make the latlng visible. Use +padding, paddingTopLeft and paddingTopRight options to fit +the display to more restricted bounds, like fitBounds. +If latlng is already within the (optionally padded) display bounds, +the map will not be panned.

- invalidateSize(<Zoom/pan options> options) + invalidateSize(<Zoom/pan options> options) this

Checks if the map container size changed and updates the map if so — @@ -1408,16 +1419,16 @@

Geolocation methods

- locate(<Locate options> options?) + locate(<Locate options> options?) this -

Tries to locate the user using the Geolocation API, firing a locationfound -event with location data on success or a locationerror event on failure, +

Tries to locate the user using the Geolocation API, firing a locationfound +event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). Note that, if your page doesn't use HTTPS, this method will fail in modern browsers (Chrome 50 and newer) -See Locate options for more details.

+See Locate options for more details.

@@ -1450,7 +1461,7 @@

Other Methods

addHandler(<String> name, <Function> HandlerClass) this -

Adds a new Handler to the map, given its name and constructor function.

+

Adds a new Handler to the map, given its name and constructor function.

@@ -1464,7 +1475,7 @@

Other Methods

createPane(<String> name, <HTMLElement> container?) HTMLElement -

Creates a new map pane with the given name if it doesn't exist already, +

Creates a new map pane with the given name if it doesn't exist already, then returns it. The pane is created as a child of container, or as a child of the main map pane if not set.

@@ -1473,14 +1484,14 @@

Other Methods

getPane(<String|HTMLElement> pane) HTMLElement -

Returns a map pane, given its name or its HTML element (its identity).

+

Returns a map pane, given its name or its HTML element (its identity).

getPanes() Object -

Returns a plain object containing the names of all panes as keys and +

Returns a plain object containing the names of all panes as keys and the panes as values.

@@ -1519,7 +1530,7 @@

Methods for Getting Map State

getCenter() - LatLng + LatLng

Returns the geographical center of the map view

@@ -1533,7 +1544,7 @@

Methods for Getting Map State

getBounds() - LatLngBounds + LatLngBounds

Returns the geographical bounds visible in the current map view

@@ -1553,7 +1564,7 @@

Methods for Getting Map State

- getBoundsZoom(<LatLngBounds> bounds, <Boolean> inside?, <Point> padding?) + getBoundsZoom(<LatLngBounds> bounds, <Boolean> inside?, <Point> padding?) Number

Returns the maximum zoom level on which the given bounds fit to the map @@ -1564,14 +1575,14 @@

Methods for Getting Map State

getSize() - Point + Point

Returns the current size of the map container (in pixels).

getPixelBounds() - Bounds + Bounds

Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).

@@ -1579,7 +1590,7 @@

Methods for Getting Map State

getPixelOrigin() - Point + Point

Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).

@@ -1587,7 +1598,7 @@

Methods for Getting Map State

getPixelWorldBounds(<Number> zoom?) - Bounds + Bounds

Returns the world's bounds in pixel coordinates for zoom level zoom. If zoom is omitted, the map's current zoom level is used.

@@ -1624,47 +1635,47 @@

Conversion Methods

Returns the zoom level that the map would end up at, if it is at fromZoom level and everything is scaled by a factor of scale. Inverse of -getZoomScale.

+getZoomScale.

- project(<LatLng> latlng, <Number> zoom) - Point + project(<LatLng> latlng, <Number> zoom) + Point -

Projects a geographical coordinate LatLng according to the projection +

Projects a geographical coordinate LatLng according to the projection of the map's CRS, then scales it according to zoom and the CRS's -Transformation. The result is pixel coordinate relative to +Transformation. The result is pixel coordinate relative to the CRS origin.

- unproject(<Point> point, <Number> zoom) - LatLng + unproject(<Point> point, <Number> zoom) + LatLng -

Inverse of project.

+

Inverse of project.

- layerPointToLatLng(<Point> point) - LatLng + layerPointToLatLng(<Point> point) + LatLng -

Given a pixel coordinate relative to the origin pixel, +

Given a pixel coordinate relative to the origin pixel, returns the corresponding geographical coordinate (for the current zoom level).

- latLngToLayerPoint(<LatLng> latlng) - Point + latLngToLayerPoint(<LatLng> latlng) + Point

Given a geographical coordinate, returns the corresponding pixel coordinate -relative to the origin pixel.

+relative to the origin pixel.

- wrapLatLng(<LatLng> latlng) - LatLng + wrapLatLng(<LatLng> latlng) + LatLng -

Returns a LatLng where lat and lng has been wrapped according to the +

Returns a LatLng where lat and lng has been wrapped according to the map's CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds. By default this means longitude is wrapped around the dateline so its @@ -1672,10 +1683,10 @@

Conversion Methods

- wrapLatLngBounds(<LatLngBounds> bounds) - LatLngBounds + wrapLatLngBounds(<LatLngBounds> bounds) + LatLngBounds -

Returns a LatLngBounds with the same size as the given one, ensuring that +

Returns a LatLngBounds with the same size as the given one, ensuring that its center is within the CRS's bounds. By default this means the center longitude is wrapped around the dateline so its value is between -180 and +180 degrees, and the majority of the bounds @@ -1683,7 +1694,7 @@

Conversion Methods

- distance(<LatLng> latlng1, <LatLng> latlng2) + distance(<LatLng> latlng1, <LatLng> latlng2) Number

Returns the distance between two geographical coordinates according to @@ -1691,56 +1702,56 @@

Conversion Methods

- containerPointToLayerPoint(<Point> point) - Point + containerPointToLayerPoint(<Point> point) + Point

Given a pixel coordinate relative to the map container, returns the corresponding -pixel coordinate relative to the origin pixel.

+pixel coordinate relative to the origin pixel.

- layerPointToContainerPoint(<Point> point) - Point + layerPointToContainerPoint(<Point> point) + Point -

Given a pixel coordinate relative to the origin pixel, +

Given a pixel coordinate relative to the origin pixel, returns the corresponding pixel coordinate relative to the map container.

- containerPointToLatLng(<Point> point) - LatLng + containerPointToLatLng(<Point> point) + LatLng

Given a pixel coordinate relative to the map container, returns the corresponding geographical coordinate (for the current zoom level).

- latLngToContainerPoint(<LatLng> latlng) - Point + latLngToContainerPoint(<LatLng> latlng) + Point

Given a geographical coordinate, returns the corresponding pixel coordinate relative to the map container.

- mouseEventToContainerPoint(<MouseEvent> ev) - Point + mouseEventToContainerPoint(<MouseEvent> ev) + Point

Given a MouseEvent object, returns the pixel coordinate relative to the map container where the event took place.

- mouseEventToLayerPoint(<MouseEvent> ev) - Point + mouseEventToLayerPoint(<MouseEvent> ev) + Point

Given a MouseEvent object, returns the pixel coordinate relative to -the origin pixel where the event took place.

+the origin pixel where the event took place.

- mouseEventToLatLng(<MouseEvent> ev) - LatLng + mouseEventToLatLng(<MouseEvent> ev) + LatLng

Given a MouseEvent object, returns geographical coordinate where the event took place.

@@ -1753,7 +1764,7 @@

Conversion Methods

- +
@@ -1824,18 +1835,18 @@

Conversion Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -1845,42 +1856,42 @@

Conversion Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -1909,9 +1920,9 @@

Controls

zoomControl - Control.Zoom + Control.Zoom The default zoom control (only available if the -zoomControl option was true when creating the map). +zoomControl option was true when creating the map). @@ -1933,43 +1944,43 @@

Handlers

boxZoom - Handler + Handler Box (shift-drag with mouse) zoom handler. doubleClickZoom - Handler + Handler Double click zoom handler. dragging - Handler + Handler Map dragging handler (by both mouse and touch). keyboard - Handler + Handler Keyboard navigation handler. scrollWheelZoom - Handler + Handler Scroll wheel zoom handler. tap - Handler + Handler Mobile touch hacks (quick tap and touch hold) handler. touchZoom - Handler + Handler Touch zoom handler. @@ -1987,9 +1998,9 @@

Map panes

Panes are DOM elements used to control the ordering of layers on the map. You -can access panes with map.getPane or -map.getPanes methods. New panes can be created with the -map.createPane method. +can access panes with map.getPane or +map.getPanes methods. New panes can be created with the +map.createPane method. Every map has the following default panes that differ only in zIndex.
@@ -2016,7 +2027,7 @@

Map panes

HTMLElement - + @@ -2024,7 +2035,7 @@

Map panes

HTMLElement - + @@ -2032,7 +2043,7 @@

Map panes

HTMLElement - + @@ -2040,7 +2051,7 @@

Map panes

HTMLElement - + @@ -2048,7 +2059,7 @@

Map panes

HTMLElement - + @@ -2056,7 +2067,7 @@

Map panes

HTMLElement - +
200Pane for GridLayers and TileLayersPane for GridLayers and TileLayers
overlayPane 400Pane for vectors (Paths, like Polylines and Polygons), ImageOverlays and VideoOverlaysPane for vectors (Paths, like Polylines and Polygons), ImageOverlays and VideoOverlays
shadowPane 500Pane for overlay shadows (e.g. Marker shadows)Pane for overlay shadows (e.g. Marker shadows)
markerPane 600Pane for Icons of MarkersPane for Icons of Markers
tooltipPane 650Pane for Tooltips.Pane for Tooltips.
popupPane 700Pane for Popups.Pane for Popups.
@@ -2073,7 +2084,7 @@

Locate options

-
Some of the geolocation methods for Map take in an options parameter. This +
Some of the geolocation methods for Map take in an options parameter. This is a plain javascript object with the following optional components:
@@ -2154,7 +2165,7 @@

Zoom options

-
Some of the Map methods which modify the zoom level take in an options +
Some of the Map methods which modify the zoom level take in an options parameter. This is a plain javascript object with the following optional components:
@@ -2194,7 +2205,7 @@

Pan options

-
Some of the Map methods which modify the center of the map take in an options +
Some of the Map methods which modify the center of the map take in an options parameter. This is a plain javascript object with the following optional components:
@@ -2261,7 +2272,7 @@

Zoom/pan options

- +
@@ -2297,7 +2308,7 @@

Zoom/pan options

- +
@@ -2371,7 +2382,7 @@

FitBounds options

@@ -2390,7 +2401,7 @@

FitBounds options

@@ -2410,7 +2421,7 @@

FitBounds options

- +
@@ -2446,7 +2457,7 @@

FitBounds options

- +
@@ -2498,7 +2509,7 @@

FitBounds options

Marker

-

L.Marker is used to display clickable/draggable icons on the map. Extends Layer.

+

L.Marker is used to display clickable/draggable icons on the map. Extends Layer.

Usage example

@@ -2534,7 +2545,7 @@

Creation

- + @@ -2564,12 +2575,12 @@

Options

+See Icon documentation for details on how to customize the marker icon. +If not specified, a common instance of L.Icon.Default is used. @@ -2643,7 +2654,7 @@

Options

+(unless L.DomEvent.stopPropagation is used).
paddingTopLeft -Point +Point [0, 0] Sets the amount of padding in the top left corner of a map container that @@ -2382,7 +2393,7 @@

FitBounds options

paddingBottomRight -Point +Point [0, 0] The same for the bottom right corner of the map.
padding -Point +Point [0, 0] Equivalent of setting both top left and bottom right padding to the same value.
L.marker(<LatLng> latlng, <Marker options> options?)L.marker(<LatLng> latlng, <Marker options> options?) Instantiates a Marker object given a geographical point and optionally an options object.
icon -Icon +Icon * Icon instance to use for rendering the marker. -See Icon documentation for details on how to customize the marker icon. -If not specified, a common instance of L.Icon.Default is used.
keyboard false When true, a mouse event on this marker will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used).
@@ -2682,7 +2693,7 @@

Draggable marker options

autoPanPadding -Point +Point Point(50, 50) Distance (in pixels to the left/right and to the top/bottom) of the @@ -2703,7 +2714,7 @@

Draggable marker options

- +
@@ -2736,7 +2747,7 @@

Draggable marker options

- +
@@ -2759,7 +2770,7 @@

Draggable marker options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -2775,7 +2786,7 @@

Events

-
In addition to shared layer methods like addTo() and remove() and popup methods like bindPopup() you can also use the following methods:
+
In addition to shared layer methods like addTo() and remove() and popup methods like bindPopup() you can also use the following methods:
@@ -2788,8 +2799,8 @@

Events

- + + @@ -2811,31 +2822,31 @@

Dragging events

+ + + + + @@ -2846,7 +2857,7 @@

Dragging events

- +
@@ -2864,43 +2875,43 @@

Dragging events

+ + + + + + + + + @@ -2951,7 +2962,7 @@

Dragging events

- +
@@ -2969,13 +2980,13 @@

Dragging events

+ + @@ -2987,7 +2998,7 @@

Dragging events

- +
@@ -3005,13 +3016,13 @@

Dragging events

+ + @@ -3043,18 +3054,18 @@

Methods

- + - + - + - + @@ -3147,7 +3158,7 @@

Methods

- +
@@ -3164,7 +3175,7 @@

Methods

- + - + @@ -3216,7 +3227,7 @@

Methods

- + @@ -3229,7 +3240,7 @@

Methods

- +
@@ -3246,7 +3257,7 @@

Methods

- + - + @@ -3298,7 +3309,7 @@

Methods

- + @@ -3311,7 +3322,7 @@

Methods

- +
@@ -3382,18 +3393,18 @@

Methods

- + - + @@ -3455,7 +3466,7 @@

Properties

Interaction handlers

-
Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see Handler methods). Example: +
Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see Handler methods). Example:
marker.dragging.disable();
 
@@ -3471,8 +3482,8 @@

Interaction handlers

- + + @@ -3482,9 +3493,9 @@

Interaction handlers

-

Used to open popups in certain places of the map. Use Map.openPopup to +

Used to open popups in certain places of the map. Use Map.openPopup to open popups while making sure that only one popup is open at one time -(recommended for usability), or use Map.addLayer to open as many as you want.

+(recommended for usability), or use Map.addLayer to open as many as you want.

@@ -3528,8 +3539,8 @@
- - + +
move - EventFired when the marker is moved via setLatLng or by dragging. Old and new coordinates are included in event arguments as oldLatLng, latlng.EventFired when the marker is moved via setLatLng or by dragging. Old and new coordinates are included in event arguments as oldLatLng, latlng.
dragstart - EventEvent Fired when the user starts dragging the marker.
movestart - EventEvent Fired when the marker starts moving (because of dragging).
drag - EventEvent Fired repeatedly while the user drags the marker.
dragend - DragEndEventDragEndEvent Fired when the user stops dragging the marker.
moveend - EventEvent Fired when the marker stops moving (because of dragging).
click - MouseEventMouseEvent Fired when the user clicks (or taps) the layer.
dblclick - MouseEventMouseEvent Fired when the user double-clicks (or double-taps) the layer.
mousedown - MouseEventMouseEvent Fired when the user pushes the mouse button on the layer.
mouseup - MouseEventMouseEvent Fired when the user releases the mouse button pushed on the layer.
mouseover - MouseEventMouseEvent Fired when the mouse enters the layer.
mouseout - MouseEventMouseEvent Fired when the mouse leaves the layer.
contextmenu - MouseEventMouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -2915,7 +2926,7 @@

Dragging events

- +
@@ -2933,13 +2944,13 @@

Dragging events

add - EventEvent Fired after the layer is added to a map
remove - EventEvent Fired after the layer is removed from a map
popupopen - PopupEventPopupEvent Fired when a popup bound to this layer is opened
popupclose - PopupEventPopupEvent Fired when a popup bound to this layer is closed
tooltipopen - TooltipEventTooltipEvent Fired when a tooltip bound to this layer is opened.
tooltipclose - TooltipEventTooltipEvent Fired when a tooltip bound to this layer is closed.
toGeoJSON() Object -

Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).

+

Returns a GeoJSON representation of the marker (as a GeoJSON Point Feature).

getLatLng()LatLngLatLng

Returns the current geographical position of the marker.

setLatLng(<LatLng> latlng)setLatLng(<LatLng> latlng) this

Changes the marker position to the given point.

@@ -3064,11 +3075,11 @@

Methods

setZIndexOffset(<Number> offset) this -

Changes the zIndex offset of the marker.

+

Changes the zIndex offset of the marker.

setIcon(<Icon> icon)setIcon(<Icon> icon) this

Changes the marker icon.

@@ -3088,7 +3099,7 @@

Methods

- +
@@ -3119,7 +3130,7 @@

Methods

removeFrom(<Map> map)removeFrom(<Map> map) this

Removes the layer from the given map

@@ -3136,7 +3147,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -3180,10 +3191,10 @@

Methods

openPopup(<LatLng> latlng?)openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

getPopup()PopupPopup

Returns the popup bound to this layer.

bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -3262,10 +3273,10 @@

Methods

openTooltip(<LatLng> latlng?)openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

getTooltip()TooltipTooltip

Returns the tooltip bound to this layer.

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

addEventParent(<Evented> obj)addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

removeEventParent(<Evented> obj)removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -3403,42 +3414,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

dragging - HandlerMarker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable).HandlerMarker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set marker.options.draggable).
@@ -3592,7 +3603,7 @@ autoPanPaddingTopLeft -Point +Point null The margin between the popup and the top left corner of the map @@ -3601,7 +3612,7 @@ autoPanPaddingBottomRight -Point +Point null The margin between the popup and the bottom right corner of the map @@ -3610,7 +3621,7 @@ autoPanPadding -Point +Point Point(5, 5) Equivalent of setting both top left and bottom right autopan padding to the same value. @@ -3657,7 +3668,7 @@ * Set it if you want to override the default behavior of the popup closing when user clicks -on the map. Defaults to the map's closePopupOnClick option. +on the map. Defaults to the map's closePopupOnClick option. className @@ -3674,7 +3685,7 @@
- +
@@ -3694,7 +3705,7 @@ offset -Point +Point Point(0, 7) The offset of the popup position. Useful to control the anchor @@ -3717,7 +3728,7 @@
- +
@@ -3740,7 +3751,7 @@ String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -3756,7 +3767,7 @@

Events

- +
@@ -3774,13 +3785,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -3792,7 +3803,7 @@

Events

- +
@@ -3810,13 +3821,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -3828,7 +3839,7 @@

Events

- +
@@ -3846,13 +3857,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -3882,13 +3893,13 @@ getLatLng() - LatLng + LatLng

Returns the geographical point of popup.

- setLatLng(<LatLng> latlng) + setLatLng(<LatLng> latlng) this

Sets the geographical point where the popup will open.

@@ -3912,7 +3923,7 @@ getElement() String|HTMLElement -

Alias for getContent()

+

Alias for getContent()

@@ -3944,7 +3955,7 @@ - openOn(<Map> map) + openOn(<Map> map) this

Adds the popup to the map and closes the previous one. The same as map.openPopup(popup).

@@ -3957,7 +3968,7 @@
- +
@@ -3988,7 +3999,7 @@ - removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -4005,7 +4016,7 @@ getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -4016,7 +4027,7 @@
- +
@@ -4033,7 +4044,7 @@ - bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -4049,10 +4060,10 @@

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -4085,7 +4096,7 @@ getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -4098,7 +4109,7 @@
- +
@@ -4115,7 +4126,7 @@ - bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -4131,10 +4142,10 @@

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -4167,7 +4178,7 @@ getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -4180,7 +4191,7 @@
- +
@@ -4251,18 +4262,18 @@ once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -4272,42 +4283,42 @@ addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -4363,7 +4374,7 @@

Creation

- L.tooltip(<Tooltip options> options?, <Layer> source?) + L.tooltip(<Tooltip options> options?, <Layer> source?) Instantiates a Tooltip object given an optional options object that describes its appearance and location and an optional source object that is used to tag the tooltip with a reference to the Layer to which it refers. @@ -4402,7 +4413,7 @@

Options

offset -Point +Point Point(0, 0) Optional offset of the tooltip position. @@ -4457,7 +4468,7 @@

Options

- +
@@ -4490,7 +4501,7 @@

Options

- +
@@ -4513,7 +4524,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -4529,7 +4540,7 @@

Events

- +
@@ -4547,13 +4558,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -4565,7 +4576,7 @@

Events

- +
@@ -4583,13 +4594,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -4601,7 +4612,7 @@

Events

- +
@@ -4619,13 +4630,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -4643,7 +4654,7 @@

Methods

- +
@@ -4674,7 +4685,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -4691,7 +4702,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -4702,7 +4713,7 @@

Methods

- +
@@ -4719,7 +4730,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -4735,10 +4746,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -4771,7 +4782,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -4784,7 +4795,7 @@

Methods

- +
@@ -4801,7 +4812,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -4817,10 +4828,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -4853,7 +4864,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -4866,7 +4877,7 @@

Methods

- +
@@ -4937,18 +4948,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -4958,42 +4969,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -5004,7 +5015,7 @@

Methods

TileLayer

-

Used to load and display tile layers on the map. Extends GridLayer.

+

Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under Layer. Extends GridLayer.

Usage example

@@ -5015,7 +5026,7 @@

Usage example

-
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(map);
 
@@ -5030,7 +5041,7 @@

URL template

'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'
 

{s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates. {r} can be used to add "&commat;2x" to the URL to load retina tiles. -You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

+You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
 
@@ -5055,7 +5066,7 @@

Extension methods

- L.tilelayer(<String> urlTemplate, <TileLayer options> options?) + L.tilelayer(<String> urlTemplate, <TileLayer options> options?) Instantiates a tile layer object given a URL template and optionally an options object. @@ -5163,7 +5174,7 @@

Options

- +
@@ -5205,7 +5216,7 @@

Options

Load new tiles only when panning ends. true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation. false otherwise in order to display new tiles during panning, since it is easy to pan outside the -keepBuffer option in desktop browsers. +keepBuffer option in desktop browsers. updateWhenZooming @@ -5213,7 +5224,7 @@

Options

Boolean true - By default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends. + By default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends. updateInterval @@ -5234,10 +5245,10 @@

Options

bounds -LatLngBounds +LatLngBounds undefined - If set, tiles will only be loaded inside the set LatLngBounds. + If set, tiles will only be loaded inside the set LatLngBounds. maxNativeZoom @@ -5267,8 +5278,8 @@

Options

false Whether the layer is wrapped around the antimeridian. If true, the GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around. Can be used -in combination with bounds to prevent requesting +effect when the map CRS doesn't wrap around. Can be used +in combination with bounds to prevent requesting tiles outside the CRS limits. @@ -5304,7 +5315,7 @@

Options

- +
@@ -5327,7 +5338,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -5343,7 +5354,7 @@

Events

- +
@@ -5361,37 +5372,37 @@

Events

loading - Event + Event Fired when the grid layer starts loading tiles. tileunload - TileEvent + TileEvent Fired when a tile is removed (e.g. when a tile goes off the screen). tileloadstart - TileEvent + TileEvent Fired when a tile is requested and starts loading. tileerror - TileErrorEvent + TileErrorEvent Fired when there is an error loading a tile. tileload - TileEvent + TileEvent Fired when a tile loads. load - Event + Event Fired when the grid layer loaded all visible tiles. @@ -5403,7 +5414,7 @@

Events

- +
@@ -5421,13 +5432,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -5439,7 +5450,7 @@

Events

- +
@@ -5457,13 +5468,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -5475,7 +5486,7 @@

Events

- +
@@ -5493,13 +5504,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -5531,14 +5542,16 @@

Methods

setUrl(<String> url, <Boolean> noRedraw?) this -

Updates the layer's URL template and redraws it (unless noRedraw is set to true).

+

Updates the layer's URL template and redraws it (unless noRedraw is set to true). +If the URL does not change, the layer will not be redrawn unless +the noRedraw parameter is set to false.

createTile(<Object> coords, <Function> done?) HTMLElement -

Called only internally, overrides GridLayer's createTile() +

Called only internally, overrides GridLayer's createTile() to return an <img> HTML element with the appropriate image URL given coords. The done callback is called when the tile has been loaded.

@@ -5550,7 +5563,7 @@

Methods

Extension methods

-
Layers extending TileLayer might reimplement the following method.
+
Layers extending TileLayer might reimplement the following method.
@@ -5566,7 +5579,7 @@

Extension methods

@@ -5576,7 +5589,7 @@

Extension methods

- +
@@ -5617,14 +5630,14 @@

Extension methods

@@ -5643,9 +5656,9 @@

Extension methods

- + @@ -5656,7 +5669,7 @@

Extension methods

- +
@@ -5687,7 +5700,7 @@

Extension methods

- + @@ -5715,7 +5728,7 @@

Extension methods

- +
@@ -5732,7 +5745,7 @@

Extension methods

- + - + @@ -5784,7 +5797,7 @@

Extension methods

- + @@ -5797,7 +5810,7 @@

Extension methods

- +
@@ -5814,7 +5827,7 @@

Extension methods

- + - + @@ -5866,7 +5879,7 @@

Extension methods

- + @@ -5879,7 +5892,7 @@

Extension methods

- +
@@ -5950,18 +5963,18 @@

Extension methods

- + - + @@ -6017,7 +6030,7 @@

Extension methods

TileLayer.WMS

-

Used to display WMS services as tile layers on the map. Extends TileLayer.

+

Used to display WMS services as tile layers on the map. Extends TileLayer.

Usage example

@@ -6058,7 +6071,7 @@

Creation

- + @@ -6132,7 +6145,7 @@

Options

+keepBuffer option in desktop browsers. @@ -6302,7 +6315,7 @@

Options

Boolean - + @@ -6323,10 +6336,10 @@

Options

- + @@ -6356,8 +6369,8 @@

Options

@@ -6393,7 +6406,7 @@

Options

- +
@@ -6416,7 +6429,7 @@

Options

String
- +
String

Called only internally, returns the URL for a tile given its coordinates. -Classes extending TileLayer can override this function to provide custom tile URL naming schemes.

+Classes extending TileLayer can override this function to provide custom tile URL naming schemes.

setOpacity(<Number> opacity) this -

Changes the opacity of the grid layer.

+

Changes the opacity of the grid layer.

setZIndex(<Number> zIndex) this -

Changes the zIndex of the grid layer.

+

Changes the zIndex of the grid layer.

getTileSize()PointPoint -

Normalizes the tileSize option into a point. Used by the createTile() method.

+

Normalizes the tileSize option into a point. Used by the createTile() method.

removeFrom(<Map> map)removeFrom(<Map> map) this

Removes the layer from the given map

@@ -5704,7 +5717,7 @@

Extension methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -5748,10 +5761,10 @@

Extension methods

openPopup(<LatLng> latlng?)openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

getPopup()PopupPopup

Returns the popup bound to this layer.

bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -5830,10 +5843,10 @@

Extension methods

openTooltip(<LatLng> latlng?)openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

getTooltip()TooltipTooltip

Returns the tooltip bound to this layer.

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

addEventParent(<Evented> obj)addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

removeEventParent(<Evented> obj)removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -5971,42 +5984,42 @@

Extension methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

L.tileLayer.wms(<String> baseUrl, <TileLayer.WMS options> options)L.tileLayer.wms(<String> baseUrl, <TileLayer.WMS options> options) Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
crs -CRS +CRS null Coordinate Reference System to use for the WMS requests, defaults to @@ -6153,7 +6166,7 @@

Options

- +
@@ -6252,7 +6265,7 @@

Options

- +
@@ -6294,7 +6307,7 @@

Options

Load new tiles only when panning ends. true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation. false otherwise in order to display new tiles during panning, since it is easy to pan outside the -keepBuffer option in desktop browsers.
updateWhenZooming trueBy default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.By default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends.
updateInterval
bounds -LatLngBounds +LatLngBounds undefinedIf set, tiles will only be loaded inside the set LatLngBounds.If set, tiles will only be loaded inside the set LatLngBounds.
maxNativeZoom false Whether the layer is wrapped around the antimeridian. If true, the GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around. Can be used -in combination with bounds to prevent requesting +effect when the map CRS doesn't wrap around. Can be used +in combination with bounds to prevent requesting tiles outside the CRS limits.
nullString to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
@@ -6432,7 +6445,7 @@

Events

- +
@@ -6450,37 +6463,37 @@

Events

loading - Event + Event Fired when the grid layer starts loading tiles. tileunload - TileEvent + TileEvent Fired when a tile is removed (e.g. when a tile goes off the screen). tileloadstart - TileEvent + TileEvent Fired when a tile is requested and starts loading. tileerror - TileErrorEvent + TileErrorEvent Fired when there is an error loading a tile. tileload - TileEvent + TileEvent Fired when a tile loads. load - Event + Event Fired when the grid layer loaded all visible tiles. @@ -6492,7 +6505,7 @@

Events

- +
@@ -6510,13 +6523,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -6528,7 +6541,7 @@

Events

- +
@@ -6546,13 +6559,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -6564,7 +6577,7 @@

Events

- +
@@ -6582,13 +6595,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -6630,7 +6643,7 @@

Methods

- +
@@ -6650,14 +6663,16 @@

Methods

setUrl(<String> url, <Boolean> noRedraw?) this -

Updates the layer's URL template and redraws it (unless noRedraw is set to true).

+

Updates the layer's URL template and redraws it (unless noRedraw is set to true). +If the URL does not change, the layer will not be redrawn unless +the noRedraw parameter is set to false.

createTile(<Object> coords, <Function> done?) HTMLElement -

Called only internally, overrides GridLayer's createTile() +

Called only internally, overrides GridLayer's createTile() to return an <img> HTML element with the appropriate image URL given coords. The done callback is called when the tile has been loaded.

@@ -6670,7 +6685,7 @@

Methods

- +
@@ -6711,14 +6726,14 @@

Methods

setOpacity(<Number> opacity) this -

Changes the opacity of the grid layer.

+

Changes the opacity of the grid layer.

setZIndex(<Number> zIndex) this -

Changes the zIndex of the grid layer.

+

Changes the zIndex of the grid layer.

@@ -6737,9 +6752,9 @@

Methods

getTileSize() - Point + Point -

Normalizes the tileSize option into a point. Used by the createTile() method.

+

Normalizes the tileSize option into a point. Used by the createTile() method.

@@ -6750,7 +6765,7 @@

Methods

- +
@@ -6781,7 +6796,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -6798,7 +6813,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -6809,7 +6824,7 @@

Methods

- +
@@ -6826,7 +6841,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -6842,10 +6857,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -6878,7 +6893,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -6891,7 +6906,7 @@

Methods

- +
@@ -6908,7 +6923,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -6924,10 +6939,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -6960,7 +6975,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -6973,7 +6988,7 @@

Methods

- +
@@ -7044,18 +7059,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -7065,42 +7080,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -7111,7 +7126,7 @@

Methods

ImageOverlay

-

Used to load and display a single image over specific bounds of the map. Extends Layer.

+

Used to load and display a single image over specific bounds of the map. Extends Layer.

Usage example

@@ -7149,7 +7164,7 @@

Creation

- L.imageOverlay(<String> imageUrl, <LatLngBounds> bounds, <ImageOverlay options> options?) + L.imageOverlay(<String> imageUrl, <LatLngBounds> bounds, <ImageOverlay options> options?) Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to. @@ -7199,7 +7214,7 @@

Options

Boolean false - If true, the image overlay will emit mouse events when clicked or hovered. + If true, the image overlay will emit mouse events when clicked or hovered. crossOrigin @@ -7242,7 +7257,7 @@

Options

- +
@@ -7266,7 +7281,7 @@

Options

true When true, a mouse event on this layer will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). @@ -7276,7 +7291,7 @@

Options

- +
@@ -7299,7 +7314,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -7307,7 +7322,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -7335,13 +7350,13 @@

Events

load - Event + Event Fired when the ImageOverlay layer has loaded its image error - Event + Event Fired when the ImageOverlay layer fails to load its image @@ -7352,7 +7367,7 @@

Events

- +
@@ -7370,43 +7385,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -7421,7 +7436,7 @@

Events

- +
@@ -7439,13 +7454,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -7457,7 +7472,7 @@

Events

- +
@@ -7475,13 +7490,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -7493,7 +7508,7 @@

Events

- +
@@ -7511,13 +7526,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -7574,7 +7589,7 @@

Methods

- setBounds(<LatLngBounds> bounds) + setBounds(<LatLngBounds> bounds) this

Update the bounds that this ImageOverlay covers

@@ -7584,12 +7599,12 @@

Methods

setZIndex(<Number> value) this -

Changes the zIndex of the image overlay.

+

Changes the zIndex of the image overlay.

getBounds() - LatLngBounds + LatLngBounds

Get the bounds that this ImageOverlay covers

@@ -7609,7 +7624,7 @@

Methods

- +
@@ -7640,7 +7655,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -7657,7 +7672,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -7668,7 +7683,7 @@

Methods

- +
@@ -7685,7 +7700,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -7701,10 +7716,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -7737,7 +7752,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -7750,7 +7765,7 @@

Methods

- +
@@ -7767,7 +7782,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -7783,10 +7798,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -7819,7 +7834,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -7832,7 +7847,7 @@

Methods

- +
@@ -7903,18 +7918,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -7924,42 +7939,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -7970,7 +7985,7 @@

Methods

VideoOverlay

-

Used to load and display a video player over specific bounds of the map. Extends ImageOverlay. +

Used to load and display a video player over specific bounds of the map. Extends ImageOverlay. A video overlay uses the <video> HTML5 element.

@@ -8010,7 +8025,7 @@

Creation

- L.videoOverlay(<String|Array|HTMLVideoElement> video, <LatLngBounds> bounds, <VideoOverlay options> options?) + L.videoOverlay(<String|Array|HTMLVideoElement> video, <LatLngBounds> bounds, <VideoOverlay options> options?) Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the geographical bounds it is tied to. @@ -8061,7 +8076,7 @@

Options

- +
@@ -8100,7 +8115,7 @@

Options

Boolean false - If true, the image overlay will emit mouse events when clicked or hovered. + If true, the image overlay will emit mouse events when clicked or hovered. crossOrigin @@ -8144,7 +8159,7 @@

Options

- +
@@ -8168,7 +8183,7 @@

Options

true When true, a mouse event on this layer will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). @@ -8178,7 +8193,7 @@

Options

- +
@@ -8201,7 +8216,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -8209,7 +8224,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -8237,7 +8252,7 @@

Events

load - Event + Event Fired when the video has finished loading the first frame @@ -8248,7 +8263,7 @@

Events

- +
@@ -8266,7 +8281,7 @@

Events

error - Event + Event Fired when the ImageOverlay layer fails to load its image @@ -8278,7 +8293,7 @@

Events

- +
@@ -8296,43 +8311,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -8347,7 +8362,7 @@

Events

- +
@@ -8365,13 +8380,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -8383,7 +8398,7 @@

Events

- +
@@ -8401,13 +8416,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -8419,7 +8434,7 @@

Events

- +
@@ -8437,13 +8452,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -8486,7 +8501,7 @@

Methods

- +
@@ -8531,7 +8546,7 @@

Methods

- setBounds(<LatLngBounds> bounds) + setBounds(<LatLngBounds> bounds) this

Update the bounds that this ImageOverlay covers

@@ -8541,12 +8556,12 @@

Methods

setZIndex(<Number> value) this -

Changes the zIndex of the image overlay.

+

Changes the zIndex of the image overlay.

getBounds() - LatLngBounds + LatLngBounds

Get the bounds that this ImageOverlay covers

@@ -8559,7 +8574,7 @@

Methods

- +
@@ -8590,7 +8605,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -8607,7 +8622,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -8618,7 +8633,7 @@

Methods

- +
@@ -8635,7 +8650,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -8651,10 +8666,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -8687,7 +8702,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -8700,7 +8715,7 @@

Methods

- +
@@ -8717,7 +8732,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -8733,10 +8748,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -8769,7 +8784,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -8782,7 +8797,7 @@

Methods

- +
@@ -8853,18 +8868,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -8874,42 +8889,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -8921,7 +8936,7 @@

Methods

Path

An abstract class that contains options and constants shared between vector -overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer.

+overlays (Polygon, Polyline, Circle). Do not use it directly. Extends Layer.

Options

@@ -8995,7 +9010,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -9003,7 +9018,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -9019,7 +9034,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -9044,16 +9059,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -9070,7 +9085,7 @@

Options

- +
@@ -9103,7 +9118,7 @@

Options

- +
@@ -9126,7 +9141,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -9134,7 +9149,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -9150,7 +9165,7 @@

Events

- +
@@ -9168,43 +9183,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -9219,7 +9234,7 @@

Events

- +
@@ -9237,13 +9252,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -9255,7 +9270,7 @@

Events

- +
@@ -9273,13 +9288,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -9291,7 +9306,7 @@

Events

- +
@@ -9309,13 +9324,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -9351,10 +9366,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -9378,7 +9393,7 @@

Methods

- +
@@ -9409,7 +9424,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -9426,7 +9441,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -9437,7 +9452,7 @@

Methods

- +
@@ -9454,7 +9469,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -9470,10 +9485,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -9506,7 +9521,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -9519,7 +9534,7 @@

Methods

- +
@@ -9536,7 +9551,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -9552,10 +9567,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -9588,7 +9603,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -9601,7 +9616,7 @@

Methods

- +
@@ -9672,18 +9687,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -9693,42 +9708,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -9739,7 +9754,7 @@

Methods

Polyline

-

A class for drawing polyline overlays on a map. Extends Path.

+

A class for drawing polyline overlays on a map. Extends Path.

Usage example

@@ -9794,9 +9809,9 @@

Creation

- L.polyline(<LatLng[]> latlngs, <Polyline options> options?) + L.polyline(<LatLng[]> latlngs, <Polyline options> options?) Instantiates a polyline object given an array of geographical points and -optionally an options object. You can create a Polyline object with +optionally an options object. You can create a Polyline object with multiple separate lines (MultiPolyline) by passing an array of arrays of geographic points. @@ -9848,7 +9863,7 @@

Options

- +
@@ -9919,7 +9934,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -9927,7 +9942,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -9943,7 +9958,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -9968,16 +9983,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -9995,7 +10010,7 @@

Options

- +
@@ -10028,7 +10043,7 @@

Options

- +
@@ -10051,7 +10066,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -10059,7 +10074,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -10075,7 +10090,7 @@

Events

- +
@@ -10093,43 +10108,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -10144,7 +10159,7 @@

Events

- +
@@ -10162,13 +10177,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -10180,7 +10195,7 @@

Events

- +
@@ -10198,13 +10213,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -10216,7 +10231,7 @@

Events

- +
@@ -10234,13 +10249,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -10272,7 +10287,7 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).

+

Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).

@@ -10297,33 +10312,33 @@

Methods

- closestLayerPoint(<Point> p) - Point + closestLayerPoint(<Point> p) + Point

Returns the point closest to p on the Polyline.

getCenter() - LatLng + LatLng

Returns the center (centroid) of the polyline.

getBounds() - LatLngBounds + LatLngBounds -

Returns the LatLngBounds of the path.

+

Returns the LatLngBounds of the path.

- addLatLng(<LatLng> latlng) + addLatLng(<LatLng> latlng) this

Adds a given point to the polyline. By default, adds to the first ring of the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

+a specific ring as a LatLng array (that you can earlier access with getLatLngs).

@@ -10333,7 +10348,7 @@

Methods

- +
@@ -10357,10 +10372,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -10385,7 +10400,7 @@

Methods

- +
@@ -10416,7 +10431,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -10433,7 +10448,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -10444,7 +10459,7 @@

Methods

- +
@@ -10461,7 +10476,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -10477,10 +10492,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -10513,7 +10528,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -10526,7 +10541,7 @@

Methods

- +
@@ -10543,7 +10558,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -10559,10 +10574,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -10595,7 +10610,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -10608,7 +10623,7 @@

Methods

- +
@@ -10679,18 +10694,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -10700,42 +10715,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -10746,7 +10761,7 @@

Methods

Polygon

-

A class for drawing polygon overlays on a map. Extends Polyline. +

A class for drawing polygon overlays on a map. Extends Polyline. Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

@@ -10804,7 +10819,7 @@

Creation

- L.polygon(<LatLng[]> latlngs, <Polyline options> options?) + L.polygon(<LatLng[]> latlngs, <Polyline options> options?) @@ -10820,7 +10835,7 @@

Options

- +
@@ -10862,7 +10877,7 @@

Options

- +
@@ -10933,7 +10948,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -10941,7 +10956,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -10957,7 +10972,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -10982,16 +10997,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -11009,7 +11024,7 @@

Options

- +
@@ -11042,7 +11057,7 @@

Options

- +
@@ -11065,7 +11080,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -11073,7 +11088,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -11089,7 +11104,7 @@

Events

- +
@@ -11107,43 +11122,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -11158,7 +11173,7 @@

Events

- +
@@ -11176,13 +11191,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -11194,7 +11209,7 @@

Events

- +
@@ -11212,13 +11227,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -11230,7 +11245,7 @@

Events

- +
@@ -11248,13 +11263,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -11286,7 +11301,7 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

+

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

@@ -11296,7 +11311,7 @@

Methods

- +
@@ -11334,33 +11349,33 @@

Methods

- closestLayerPoint(<Point> p) - Point + closestLayerPoint(<Point> p) + Point

Returns the point closest to p on the Polyline.

getCenter() - LatLng + LatLng

Returns the center (centroid) of the polyline.

getBounds() - LatLngBounds + LatLngBounds -

Returns the LatLngBounds of the path.

+

Returns the LatLngBounds of the path.

- addLatLng(<LatLng> latlng) + addLatLng(<LatLng> latlng) this

Adds a given point to the polyline. By default, adds to the first ring of the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

+a specific ring as a LatLng array (that you can earlier access with getLatLngs).

@@ -11371,7 +11386,7 @@

Methods

- +
@@ -11395,10 +11410,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -11423,7 +11438,7 @@

Methods

- +
@@ -11454,7 +11469,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -11471,7 +11486,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -11482,7 +11497,7 @@

Methods

- +
@@ -11499,7 +11514,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -11515,10 +11530,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -11551,7 +11566,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -11564,7 +11579,7 @@

Methods

- +
@@ -11581,7 +11596,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -11597,10 +11612,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -11633,7 +11648,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -11646,7 +11661,7 @@

Methods

- +
@@ -11717,18 +11732,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -11738,42 +11753,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -11784,7 +11799,7 @@

Methods

Rectangle

-

A class for drawing rectangle overlays on a map. Extends Polygon.

+

A class for drawing rectangle overlays on a map. Extends Polygon.

Usage example

@@ -11825,7 +11840,7 @@

Creation

- L.rectangle(<LatLngBounds> latLngBounds, <Polyline options> options?) + L.rectangle(<LatLngBounds> latLngBounds, <Polyline options> options?) @@ -11841,7 +11856,7 @@

Options

- +
@@ -11883,7 +11898,7 @@

Options

- +
@@ -11954,7 +11969,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -11962,7 +11977,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -11978,7 +11993,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -12003,16 +12018,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -12030,7 +12045,7 @@

Options

- +
@@ -12063,7 +12078,7 @@

Options

- +
@@ -12086,7 +12101,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -12094,7 +12109,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -12110,7 +12125,7 @@

Events

- +
@@ -12128,43 +12143,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -12179,7 +12194,7 @@

Events

- +
@@ -12197,13 +12212,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -12215,7 +12230,7 @@

Events

- +
@@ -12233,13 +12248,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -12251,7 +12266,7 @@

Events

- +
@@ -12269,13 +12284,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -12304,7 +12319,7 @@

Methods

- setBounds(<LatLngBounds> latLngBounds) + setBounds(<LatLngBounds> latLngBounds) this

Redraws the rectangle with the passed bounds.

@@ -12317,7 +12332,7 @@

Methods

- +
@@ -12337,7 +12352,7 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

+

Returns a GeoJSON representation of the polygon (as a GeoJSON Polygon or MultiPolygon Feature).

@@ -12348,7 +12363,7 @@

Methods

- +
@@ -12386,33 +12401,33 @@

Methods

- closestLayerPoint(<Point> p) - Point + closestLayerPoint(<Point> p) + Point

Returns the point closest to p on the Polyline.

getCenter() - LatLng + LatLng

Returns the center (centroid) of the polyline.

getBounds() - LatLngBounds + LatLngBounds -

Returns the LatLngBounds of the path.

+

Returns the LatLngBounds of the path.

- addLatLng(<LatLng> latlng) + addLatLng(<LatLng> latlng) this

Adds a given point to the polyline. By default, adds to the first ring of the polyline in case of a multi-polyline, but can be overridden by passing -a specific ring as a LatLng array (that you can earlier access with getLatLngs).

+a specific ring as a LatLng array (that you can earlier access with getLatLngs).

@@ -12423,7 +12438,7 @@

Methods

- +
@@ -12447,10 +12462,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -12475,7 +12490,7 @@

Methods

- +
@@ -12506,7 +12521,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -12523,7 +12538,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -12534,7 +12549,7 @@

Methods

- +
@@ -12551,7 +12566,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -12567,10 +12582,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -12603,7 +12618,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -12616,7 +12631,7 @@

Methods

- +
@@ -12633,7 +12648,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -12649,10 +12664,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -12685,7 +12700,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -12698,7 +12713,7 @@

Methods

- +
@@ -12769,18 +12784,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -12790,42 +12805,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -12836,7 +12851,7 @@

Methods

Circle

-

A class for drawing circle overlays on a map. Extends CircleMarker. +

A class for drawing circle overlays on a map. Extends CircleMarker. It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).

@@ -12873,12 +12888,12 @@

Creation

- L.circle(<LatLng> latlng, <Circle options> options?) + L.circle(<LatLng> latlng, <Circle options> options?) Instantiates a circle object given a geographical point, and an options object which contains the circle radius. - L.circle(<LatLng> latlng, <Number> radius, <Circle options> options?) + L.circle(<LatLng> latlng, <Number> radius, <Circle options> options?) Obsolete way of instantiating a circle, for compatibility with 0.7.x code. Do not use in new applications or plugins. @@ -12921,7 +12936,7 @@

Options

- +
@@ -12992,7 +13007,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -13000,7 +13015,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -13016,7 +13031,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -13041,16 +13056,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -13068,7 +13083,7 @@

Options

- +
@@ -13101,7 +13116,7 @@

Options

- +
@@ -13124,7 +13139,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -13132,7 +13147,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -13148,7 +13163,7 @@

Events

- +
@@ -13166,43 +13181,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -13217,7 +13232,7 @@

Events

- +
@@ -13235,13 +13250,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -13253,7 +13268,7 @@

Events

- +
@@ -13271,13 +13286,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -13289,7 +13304,7 @@

Events

- +
@@ -13307,13 +13322,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -13357,9 +13372,9 @@

Methods

getBounds() - LatLngBounds + LatLngBounds -

Returns the LatLngBounds of the path.

+

Returns the LatLngBounds of the path.

@@ -13369,7 +13384,7 @@

Methods

- +
@@ -13389,11 +13404,11 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

+

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

- setLatLng(<LatLng> latLng) + setLatLng(<LatLng> latLng) this

Sets the position of a circle marker to a new location.

@@ -13401,7 +13416,7 @@

Methods

getLatLng() - LatLng + LatLng

Returns the current geographical position of the circle marker

@@ -13414,7 +13429,7 @@

Methods

- +
@@ -13438,10 +13453,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -13466,7 +13481,7 @@

Methods

- +
@@ -13497,7 +13512,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -13514,7 +13529,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -13525,7 +13540,7 @@

Methods

- +
@@ -13542,7 +13557,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -13558,10 +13573,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -13594,7 +13609,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -13607,7 +13622,7 @@

Methods

- +
@@ -13624,7 +13639,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -13640,10 +13655,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -13676,7 +13691,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -13689,7 +13704,7 @@

Methods

- +
@@ -13760,18 +13775,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -13781,42 +13796,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -13827,7 +13842,7 @@

Methods

CircleMarker

-

A circle of a fixed size with radius specified in pixels. Extends Path.

+

A circle of a fixed size with radius specified in pixels. Extends Path.

Creation

@@ -13846,7 +13861,7 @@

Creation

- L.circleMarker(<LatLng> latlng, <CircleMarker options> options?) + L.circleMarker(<LatLng> latlng, <CircleMarker options> options?) Instantiates a circle marker object given a geographical point, and an optional options object. @@ -13888,7 +13903,7 @@

Options

- +
@@ -13959,7 +13974,7 @@

Options

String null - A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers. dashOffset @@ -13967,7 +13982,7 @@

Options

String null - A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. + A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers. fill @@ -13983,7 +13998,7 @@

Options

String * - Fill color. Defaults to the value of the color option + Fill color. Defaults to the value of the color option fillOpacity @@ -14008,16 +14023,16 @@

Options

true When true, a mouse event on this path will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used). +(unless L.DomEvent.stopPropagation is used). renderer -Renderer +Renderer - Use this specific instance of Renderer for this path. Takes -precedence over the map's default renderer. + Use this specific instance of Renderer for this path. Takes +precedence over the map's default renderer. className @@ -14035,7 +14050,7 @@

Options

- +
@@ -14068,7 +14083,7 @@

Options

- +
@@ -14091,7 +14106,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -14099,7 +14114,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -14115,7 +14130,7 @@

Events

- +
@@ -14133,43 +14148,43 @@

Events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -14184,7 +14199,7 @@

Events

- +
@@ -14202,13 +14217,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -14220,7 +14235,7 @@

Events

- +
@@ -14238,13 +14253,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -14256,7 +14271,7 @@

Events

- +
@@ -14274,13 +14289,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -14312,11 +14327,11 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

+

Returns a GeoJSON representation of the circle marker (as a GeoJSON Point Feature).

- setLatLng(<LatLng> latLng) + setLatLng(<LatLng> latLng) this

Sets the position of a circle marker to a new location.

@@ -14324,7 +14339,7 @@

Methods

getLatLng() - LatLng + LatLng

Returns the current geographical position of the circle marker

@@ -14350,7 +14365,7 @@

Methods

- +
@@ -14374,10 +14389,10 @@

Methods

- setStyle(<Path options> style) + setStyle(<Path options> style) this -

Changes the appearance of a Path based on the options in the Path options object.

+

Changes the appearance of a Path based on the options in the Path options object.

@@ -14402,7 +14417,7 @@

Methods

- +
@@ -14433,7 +14448,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -14450,7 +14465,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -14461,7 +14476,7 @@

Methods

- +
@@ -14478,7 +14493,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -14494,10 +14509,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -14530,7 +14545,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -14543,7 +14558,7 @@

Methods

- +
@@ -14560,7 +14575,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -14576,10 +14591,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -14612,7 +14627,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -14625,7 +14640,7 @@

Methods

- +
@@ -14696,18 +14711,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -14717,42 +14732,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -14764,14 +14779,13 @@

Methods

SVG

Allows vector layers to be displayed with SVG. -Inherits Renderer. +Inherits Renderer. Due to technical limitations, SVG is not available in all web browsers, notably Android 2.x and 3.x. Although SVG is not available on IE7 and IE8, these browsers support VML (a now deprecated technology), and the SVG renderer will fall back to VML in this case. -Although SVG is not available on IE7 and IE8, these browsers support VML, and the SVG renderer will fall back to VML in this case. VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility with old versions of Internet Explorer.

@@ -14818,7 +14832,7 @@

Creation

- L.svg(<Renderer options> options?) + L.svg(<Renderer options> options?) Creates a SVG renderer with the given options. @@ -14834,7 +14848,7 @@

Options

- +
@@ -14876,7 +14890,7 @@

Options

- +
@@ -14899,7 +14913,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -14907,7 +14921,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -14923,7 +14937,7 @@

Events

- +
@@ -14941,7 +14955,7 @@

Events

update - Event + Event Fired when the renderer updates its bounds, center and zoom, for example when its map has moved @@ -14954,7 +14968,7 @@

Events

- +
@@ -14972,13 +14986,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -14990,7 +15004,7 @@

Events

- +
@@ -15008,13 +15022,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -15026,7 +15040,7 @@

Events

- +
@@ -15044,13 +15058,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -15068,7 +15082,7 @@

Methods

- +
@@ -15099,7 +15113,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -15116,7 +15130,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -15127,7 +15141,7 @@

Methods

- +
@@ -15144,7 +15158,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -15160,10 +15174,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -15196,7 +15210,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -15209,7 +15223,7 @@

Methods

- +
@@ -15226,7 +15240,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -15242,10 +15256,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -15278,7 +15292,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -15291,7 +15305,7 @@

Methods

- +
@@ -15362,18 +15376,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -15383,42 +15397,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -15467,7 +15481,7 @@

Functions

Canvas

Allows vector layers to be displayed with <canvas>. -Inherits Renderer. +Inherits Renderer. Due to technical limitations, Canvas is not available in all web browsers, notably IE8, and overlapping geometries might not display properly in some edge cases.

@@ -15515,7 +15529,7 @@

Creation

- L.canvas(<Renderer options> options?) + L.canvas(<Renderer options> options?) Creates a Canvas renderer with the given options. @@ -15531,7 +15545,7 @@

Options

- +
@@ -15573,7 +15587,7 @@

Options

- +
@@ -15596,7 +15610,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -15604,7 +15618,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -15620,7 +15634,7 @@

Events

- +
@@ -15638,7 +15652,7 @@

Events

update - Event + Event Fired when the renderer updates its bounds, center and zoom, for example when its map has moved @@ -15651,7 +15665,7 @@

Events

- +
@@ -15669,13 +15683,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -15687,7 +15701,7 @@

Events

- +
@@ -15705,13 +15719,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -15723,7 +15737,7 @@

Events

- +
@@ -15741,13 +15755,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -15765,7 +15779,7 @@

Methods

- +
@@ -15796,7 +15810,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -15813,7 +15827,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -15824,7 +15838,7 @@

Methods

- +
@@ -15841,7 +15855,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -15857,10 +15871,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -15893,7 +15907,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -15906,7 +15920,7 @@

Methods

- +
@@ -15923,7 +15937,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -15939,10 +15953,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -15975,7 +15989,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -15988,7 +16002,7 @@

Methods

- +
@@ -16059,18 +16073,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -16080,42 +16094,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -16128,7 +16142,7 @@

Methods

LayerGroup

Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as -well. Extends Layer.

+well. Extends Layer.

Usage example

@@ -16182,7 +16196,7 @@

Options

- +
@@ -16205,7 +16219,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -16213,7 +16227,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -16229,7 +16243,7 @@

Events

- +
@@ -16247,13 +16261,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -16265,7 +16279,7 @@

Events

- +
@@ -16283,13 +16297,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -16301,7 +16315,7 @@

Events

- +
@@ -16319,13 +16333,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -16357,18 +16371,18 @@

Methods

toGeoJSON() Object -

Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

+

Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

- addLayer(<Layer> layer) + addLayer(<Layer> layer) this

Adds the given layer to the group.

- removeLayer(<Layer> layer) + removeLayer(<Layer> layer) this

Removes the given layer from the group.

@@ -16382,7 +16396,7 @@

Methods

- hasLayer(<Layer> layer) + hasLayer(<Layer> layer) Boolean

Returns true if the given layer is currently added to the group.

@@ -16424,7 +16438,7 @@

Methods

getLayer(<Number> id) - Layer + Layer

Returns the layer with the given internal ID.

@@ -16444,7 +16458,7 @@

Methods

- getLayerId(<Layer> layer) + getLayerId(<Layer> layer) Number

Returns the internal ID for a layer

@@ -16457,7 +16471,7 @@

Methods

- +
@@ -16488,7 +16502,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -16505,7 +16519,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -16516,7 +16530,7 @@

Methods

- +
@@ -16533,7 +16547,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -16549,10 +16563,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -16585,7 +16599,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -16598,7 +16612,7 @@

Methods

- +
@@ -16615,7 +16629,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -16631,10 +16645,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -16667,7 +16681,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -16680,7 +16694,7 @@

Methods

- +
@@ -16751,18 +16765,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -16772,42 +16786,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -16818,11 +16832,11 @@

Methods

FeatureGroup

-

Extended LayerGroup that makes it easier to do the same thing to all its member layers:

+

Extended LayerGroup that makes it easier to do the same thing to all its member layers:

  • -bindPopup binds a popup to all of the layers at once (likewise with bindTooltip)
  • -
  • Events are propagated to the FeatureGroup, so if the group has an event +bindPopup binds a popup to all of the layers at once (likewise with bindTooltip)
  • +
  • Events are propagated to the FeatureGroup, so if the group has an event handler, it will handle events from any of the layers. This includes mouse events and custom events.
  • Has layeradd and layerremove events
  • @@ -16881,7 +16895,7 @@

    Options

    - +
    @@ -16904,7 +16918,7 @@

    Options

    String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -16912,7 +16926,7 @@

    Options

    String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -16940,15 +16954,15 @@

    Events

    layeradd - LayerEvent - Fired when a layer is added to this FeatureGroup + LayerEvent + Fired when a layer is added to this FeatureGroup layerremove - LayerEvent - Fired when a layer is removed from this FeatureGroup + LayerEvent + Fired when a layer is removed from this FeatureGroup @@ -16959,7 +16973,7 @@

    Events

    - +
    @@ -16977,13 +16991,13 @@

    Events

    add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -16995,7 +17009,7 @@

    Events

    - +
    @@ -17013,13 +17027,13 @@

    Events

    popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -17031,7 +17045,7 @@

    Events

    - +
    @@ -17049,13 +17063,13 @@

    Events

    tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -17084,7 +17098,7 @@

    Methods

    - setStyle(<Path options> style) + setStyle(<Path options> style) this

    Sets the given path options to each layer of the group that has a setStyle method.

    @@ -17106,7 +17120,7 @@

    Methods

    getBounds() - LatLngBounds + LatLngBounds

    Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).

    @@ -17118,7 +17132,7 @@

    Methods

    - +
    @@ -17138,18 +17152,18 @@

    Methods

    toGeoJSON() Object -

    Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

    +

    Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

    - addLayer(<Layer> layer) + addLayer(<Layer> layer) this

    Adds the given layer to the group.

    - removeLayer(<Layer> layer) + removeLayer(<Layer> layer) this

    Removes the given layer from the group.

    @@ -17163,7 +17177,7 @@

    Methods

    - hasLayer(<Layer> layer) + hasLayer(<Layer> layer) Boolean

    Returns true if the given layer is currently added to the group.

    @@ -17205,7 +17219,7 @@

    Methods

    getLayer(<Number> id) - Layer + Layer

    Returns the layer with the given internal ID.

    @@ -17225,7 +17239,7 @@

    Methods

    - getLayerId(<Layer> layer) + getLayerId(<Layer> layer) Number

    Returns the internal ID for a layer

    @@ -17239,7 +17253,7 @@

    Methods

    - +
    @@ -17270,7 +17284,7 @@

    Methods

    - removeFrom(<Map> map) + removeFrom(<Map> map) this

    Removes the layer from the given map

    @@ -17287,7 +17301,7 @@

    Methods

    getAttribution() String -

    Used by the attribution control, returns the attribution option.

    +

    Used by the attribution control, returns the attribution option.

    @@ -17298,7 +17312,7 @@

    Methods

    - +
    @@ -17315,7 +17329,7 @@

    Methods

    - bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

    Binds a popup to the layer with the passed content and sets up the @@ -17331,10 +17345,10 @@

    Methods

    - openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    +

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    @@ -17367,7 +17381,7 @@

    Methods

    getPopup() - Popup + Popup

    Returns the popup bound to this layer.

    @@ -17380,7 +17394,7 @@

    Methods

    - +
    @@ -17397,7 +17411,7 @@

    Methods

    - bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

    Binds a tooltip to the layer with the passed content and sets up the @@ -17413,10 +17427,10 @@

    Methods

    - openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    +

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    @@ -17449,7 +17463,7 @@

    Methods

    getTooltip() - Tooltip + Tooltip

    Returns the tooltip bound to this layer.

    @@ -17462,7 +17476,7 @@

    Methods

    - +
    @@ -17533,18 +17547,18 @@

    Methods

    once() this -

    Behaves as on(…), except the listener will only get fired once and then removed.

    +

    Behaves as on(…), except the listener will only get fired once and then removed.

    - addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

    Adds an event parent - an Evented that will receive propagated events

    +

    Adds an event parent - an Evented that will receive propagated events

    - removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

    Removes an event parent, so it will stop receiving propagated events

    @@ -17554,42 +17568,42 @@

    Methods

    addEventListener() this -

    Alias to on(…)

    +

    Alias to on(…)

    removeEventListener() this -

    Alias to off(…)

    +

    Alias to off(…)

    clearAllEventListeners() this -

    Alias to off()

    +

    Alias to off()

    addOneTimeEventListener() this -

    Alias to once(…)

    +

    Alias to once(…)

    fireEvent() this -

    Alias to fire(…)

    +

    Alias to fire(…)

    hasEventListeners() Boolean -

    Alias to listens(…)

    +

    Alias to listens(…)

    @@ -17601,7 +17615,7 @@

    Methods

    GeoJSON

    Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse -GeoJSON data and display it on the map. Extends FeatureGroup.

    +GeoJSON data and display it on the map. Extends FeatureGroup.

    Usage example

    @@ -17643,7 +17657,7 @@

    Creation

    - L.geoJSON(<Object> geojson?, <GeoJSON options> options?) + L.geoJSON(<Object> geojson?, <GeoJSON options> options?) Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object. @@ -17679,8 +17693,8 @@

    Options

    * A Function defining how GeoJSON points spawn Leaflet layers. It is internally -called when data is added, passing the GeoJSON point feature and its LatLng. -The default is to spawn a default Marker: +called when data is added, passing the GeoJSON point feature and its LatLng. +The default is to spawn a default Marker:
    function(geoJsonPoint, latlng) {
         return L.marker(latlng);
     }
    @@ -17693,7 +17707,7 @@ 

    Options

    Function * - A Function defining the Path options for styling GeoJSON lines and polygons, + A Function defining the Path options for styling GeoJSON lines and polygons, called internally when data is added. The default value is to not override any defaults:
    function (geoJsonFeature) {
    @@ -17737,7 +17751,7 @@ 

    Options

    Function * - A Function that will be used for converting GeoJSON coordinates to LatLngs. + A Function that will be used for converting GeoJSON coordinates to LatLngs. The default is the coordsToLatLng static method. @@ -17747,7 +17761,7 @@

    Options

    - +
    @@ -17770,7 +17784,7 @@

    Options

    String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -17778,7 +17792,7 @@

    Options

    String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -17794,7 +17808,7 @@

    Events

    - +
    @@ -17812,15 +17826,15 @@

    Events

    layeradd - LayerEvent - Fired when a layer is added to this FeatureGroup + LayerEvent + Fired when a layer is added to this FeatureGroup layerremove - LayerEvent - Fired when a layer is removed from this FeatureGroup + LayerEvent + Fired when a layer is removed from this FeatureGroup @@ -17832,7 +17846,7 @@

    Events

    - +
    @@ -17850,13 +17864,13 @@

    Events

    add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -17868,7 +17882,7 @@

    Events

    - +
    @@ -17886,13 +17900,13 @@

    Events

    popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -17904,7 +17918,7 @@

    Events

    - +
    @@ -17922,13 +17936,13 @@

    Events

    tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -17984,7 +17998,7 @@

    Methods

    - +
    @@ -18016,7 +18030,7 @@

    Methods

    getBounds() - LatLngBounds + LatLngBounds

    Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).

    @@ -18029,7 +18043,7 @@

    Methods

    - +
    @@ -18049,18 +18063,18 @@

    Methods

    toGeoJSON() Object -

    Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

    +

    Returns a GeoJSON representation of the layer group (as a GeoJSON FeatureCollection, GeometryCollection, or MultiPoint).

    - addLayer(<Layer> layer) + addLayer(<Layer> layer) this

    Adds the given layer to the group.

    - removeLayer(<Layer> layer) + removeLayer(<Layer> layer) this

    Removes the given layer from the group.

    @@ -18074,7 +18088,7 @@

    Methods

    - hasLayer(<Layer> layer) + hasLayer(<Layer> layer) Boolean

    Returns true if the given layer is currently added to the group.

    @@ -18116,7 +18130,7 @@

    Methods

    getLayer(<Number> id) - Layer + Layer

    Returns the layer with the given internal ID.

    @@ -18136,7 +18150,7 @@

    Methods

    - getLayerId(<Layer> layer) + getLayerId(<Layer> layer) Number

    Returns the internal ID for a layer

    @@ -18150,7 +18164,7 @@

    Methods

    - +
    @@ -18181,7 +18195,7 @@

    Methods

    - removeFrom(<Map> map) + removeFrom(<Map> map) this

    Removes the layer from the given map

    @@ -18198,7 +18212,7 @@

    Methods

    getAttribution() String -

    Used by the attribution control, returns the attribution option.

    +

    Used by the attribution control, returns the attribution option.

    @@ -18209,7 +18223,7 @@

    Methods

    - +
    @@ -18226,7 +18240,7 @@

    Methods

    - bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

    Binds a popup to the layer with the passed content and sets up the @@ -18242,10 +18256,10 @@

    Methods

    - openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    +

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    @@ -18278,7 +18292,7 @@

    Methods

    getPopup() - Popup + Popup

    Returns the popup bound to this layer.

    @@ -18291,7 +18305,7 @@

    Methods

    - +
    @@ -18308,7 +18322,7 @@

    Methods

    - bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

    Binds a tooltip to the layer with the passed content and sets up the @@ -18324,10 +18338,10 @@

    Methods

    - openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    +

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    @@ -18360,7 +18374,7 @@

    Methods

    getTooltip() - Tooltip + Tooltip

    Returns the tooltip bound to this layer.

    @@ -18373,7 +18387,7 @@

    Methods

    - +
    @@ -18444,18 +18458,18 @@

    Methods

    once() this -

    Behaves as on(…), except the listener will only get fired once and then removed.

    +

    Behaves as on(…), except the listener will only get fired once and then removed.

    - addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

    Adds an event parent - an Evented that will receive propagated events

    +

    Adds an event parent - an Evented that will receive propagated events

    - removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

    Removes an event parent, so it will stop receiving propagated events

    @@ -18465,42 +18479,42 @@

    Methods

    addEventListener() this -

    Alias to on(…)

    +

    Alias to on(…)

    removeEventListener() this -

    Alias to off(…)

    +

    Alias to off(…)

    clearAllEventListeners() this -

    Alias to off()

    +

    Alias to off()

    addOneTimeEventListener() this -

    Alias to once(…)

    +

    Alias to once(…)

    fireEvent() this -

    Alias to fire(…)

    +

    Alias to fire(…)

    hasEventListeners() Boolean -

    Alias to listens(…)

    +

    Alias to listens(…)

    @@ -18529,35 +18543,35 @@

    Functions

    - geometryToLayer(<Object> featureData, <GeoJSON options> options?) - Layer - Creates a Layer from a given GeoJSON feature. Can use a custom -pointToLayer and/or coordsToLatLng + geometryToLayer(<Object> featureData, <GeoJSON options> options?) + Layer + Creates a Layer from a given GeoJSON feature. Can use a custom +pointToLayer and/or coordsToLatLng functions if provided as options. coordsToLatLng(<Array> coords) - LatLng - Creates a LatLng object from an array of 2 numbers (longitude, latitude) + LatLng + Creates a LatLng object from an array of 2 numbers (longitude, latitude) or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points. coordsToLatLngs(<Array> coords, <Number> levelsDeep?, <Function> coordsToLatLng?) Array - Creates a multidimensional array of LatLngs from a GeoJSON coordinates array. + Creates a multidimensional array of LatLngs from a GeoJSON coordinates array. levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default). -Can use a custom coordsToLatLng function. +Can use a custom coordsToLatLng function. - latLngToCoords(<LatLng> latlng, <Number> precision?) + latLngToCoords(<LatLng> latlng, <Number> precision?) Array - Reverse of coordsToLatLng + Reverse of coordsToLatLng latLngsToCoords(<Array> latlngs, <Number> levelsDeep?, <Boolean> closed?) Array - Reverse of coordsToLatLngs + Reverse of coordsToLatLngs closed determines whether the first point should be appended to the end of the array to close the feature, only used when levelsDeep is 0. False by default. @@ -18584,7 +18598,7 @@

    Synchronous usage

    -

    To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.

    +

    To create a custom layer, extend GridLayer and implement the createTile() method, which will be passed a Point object with the x, y, and z (zoom level) coordinates to draw your tile.

    var CanvasLayer = L.GridLayer.extend({
         createTile: function(coords){
             // create a <canvas> element for drawing
    @@ -18650,7 +18664,7 @@ 

    Creation

    - L.gridLayer(<GridLayer options> options?) + L.gridLayer(<GridLayer options> options?) Creates a new instance of GridLayer with the supplied options. @@ -18703,7 +18717,7 @@

    Options

    Load new tiles only when panning ends. true by default on mobile browsers, in order to avoid too many requests and keep smooth navigation. false otherwise in order to display new tiles during panning, since it is easy to pan outside the -keepBuffer option in desktop browsers. +keepBuffer option in desktop browsers. updateWhenZooming @@ -18711,7 +18725,7 @@

    Options

    Boolean true - By default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends. + By default, a smooth zoom animation (during a touch zoom or a flyTo()) will update grid layers every integer zoom level. Setting this option to false will update the grid layer only when the smooth animation ends. updateInterval @@ -18732,10 +18746,10 @@

    Options

    bounds -LatLngBounds +LatLngBounds undefined - If set, tiles will only be loaded inside the set LatLngBounds. + If set, tiles will only be loaded inside the set LatLngBounds. minZoom @@ -18781,8 +18795,8 @@

    Options

    false Whether the layer is wrapped around the antimeridian. If true, the GridLayer will only be displayed once at low zoom levels. Has no -effect when the map CRS doesn't wrap around. Can be used -in combination with bounds to prevent requesting +effect when the map CRS doesn't wrap around. Can be used +in combination with bounds to prevent requesting tiles outside the CRS limits. @@ -18817,7 +18831,7 @@

    Options

    - +
    @@ -18840,7 +18854,7 @@

    Options

    String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -18868,37 +18882,37 @@

    Events

    loading - Event + Event Fired when the grid layer starts loading tiles. tileunload - TileEvent + TileEvent Fired when a tile is removed (e.g. when a tile goes off the screen). tileloadstart - TileEvent + TileEvent Fired when a tile is requested and starts loading. tileerror - TileErrorEvent + TileErrorEvent Fired when there is an error loading a tile. tileload - TileEvent + TileEvent Fired when a tile loads. load - Event + Event Fired when the grid layer loaded all visible tiles. @@ -18909,7 +18923,7 @@

    Events

    - +
    @@ -18927,13 +18941,13 @@

    Events

    add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -18945,7 +18959,7 @@

    Events

    - +
    @@ -18963,13 +18977,13 @@

    Events

    popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -18981,7 +18995,7 @@

    Events

    - +
    @@ -18999,13 +19013,13 @@

    Events

    tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -19058,14 +19072,14 @@

    Methods

    setOpacity(<Number> opacity) this -

    Changes the opacity of the grid layer.

    +

    Changes the opacity of the grid layer.

    setZIndex(<Number> zIndex) this -

    Changes the zIndex of the grid layer.

    +

    Changes the zIndex of the grid layer.

    @@ -19084,9 +19098,9 @@

    Methods

    getTileSize() - Point + Point -

    Normalizes the tileSize option into a point. Used by the createTile() method.

    +

    Normalizes the tileSize option into a point. Used by the createTile() method.

    @@ -19096,7 +19110,7 @@

    Methods

    Extension methods

    -
    Layers extending GridLayer shall reimplement the following method.
    +
    Layers extending GridLayer shall reimplement the following method.
    @@ -19111,7 +19125,7 @@

    Extension methods

    @@ -19123,7 +19137,7 @@

    Extension methods

    - +
    @@ -19154,7 +19168,7 @@

    Extension methods

    - + @@ -19182,7 +19196,7 @@

    Extension methods

    - +
    @@ -19199,7 +19213,7 @@

    Extension methods

    - + - + @@ -19251,7 +19265,7 @@

    Extension methods

    - + @@ -19264,7 +19278,7 @@

    Extension methods

    - +
    @@ -19281,7 +19295,7 @@

    Extension methods

    - + - + @@ -19333,7 +19347,7 @@

    Extension methods

    - + @@ -19346,7 +19360,7 @@

    Extension methods

    - +
    @@ -19417,18 +19431,18 @@

    Extension methods

    - + - + @@ -19503,7 +19517,7 @@

    Usage example

    map.panTo({lat: 50, lng: 30}); map.panTo(L.latLng(50, 30)); -

    Note that LatLng does not inherit from Leaflet's Class object, +

    Note that LatLng does not inherit from Leaflet's Class object, which means new classes can't inherit from it, and new methods can't be added to it with the include function.

    @@ -19564,10 +19578,10 @@

    Methods

    - + @@ -19578,24 +19592,24 @@

    Methods

    - + - + - + @@ -19668,7 +19682,7 @@

    Usage example

    ]);

    Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners outside the [-180, 180] degrees longitude range. -Note that LatLngBounds does not inherit from Leafet's Class object, +Note that LatLngBounds does not inherit from Leafet's Class object, which means new classes can't inherit from it, and new methods can't be added to it with the include function.

    @@ -19694,12 +19708,12 @@

    Creation

    - - + + - +
    createTile(<Object> coords, <Function> done?) HTMLElement -

    Called only internally, must be overridden by classes extending GridLayer. +

    Called only internally, must be overridden by classes extending GridLayer. Returns the HTMLElement corresponding to the given coords. If the done callback is specified, it must be called when the tile has finished loading and drawing.

    removeFrom(<Map> map)removeFrom(<Map> map) this

    Removes the layer from the given map

    @@ -19171,7 +19185,7 @@

    Extension methods

    getAttribution() String -

    Used by the attribution control, returns the attribution option.

    +

    Used by the attribution control, returns the attribution option.

    bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

    Binds a popup to the layer with the passed content and sets up the @@ -19215,10 +19229,10 @@

    Extension methods

    openPopup(<LatLng> latlng?)openPopup(<LatLng> latlng?) this -

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    +

    Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

    getPopup()PopupPopup

    Returns the popup bound to this layer.

    bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

    Binds a tooltip to the layer with the passed content and sets up the @@ -19297,10 +19311,10 @@

    Extension methods

    openTooltip(<LatLng> latlng?)openTooltip(<LatLng> latlng?) this -

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    +

    Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

    getTooltip()TooltipTooltip

    Returns the tooltip bound to this layer.

    once() this -

    Behaves as on(…), except the listener will only get fired once and then removed.

    +

    Behaves as on(…), except the listener will only get fired once and then removed.

    addEventParent(<Evented> obj)addEventParent(<Evented> obj) this -

    Adds an event parent - an Evented that will receive propagated events

    +

    Adds an event parent - an Evented that will receive propagated events

    removeEventParent(<Evented> obj)removeEventParent(<Evented> obj) this

    Removes an event parent, so it will stop receiving propagated events

    @@ -19438,42 +19452,42 @@

    Extension methods

    addEventListener() this -

    Alias to on(…)

    +

    Alias to on(…)

    removeEventListener() this -

    Alias to off(…)

    +

    Alias to off(…)

    clearAllEventListeners() this -

    Alias to off()

    +

    Alias to off()

    addOneTimeEventListener() this -

    Alias to once(…)

    +

    Alias to once(…)

    fireEvent() this -

    Alias to fire(…)

    +

    Alias to fire(…)

    hasEventListeners() Boolean -

    Alias to listens(…)

    +

    Alias to listens(…)

    equals(<LatLng> otherLatLng, <Number> maxMargin?)equals(<LatLng> otherLatLng, <Number> maxMargin?) Boolean -

    Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.

    +

    Returns true if the given LatLng point is at the same position (within a small margin of error). The margin of error can be overridden by setting maxMargin to a small number.

    distanceTo(<LatLng> otherLatLng)distanceTo(<LatLng> otherLatLng) Number -

    Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines.

    +

    Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines.

    wrap()LatLngLatLng -

    Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.

    +

    Returns a new LatLng object with the longitude wrapped so it's always between -180 and +180 degrees.

    toBounds(<Number> sizeInMeters)LatLngBoundsLatLngBounds -

    Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng.

    +

    Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng.

    L.latLngBounds(<LatLng> corner1, <LatLng> corner2)Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.L.latLngBounds(<LatLng> corner1, <LatLng> corner2)Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
    L.latLngBounds(<LatLng[]> latlngs)Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds.Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds.
    @@ -19725,14 +19739,14 @@

    Methods

    - extend(<LatLng> latlng) + extend(<LatLng> latlng) this

    Extend the bounds to contain the given point

    - extend(<LatLngBounds> otherBounds) + extend(<LatLngBounds> otherBounds) this

    Extend the bounds to contain the given bounds

    @@ -19740,7 +19754,7 @@

    Methods

    pad(<Number> bufferRatio) - LatLngBounds + LatLngBounds

    Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. For example, a ratio of 0.5 extends the bounds by 50% in each direction. @@ -19749,35 +19763,35 @@

    Methods

    getCenter() - LatLng + LatLng

    Returns the center point of the bounds.

    getSouthWest() - LatLng + LatLng

    Returns the south-west point of the bounds.

    getNorthEast() - LatLng + LatLng

    Returns the north-east point of the bounds.

    getNorthWest() - LatLng + LatLng

    Returns the north-west point of the bounds.

    getSouthEast() - LatLng + LatLng

    Returns the south-east point of the bounds.

    @@ -19811,28 +19825,28 @@

    Methods

    - contains(<LatLngBounds> otherBounds) + contains(<LatLngBounds> otherBounds) Boolean

    Returns true if the rectangle contains the given one.

    - contains(<LatLng> latlng) + contains(<LatLng> latlng) Boolean

    Returns true if the rectangle contains the given point.

    - intersects(<LatLngBounds> otherBounds) + intersects(<LatLngBounds> otherBounds) Boolean

    Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.

    - overlaps(<Bounds> otherBounds) + overlaps(<Bounds> otherBounds) Boolean

    Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.

    @@ -19846,7 +19860,7 @@

    Methods

    - equals(<LatLngBounds> otherBounds, <Number> maxMargin?) + equals(<LatLngBounds> otherBounds, <Number> maxMargin?) Boolean

    Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting maxMargin to a small number.

    @@ -19879,11 +19893,11 @@

    Usage example

    var point = L.point(200, 300);
     
    -

    All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

    +

    All Leaflet methods and options that accept Point objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

    map.panBy([200, 300]);
     map.panBy(L.point(200, 300));
     
    -

    Note that Point does not inherit from Leafet's Class object, +

    Note that Point does not inherit from Leafet's Class object, which means new classes can't inherit from it, and new methods can't be added to it with the include function.

    @@ -19945,42 +19959,42 @@

    Methods

    clone() - Point + Point

    Returns a copy of the current point.

    - add(<Point> otherPoint) - Point + add(<Point> otherPoint) + Point

    Returns the result of addition of the current and the given points.

    - subtract(<Point> otherPoint) - Point + subtract(<Point> otherPoint) + Point

    Returns the result of subtraction of the given point from the current.

    divideBy(<Number> num) - Point + Point

    Returns the result of division of the current point by the given number.

    multiplyBy(<Number> num) - Point + Point

    Returns the result of multiplication of the current point by the given number.

    - scaleBy(<Point> scale) - Point + scaleBy(<Point> scale) + Point

    Multiply each coordinate of the current point by each coordinate of scale. In linear algebra terms, multiply the point by the @@ -19989,8 +20003,8 @@

    Methods

    - unscaleBy(<Point> scale) - Point + unscaleBy(<Point> scale) + Point

    Inverse of scaleBy. Divide each coordinate of the current point by each coordinate of scale.

    @@ -19998,48 +20012,48 @@

    Methods

    round() - Point + Point

    Returns a copy of the current point with rounded coordinates.

    floor() - Point + Point

    Returns a copy of the current point with floored coordinates (rounded down).

    ceil() - Point + Point

    Returns a copy of the current point with ceiled coordinates (rounded up).

    trunc() - Point + Point

    Returns a copy of the current point with truncated coordinates (rounded towards zero).

    - distanceTo(<Point> otherPoint) + distanceTo(<Point> otherPoint) Number

    Returns the cartesian distance between the current and the given points.

    - equals(<Point> otherPoint) + equals(<Point> otherPoint) Boolean

    Returns true if the given point has the same coordinates.

    - contains(<Point> otherPoint) + contains(<Point> otherPoint) Boolean

    Returns true if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).

    @@ -20109,10 +20123,10 @@

    Usage example

    p2 = L.point(40, 60), bounds = L.bounds(p1, p2);
    -

    All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:

    +

    All Leaflet methods that accept Bounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:

    otherBounds.intersects([[10, 10], [40, 60]]);
     
    -

    Note that Bounds does not inherit from Leafet's Class object, +

    Note that Bounds does not inherit from Leafet's Class object, which means new classes can't inherit from it, and new methods can't be added to it with the include function.

    @@ -20138,7 +20152,7 @@

    Creation

    - L.bounds(<Point> corner1, <Point> corner2) + L.bounds(<Point> corner1, <Point> corner2) Creates a Bounds object from two corners coordinate pairs. @@ -20169,7 +20183,7 @@

    Methods

    - extend(<Point> point) + extend(<Point> point) this

    Extends the bounds to contain the given point.

    @@ -20177,62 +20191,62 @@

    Methods

    getCenter(<Boolean> round?) - Point + Point

    Returns the center point of the bounds.

    getBottomLeft() - Point + Point

    Returns the bottom-left point of the bounds.

    getTopRight() - Point + Point

    Returns the top-right point of the bounds.

    getTopLeft() - Point + Point -

    Returns the top-left point of the bounds (i.e. this.min).

    +

    Returns the top-left point of the bounds (i.e. this.min).

    getBottomRight() - Point + Point -

    Returns the bottom-right point of the bounds (i.e. this.max).

    +

    Returns the bottom-right point of the bounds (i.e. this.max).

    getSize() - Point + Point

    Returns the size of the given bounds

    - contains(<Bounds> otherBounds) + contains(<Bounds> otherBounds) Boolean

    Returns true if the rectangle contains the given one.

    - contains(<Point> point) + contains(<Point> point) Boolean

    Returns true if the rectangle contains the given point.

    - intersects(<Bounds> otherBounds) + intersects(<Bounds> otherBounds) Boolean

    Returns true if the rectangle intersects the given bounds. Two bounds @@ -20240,7 +20254,7 @@

    Methods

    - overlaps(<Bounds> otherBounds) + overlaps(<Bounds> otherBounds) Boolean

    Returns true if the rectangle overlaps the given bounds. Two bounds @@ -20272,13 +20286,13 @@

    Properties

    min - Point + Point The top left corner of the rectangle. max - Point + Point The bottom right corner of the rectangle. @@ -20311,7 +20325,7 @@

    Usage example

    }); L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
    -

    L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.

    +

    L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.

    @@ -20335,7 +20349,7 @@

    Creation

    - L.icon(<Icon options> options) + L.icon(<Icon options> options) Creates an icon instance with the given options. @@ -20383,7 +20397,7 @@

    Options

    iconSize -Point +Point null Size of the icon image in pixels. @@ -20391,7 +20405,7 @@

    Options

    iconAnchor -Point +Point null The coordinates of the "tip" of the icon (relative to its top left corner). The icon @@ -20401,7 +20415,7 @@

    Options

    popupAnchor -Point +Point [0, 0] The coordinates of the point from which popups will "open", relative to the icon anchor. @@ -20409,7 +20423,7 @@

    Options

    tooltipAnchor -Point +Point [0, 0] The coordinates of the point from which tooltips will "open", relative to the icon anchor. @@ -20433,7 +20447,7 @@

    Options

    shadowSize -Point +Point null Size of the shadow image in pixels. @@ -20441,7 +20455,7 @@

    Options

    shadowAnchor -Point +Point null The coordinates of the "tip" of the shadow (relative to its top left corner) (the same @@ -20508,11 +20522,11 @@

    Icon.Default

    -
    A trivial subclass of Icon, represents the icon to use in Markers when +
    A trivial subclass of Icon, represents the icon to use in Markers when no icon is specified. Points to the blue marker image distributed with Leaflet releases. In order to customize the default icon, just change the properties of L.Icon.Default.prototype.options -(which is a set of Icon options). +(which is a set of Icon options). If you want to completely replace the default icon, override the L.Marker.prototype.options.icon with your own icon instead.
    @@ -20533,7 +20547,7 @@

    Icon.Default

    -Icon.Default will try to auto-detect the location of the +Icon.Default will try to auto-detect the location of the blue icon images. If you are placing these images in a non-standard way, set this option to point to the right path. @@ -20545,7 +20559,7 @@

    Icon.Default

    DivIcon

    Represents a lightweight icon for markers that uses a simple <div> -element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.

    +element instead of an image. Inherits from Icon but ignores the iconUrl and shadow options.

    Usage example

    @@ -20584,8 +20598,8 @@

    Creation

    - L.divIcon(<DivIcon options> options) - Creates a DivIcon instance with the given options. + L.divIcon(<DivIcon options> options) + Creates a DivIcon instance with the given options. @@ -20622,7 +20636,7 @@

    Options

    bgPos -Point +Point [0, 0] Optional relative position of the background, in pixels @@ -20634,7 +20648,7 @@

    Options

    - +
    @@ -20672,7 +20686,7 @@

    Options

    iconSize -Point +Point null Size of the icon image in pixels. @@ -20680,7 +20694,7 @@

    Options

    iconAnchor -Point +Point null The coordinates of the "tip" of the icon (relative to its top left corner). The icon @@ -20690,7 +20704,7 @@

    Options

    popupAnchor -Point +Point [0, 0] The coordinates of the point from which popups will "open", relative to the icon anchor. @@ -20698,7 +20712,7 @@

    Options

    tooltipAnchor -Point +Point [0, 0] The coordinates of the point from which tooltips will "open", relative to the icon anchor. @@ -20722,7 +20736,7 @@

    Options

    shadowSize -Point +Point null Size of the shadow image in pixels. @@ -20730,7 +20744,7 @@

    Options

    shadowAnchor -Point +Point null The coordinates of the "tip" of the shadow (relative to its top left corner) (the same @@ -20758,7 +20772,7 @@

    Methods

    - +
    @@ -20797,7 +20811,7 @@

    Methods

    Control.Zoom

    -

    A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control.

    +

    A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control.

    Creation

    @@ -20816,7 +20830,7 @@

    Creation

    - L.control.zoom(<Control.Zoom options> options) + L.control.zoom(<Control.Zoom options> options) Creates a zoom control @@ -20883,7 +20897,7 @@

    Options

    - +
    @@ -20924,7 +20938,7 @@

    Methods

    - +
    @@ -20962,7 +20976,7 @@

    Methods

    - addTo(<Map> map) + addTo(<Map> map) this

    Adds the control to the given map.

    @@ -20983,7 +20997,7 @@

    Methods

    Control.Attribution

    -

    The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.

    +

    The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.

    Creation

    @@ -21002,7 +21016,7 @@

    Creation

    - L.control.attribution(<Control.Attribution options> options) + L.control.attribution(<Control.Attribution options> options) Creates an attribution control. @@ -21044,7 +21058,7 @@

    Options

    - +
    @@ -21123,7 +21137,7 @@

    Methods

    - +
    @@ -21161,7 +21175,7 @@

    Methods

    - addTo(<Map> map) + addTo(<Map> map) this

    Adds the control to the given map.

    @@ -21182,7 +21196,7 @@

    Methods

    Control.Layers

    -

    The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

    +

    The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

    Usage example

    @@ -21203,7 +21217,7 @@

    Usage example

    }; L.control.layers(baseLayers, overlays).addTo(map);
-

The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:

+

The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values:

{
     "<someName1>": layer1,
     "<someName2>": layer2
@@ -21235,7 +21249,7 @@ 

Creation

- L.control.layers(<Object> baselayers?, <Object> overlays?, <Control.Layers options> options?) + L.control.layers(<Object> baselayers?, <Object> overlays?, <Control.Layers options> options?) Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation. @@ -21303,7 +21317,7 @@

Options

* A compare function that will be used for sorting the layers, when sortLayers is true. -The function receives both the L.Layer instances and their names, as in +The function receives both the L.Layer instances and their names, as in sortFunction(layerA, layerB, nameA, nameB). By default, it sorts layers alphabetically by their name. @@ -21314,7 +21328,7 @@

Options

- +
@@ -21366,21 +21380,21 @@

Methods

- addBaseLayer(<Layer> layer, <String> name) + addBaseLayer(<Layer> layer, <String> name) this

Adds a base layer (radio button entry) with the given name to the control.

- addOverlay(<Layer> layer, <String> name) + addOverlay(<Layer> layer, <String> name) this

Adds an overlay (checkbox entry) with the given name to the control.

- removeLayer(<Layer> layer) + removeLayer(<Layer> layer) this

Remove the given layer from the control.

@@ -21407,7 +21421,7 @@

Methods

- +
@@ -21445,7 +21459,7 @@

Methods

- addTo(<Map> map) + addTo(<Map> map) this

Adds the control to the given map.

@@ -21466,7 +21480,7 @@

Methods

Control.Scale

-

A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control.

+

A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control.

Usage example

@@ -21502,7 +21516,7 @@

Creation

- L.control.scale(<Control.Scale options> options?) + L.control.scale(<Control.Scale options> options?) Creates an scale control with the given options. @@ -21559,7 +21573,7 @@

Options

Boolean false - If true, the control is updated on moveend, otherwise it's always up-to-date (updated on move). + If true, the control is updated on moveend, otherwise it's always up-to-date (updated on move). @@ -21568,7 +21582,7 @@

Options

- +
@@ -21609,7 +21623,7 @@

Methods

- +
@@ -21647,7 +21661,7 @@

Methods

- addTo(<Map> map) + addTo(<Map> map) this

Adds the control to the given map.

@@ -22071,7 +22085,7 @@

Properties

lastId Number - Last unique ID used by stamp() + Last unique ID used by stamp() @@ -22163,19 +22177,19 @@

Methods

- transform(<Point> point, <Number> scale?) - Point + transform(<Point> point, <Number> scale?) + Point

Returns a transformed point, optionally multiplied by the given scale. -Only accepts actual L.Point instances, not arrays.

+Only accepts actual L.Point instances, not arrays.

- untransform(<Point> point, <Number> scale?) - Point + untransform(<Point> point, <Number> scale?) + Point

Returns the reverse transformation of the given point, optionally divided -by the given scale. Only accepts actual L.Point instances, not arrays.

+by the given scale. Only accepts actual L.Point instances, not arrays.

@@ -22216,17 +22230,17 @@

Functions

Also released as a separated micro-library Simplify.js. - pointToSegmentDistance(<Point> p, <Point> p1, <Point> p2) + pointToSegmentDistance(<Point> p, <Point> p1, <Point> p2) Number Returns the distance between point p and segment p1 to p2. - closestPointOnSegment(<Point> p, <Point> p1, <Point> p2) + closestPointOnSegment(<Point> p, <Point> p1, <Point> p2) Number Returns the closest point from a point p on a segment p1 to p2. - clipSegment(<Point> a, <Point> b, <Bounds> bounds, <Boolean> useLastCode?, <Boolean> round?) + clipSegment(<Point> a, <Point> b, <Bounds> bounds, <Boolean> useLastCode?, <Boolean> round?) Point[]|Boolean Clips the segment a to b by rectangular bounds with the Cohen-Sutherland algorithm @@ -22265,7 +22279,7 @@

Functions

- clipPolygon(<Point[]> points, <Bounds> bounds, <Boolean> round?) + clipPolygon(<Point[]> points, <Bounds> bounds, <Boolean> round?) Point[] Clips the polygon geometry defined by the given points by the given bounds (using the Sutherland-Hodgman algorithm). Used by Leaflet to only show polygon points that are on the screen or near, increasing @@ -22361,7 +22375,7 @@

Functions

getMousePosition(<DOMEvent> ev, <HTMLElement> container?) - Point + Point Gets normalized mouse position from a DOM event relative to the container (border excluded) or to the whole page if not specified. @@ -22376,13 +22390,13 @@

Functions

addListener() this - Alias to L.DomEvent.on + Alias to L.DomEvent.on removeListener() this - Alias to L.DomEvent.off + Alias to L.DomEvent.off @@ -22492,14 +22506,14 @@

Functions

it returns false. Useful for vendor-prefixed styles like transform. - setTransform(<HTMLElement> el, <Point> offset, <Number> scale?) + setTransform(<HTMLElement> el, <Point> offset, <Number> scale?) Resets the 3D CSS transform of el so it is translated by offset pixels and optionally scaled by scale. Does not have an effect if the browser doesn't support 3D CSS transforms. - setPosition(<HTMLElement> el, <Point> position) + setPosition(<HTMLElement> el, <Point> position) Sets the position of el to coordinates specified by position, using CSS translate or top/left positioning depending on the browser @@ -22507,7 +22521,7 @@

Functions

getPosition(<HTMLElement> el) - Point + Point Returns the coordinates of an element previously positioned with setPosition. @@ -22521,18 +22535,18 @@

Functions

enableTextSelection() - Cancels the effects of a previous L.DomUtil.disableTextSelection. + Cancels the effects of a previous L.DomUtil.disableTextSelection. disableImageDrag() - As L.DomUtil.disableTextSelection, but + As L.DomUtil.disableTextSelection, but for dragstart DOM events, usually generated when the user drags an image. enableImageDrag() - Cancels the effects of a previous L.DomUtil.disableImageDrag. + Cancels the effects of a previous L.DomUtil.disableImageDrag. preventOutline(<HTMLElement> el) @@ -22545,7 +22559,7 @@

Functions

restoreOutline() - Cancels the effects of a previous L.DomUtil.preventOutline. + Cancels the effects of a previous L.DomUtil.preventOutline. getSizedParentNode(<HTMLElement> el) @@ -22645,7 +22659,7 @@

Constructor

L.PosAnimation() - Creates a PosAnimation object. + Creates a PosAnimation object. @@ -22673,19 +22687,19 @@

Events

start - Event + Event Fired when the animation starts step - Event + Event Fired continuously during the animation. end - Event + Event Fired when the animation ends. @@ -22713,7 +22727,7 @@

Methods

- run(<HTMLElement> el, <Point> newPos, <Number> duration?, <Number> easeLinearity?) + run(<HTMLElement> el, <Point> newPos, <Number> duration?, <Number> easeLinearity?)

Run an animation of a given element to a new position, optionally setting @@ -22736,7 +22750,7 @@

Methods

- +
@@ -22807,18 +22821,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -22828,42 +22842,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -22876,7 +22890,7 @@

Methods

Draggable

A class for making DOM elements draggable (including touch support). Used internally for map and marker dragging. Only works for elements -that were positioned with L.DomUtil.setPosition.

+that were positioned with L.DomUtil.setPosition.

Usage example

@@ -22913,8 +22927,8 @@

Constructor

- L.Draggable(<HTMLElement> el, <HTMLElement> dragHandle?, <Boolean> preventOutline?, <Draggable options> options?) - Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default). + L.Draggable(<HTMLElement> el, <HTMLElement> dragHandle?, <Boolean> preventOutline?, <Draggable options> options?) + Creates a Draggable object for moving el when you start dragging the dragHandle element (equals el itself by default). @@ -22975,32 +22989,32 @@

Events

down - Event + Event Fired when a drag is about to start. dragstart - Event + Event Fired when a drag starts predrag - Event + Event Fired continuously during dragging before each corresponding update of the element's position. drag - Event + Event Fired continuously during dragging. dragend - DragEndEvent + DragEndEvent Fired when the drag ends. @@ -23048,7 +23062,7 @@

Methods

- +
@@ -23119,18 +23133,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -23140,42 +23154,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -23292,7 +23306,7 @@

Options

a.options.myOption2; // 'bar' a.options.myOption3; // 5
-

There's also L.Util.setOptions, a method for +

There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defaults defines in the class:

var MyClass = L.Class.extend({
@@ -23354,7 +23368,7 @@ 

Constructor hooks

-

If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline). Leaflet comes with a way to do it easily using the addInitHook method:

+

If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline). Leaflet comes with a way to do it easily using the addInitHook method:

MyClass.addInitHook(function () {
     // ... do something in constructor additionally
     // e.g. add event listeners, set custom properties etc.
@@ -23390,25 +23404,25 @@ 

Functions

extend(<Object> props) Function -Extends the current class given the properties to be included. +Extends the current class given the properties to be included. Returns a Javascript function that is a class constructor (to be called with new). include(<Object> properties) this -Includes a mixin into the current class. +Includes a mixin into the current class. mergeOptions(<Object> options) this -Merges options into the defaults of the class. +Merges options into the defaults of the class. addInitHook(<Function> fn) this - Adds a constructor hook to the class. + Adds a constructor hook to the class. @@ -23417,7 +23431,7 @@

Functions

Evented

-

A set of methods shared between event-powered classes (like Map and Marker). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).

+

A set of methods shared between event-powered classes (like Map and Marker). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).

Usage example

@@ -23515,18 +23529,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -23536,42 +23550,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -23582,7 +23596,7 @@

Methods

Layer

A set of methods from the Layer base class that all Leaflet layers use. -Inherits all methods, options and events from L.Evented.

+Inherits all methods, options and events from L.Evented.

Usage example

@@ -23627,7 +23641,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -23635,7 +23649,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -23662,13 +23676,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -23691,13 +23705,13 @@

Popup events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -23720,13 +23734,13 @@

Tooltip events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -23743,7 +23757,7 @@

Methods

-
Classes extending L.Layer will inherit the following methods:
+
Classes extending L.Layer will inherit the following methods:
@@ -23769,7 +23783,7 @@

Methods

- + @@ -23796,7 +23810,7 @@

Methods

Extension methods

-
Every layer should extend from L.Layer and (re-)implement the following methods.
+
Every layer should extend from L.Layer and (re-)implement the following methods.
removeFrom(<Map> map)removeFrom(<Map> map) this

Removes the layer from the given map

@@ -23786,7 +23800,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -23808,24 +23822,24 @@

Extension methods

- + - + @@ -23836,10 +23850,10 @@

Extension methods

- + @@ -23867,7 +23881,7 @@

Popup methods

- + - + @@ -23919,7 +23933,7 @@

Popup methods

- + @@ -23948,7 +23962,7 @@

Tooltip methods

- + - + @@ -24000,7 +24014,7 @@

Tooltip methods

- + @@ -24012,7 +24026,7 @@

Tooltip methods

- +
@@ -24083,18 +24097,18 @@

Tooltip methods

- + - + @@ -24150,9 +24164,9 @@

Tooltip methods

Interactive layer

-

Some Layers can be made interactive - when the user interacts +

Some Layers can be made interactive - when the user interacts with such a layer, mouse events like click and mouseover can be handled. -Use the event handling methods to handle these events.

+Use the event handling methods to handle these events.

Options

@@ -24187,7 +24201,7 @@

Options

+(unless L.DomEvent.stopPropagation is used).
onAdd(<Map> map)onAdd(<Map> map) this -

Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

+

Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

onRemove(<Map> map)onRemove(<Map> map) this -

Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

+

Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

getEvents() Object -

This optional method should return an object like { viewreset: this._reset } for addEventListener. The event handlers in this object will be automatically added and removed from the map with your layer.

+

This optional method should return an object like { viewreset: this._reset } for addEventListener. The event handlers in this object will be automatically added and removed from the map with your layer.

beforeAdd(<Map> map)beforeAdd(<Map> map) this -

Optional method. Called on map.addLayer(layer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.

+

Optional method. Called on map.addLayer(layer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.

bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?)bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -23883,10 +23897,10 @@

Popup methods

openPopup(<LatLng> latlng?)openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

getPopup()PopupPopup

Returns the popup bound to this layer.

bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?)bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -23964,10 +23978,10 @@

Tooltip methods

openTooltip(<LatLng> latlng?)openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

getTooltip()TooltipTooltip

Returns the tooltip bound to this layer.

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

addEventParent(<Evented> obj)addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

removeEventParent(<Evented> obj)removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -24104,42 +24118,42 @@

Tooltip methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

true When true, a mouse event on this layer will trigger the same event on the map -(unless L.DomEvent.stopPropagation is used).
@@ -24196,7 +24210,7 @@

Options

- +
@@ -24219,7 +24233,7 @@

Options

String 'overlayPane' - By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. + By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default. attribution @@ -24227,7 +24241,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -24255,43 +24269,43 @@

Mouse events

click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the layer. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the layer. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the layer. mouseup - MouseEvent + MouseEvent Fired when the user releases the mouse button pushed on the layer. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the layer. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the layer. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch @@ -24305,7 +24319,7 @@

Mouse events

- +
@@ -24323,13 +24337,13 @@

Mouse events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -24341,7 +24355,7 @@

Mouse events

- +
@@ -24359,13 +24373,13 @@

Mouse events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -24377,7 +24391,7 @@

Mouse events

- +
@@ -24395,13 +24409,13 @@

Mouse events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -24419,7 +24433,7 @@

Methods

- +
@@ -24450,7 +24464,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -24467,7 +24481,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -24478,7 +24492,7 @@

Methods

- +
@@ -24495,7 +24509,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -24511,10 +24525,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -24547,7 +24561,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -24560,7 +24574,7 @@

Methods

- +
@@ -24577,7 +24591,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -24593,10 +24607,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -24629,7 +24643,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -24642,7 +24656,7 @@

Methods

- +
@@ -24713,18 +24727,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -24734,42 +24748,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -24857,7 +24871,7 @@

Methods

- addTo(<Map> map) + addTo(<Map> map) this

Adds the control to the given map.

@@ -24877,7 +24891,7 @@

Methods

Extension methods

-
Every control should extend from L.Control and (re-)implement the following methods.
+
Every control should extend from L.Control and (re-)implement the following methods.
@@ -24889,17 +24903,17 @@

Extension methods

- + - + @@ -24956,7 +24970,7 @@

Methods

Extension methods

-
Classes inheriting from Handler must implement the two following methods:
+
Classes inheriting from Handler must implement the two following methods:
onAdd(<Map> map)onAdd(<Map> map) HTMLElement -

Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map).

+

Should return the container DOM element for the control and add listeners on relevant map events. Called on control.addTo(map).

onRemove(<Map> map)onRemove(<Map> map) -

Optional method. Should contain all clean up code that removes the listeners previously added in onAdd. Called on control.remove().

+

Optional method. Should contain all clean up code that removes the listeners previously added in onAdd. Called on control.remove().

@@ -25005,7 +25019,7 @@

-

+ @@ -25037,20 +25051,20 @@

Methods

- - + + - - + + @@ -25080,7 +25094,7 @@

Properties

+ @@ -25149,31 +25163,31 @@

Methods

- - + + - - + + - - + + - - + + - + - + - - + + - - + + @@ -25302,7 +25316,7 @@

Defined CRSs

@@ -25313,16 +25327,16 @@

Defined CRSs

+Map's crs option. +or (-180,-90) for TileLayers with the tms option set. @@ -25333,7 +25347,7 @@

Defined CRSs

Leaflet defines the most usual CRSs by default. If you want to use a CRS not defined by default, take a look at the Proj4Leaflet plugin. -Note that the CRS instances do not inherit from Leafet's Class object, +Note that the CRS instances do not inherit from Leafet's Class object, and can't be instantiated. Also, new classes can't inherit from them, and methods can't be added to them with the include function. @@ -25351,12 +25365,12 @@

Defined CRSs

Renderer

-

Base class for vector renderer implementations (SVG, Canvas). Handles the +

Base class for vector renderer implementations (SVG, Canvas). Handles the DOM container of the renderer, its bounds, and its zoom animation. -A Renderer works as an implicit layer group for all Paths - the renderer +A Renderer works as an implicit layer group for all Paths - the renderer itself can be added or removed to the map. All paths use a renderer, which can be implicit (the map will decide the type of renderer and use it automatically) -or explicit (using the renderer option of the path). +or explicit (using the renderer option of the path). Do not use this class directly, use SVG and Canvas instead.

@@ -25401,7 +25415,7 @@

Options

- +
@@ -25424,7 +25438,7 @@

Options

String
- + @@ -25432,7 +25446,7 @@

Options

String - +
addTo(<Map> map, <String> name)addTo(<Map> map, <String> name) this Adds a new Handler to the given map with the given name.
project(<LatLng> latlng)Pointproject(<LatLng> latlng)Point

Projects geographical coordinates into a 2D point. -Only accepts actual L.LatLng instances, not arrays.

+Only accepts actual L.LatLng instances, not arrays.

unproject(<Point> point)LatLngunproject(<Point> point)LatLng

The inverse of project. Projects a 2D point into a geographical location. -Only accepts actual L.Point instances, not arrays. -Note that the projection instances do not inherit from Leafet's Class object, +Only accepts actual L.Point instances, not arrays. +Note that the projection instances do not inherit from Leafet's Class object, and can't be instantiated. Also, new classes can't inherit from them, and methods can't be added to them with the include function.

bounds - BoundsBounds The bounds (specified in CRS units) where the projection is valid
latLngToPoint(<LatLng> latlng, <Number> zoom)PointlatLngToPoint(<LatLng> latlng, <Number> zoom)Point

Projects geographical coordinates into pixel coordinates for a given zoom.

pointToLatLng(<Point> point, <Number> zoom)LatLngpointToLatLng(<Point> point, <Number> zoom)LatLng

The inverse of latLngToPoint. Projects pixel coordinates on a given zoom into geographical coordinates.

project(<LatLng> latlng)Pointproject(<LatLng> latlng)Point

Projects geographical coordinates into coordinates in units accepted for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).

unproject(<Point> point)LatLngunproject(<Point> point)LatLng

Given a projected coordinate returns the corresponding LatLng. The inverse of project.

@@ -25198,33 +25212,33 @@

Methods

getProjectedBounds(<Number> zoom)BoundsBounds

Returns the projection's bounds scaled and transformed for the provided zoom.

distance(<LatLng> latlng1, <LatLng> latlng2)distance(<LatLng> latlng1, <LatLng> latlng2) Number

Returns the distance between two geographical coordinates.

wrapLatLng(<LatLng> latlng)LatLngwrapLatLng(<LatLng> latlng)LatLng -

Returns a LatLng where lat and lng has been wrapped according to the +

Returns a LatLng where lat and lng has been wrapped according to the CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.

wrapLatLngBounds(<LatLngBounds> bounds)LatLngBoundswrapLatLngBounds(<LatLngBounds> bounds)LatLngBounds -

Returns a LatLngBounds with the same size as the given one, ensuring +

Returns a LatLngBounds with the same size as the given one, ensuring that its center is within the CRS's bounds. -Only accepts actual L.LatLngBounds instances, not arrays.

+Only accepts actual L.LatLngBounds instances, not arrays.

L.CRS.Earth Serves as the base for CRS that are global such that they cover the earth. Can only be used as the base for other CRS and cannot be used directly, -since it does not have a code, projection or transformation. distance() returns +since it does not have a code, projection or transformation. distance() returns meters.
L.CRS.EPSG3857 The most common CRS for online maps, used by almost all free and commercial tile providers. Uses Spherical Mercator projection. Set in by default in -Map's crs option.
L.CRS.EPSG4326 A common CRS among GIS enthusiasts. Uses simple Equirectangular projection. Leaflet 1.0.x complies with the TMS coordinate scheme for EPSG:4326, -which is a breaking change from 0.7.x behaviour. If you are using a TileLayer +which is a breaking change from 0.7.x behaviour. If you are using a TileLayer with this CRS, ensure that there are two 256x256 pixel tiles covering the whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90), -or (-180,-90) for TileLayers with the tms option set.
L.CRS.Base
'overlayPane'By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.By default the layer will be added to the map's overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
attribution nullString to be shown in the attribution control, describes the layer data, e.g. "© Mapbox".String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
@@ -25460,7 +25474,7 @@

Events

update - Event + Event Fired when the renderer updates its bounds, center and zoom, for example when its map has moved @@ -25472,7 +25486,7 @@

Events

- +
@@ -25490,13 +25504,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -25508,7 +25522,7 @@

Events

- +
@@ -25526,13 +25540,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -25544,7 +25558,7 @@

Events

- +
@@ -25562,13 +25576,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -25586,7 +25600,7 @@

Methods

- +
@@ -25617,7 +25631,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -25634,7 +25648,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -25645,7 +25659,7 @@

Methods

- +
@@ -25662,7 +25676,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -25678,10 +25692,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -25714,7 +25728,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -25727,7 +25741,7 @@

Methods

- +
@@ -25744,7 +25758,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -25760,10 +25774,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -25796,7 +25810,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -25809,7 +25823,7 @@

Methods

- +
@@ -25880,18 +25894,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -25901,42 +25915,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

@@ -25947,7 +25961,7 @@

Methods

Event objects

-

Whenever a class inheriting from Evented fires an event, a listener function +

Whenever a class inheriting from Evented fires an event, a listener function will be called with an event argument, which is a plain object containing information about the event. For example:

map.on('click', function(ev) {
@@ -26038,7 +26052,7 @@ 

KeyboardEvent

originalEvent DOMEvent - The original DOM KeyboardEvent that triggered this Leaflet event. + The original DOM KeyboardEvent that triggered this Leaflet event. @@ -26048,7 +26062,7 @@

KeyboardEvent

- +
@@ -26126,26 +26140,26 @@

MouseEvent

latlng - LatLng + LatLng The geographical point where the mouse event occured. layerPoint - Point + Point Pixel coordinates of the point where the mouse event occured relative to the map layer. containerPoint - Point + Point Pixel coordinates of the point where the mouse event occured relative to the map сontainer. originalEvent DOMEvent - The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event. + The original DOM MouseEvent or DOM TouchEvent that triggered this Leaflet event. @@ -26155,7 +26169,7 @@

MouseEvent

- +
@@ -26233,13 +26247,13 @@

LocationEvent

latlng - LatLng + LatLng Detected geographical location of the user. bounds - LatLngBounds + LatLngBounds Geographical bounds of the area user is located in (with respect to the accuracy of location). @@ -26286,7 +26300,7 @@

LocationEvent

- +
@@ -26381,7 +26395,7 @@

ErrorEvent

- +
@@ -26459,7 +26473,7 @@

LayerEvent

layer - Layer + Layer The layer that was added or removed. @@ -26470,7 +26484,7 @@

LayerEvent

- +
@@ -26541,7 +26555,7 @@

LayersControlEvent

layer - Layer + Layer The layer that was added or removed. @@ -26558,7 +26572,7 @@

LayersControlEvent

- +
@@ -26635,7 +26649,7 @@

TileEvent

coords - Point + Point Point object with the tile's x, y, and z (zoom level) coordinates. @@ -26646,7 +26660,7 @@

TileEvent

- +
@@ -26730,7 +26744,7 @@

TileErrorEvent

coords - Point + Point Point object with the tile's x, y, and z (zoom level) coordinates. @@ -26747,7 +26761,7 @@

TileErrorEvent

- +
@@ -26825,13 +26839,13 @@

ResizeEvent

oldSize - Point + Point The old size before resize event. newSize - Point + Point The new size after the resize event. @@ -26842,7 +26856,7 @@

ResizeEvent

- +
@@ -26920,7 +26934,7 @@

GeoJSONEvent

layer - Layer + Layer The layer for the GeoJSON feature that is being added to the map. @@ -26949,7 +26963,7 @@

GeoJSONEvent

- +
@@ -27020,7 +27034,7 @@

PopupEvent

popup - Popup + Popup The popup that was opened or closed. @@ -27031,7 +27045,7 @@

PopupEvent

- +
@@ -27109,7 +27123,7 @@

TooltipEvent

tooltip - Tooltip + Tooltip The tooltip that was opened or closed. @@ -27120,7 +27134,7 @@

TooltipEvent

- +
@@ -27209,7 +27223,7 @@

DragEndEvent

- +
@@ -27287,7 +27301,7 @@

ZoomAnimEvent

center - LatLng + LatLng The current center of the map @@ -27310,7 +27324,7 @@

ZoomAnimEvent

- +
@@ -27391,7 +27405,7 @@

Options

offset -Point +Point Point(0, 7) The offset of the popup position. Useful to control the anchor @@ -27421,7 +27435,7 @@

Options

- +
@@ -27444,7 +27458,7 @@

Options

String null - String to be shown in the attribution control, describes the layer data, e.g. "© Mapbox". + String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers. @@ -27460,7 +27474,7 @@

Events

- +
@@ -27478,13 +27492,13 @@

Events

add - Event + Event Fired after the layer is added to a map remove - Event + Event Fired after the layer is removed from a map @@ -27496,7 +27510,7 @@

Events

- +
@@ -27514,13 +27528,13 @@

Events

popupopen - PopupEvent + PopupEvent Fired when a popup bound to this layer is opened popupclose - PopupEvent + PopupEvent Fired when a popup bound to this layer is closed @@ -27532,7 +27546,7 @@

Events

- +
@@ -27550,13 +27564,13 @@

Events

tooltipopen - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is opened. tooltipclose - TooltipEvent + TooltipEvent Fired when a tooltip bound to this layer is closed. @@ -27574,7 +27588,7 @@

Methods

- +
@@ -27605,7 +27619,7 @@

Methods

- removeFrom(<Map> map) + removeFrom(<Map> map) this

Removes the layer from the given map

@@ -27622,7 +27636,7 @@

Methods

getAttribution() String -

Used by the attribution control, returns the attribution option.

+

Used by the attribution control, returns the attribution option.

@@ -27633,7 +27647,7 @@

Methods

- +
@@ -27650,7 +27664,7 @@

Methods

- bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) + bindPopup(<String|HTMLElement|Function|Popup> content, <Popup options> options?) this

Binds a popup to the layer with the passed content and sets up the @@ -27666,10 +27680,10 @@

Methods

- openPopup(<LatLng> latlng?) + openPopup(<LatLng> latlng?) this -

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

+

Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.

@@ -27702,7 +27716,7 @@

Methods

getPopup() - Popup + Popup

Returns the popup bound to this layer.

@@ -27715,7 +27729,7 @@

Methods

- +
@@ -27732,7 +27746,7 @@

Methods

- bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) + bindTooltip(<String|HTMLElement|Function|Tooltip> content, <Tooltip options> options?) this

Binds a tooltip to the layer with the passed content and sets up the @@ -27748,10 +27762,10 @@

Methods

- openTooltip(<LatLng> latlng?) + openTooltip(<LatLng> latlng?) this -

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

+

Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.

@@ -27784,7 +27798,7 @@

Methods

getTooltip() - Tooltip + Tooltip

Returns the tooltip bound to this layer.

@@ -27797,7 +27811,7 @@

Methods

- +
@@ -27868,18 +27882,18 @@

Methods

once() this -

Behaves as on(…), except the listener will only get fired once and then removed.

+

Behaves as on(…), except the listener will only get fired once and then removed.

- addEventParent(<Evented> obj) + addEventParent(<Evented> obj) this -

Adds an event parent - an Evented that will receive propagated events

+

Adds an event parent - an Evented that will receive propagated events

- removeEventParent(<Evented> obj) + removeEventParent(<Evented> obj) this

Removes an event parent, so it will stop receiving propagated events

@@ -27889,42 +27903,42 @@

Methods

addEventListener() this -

Alias to on(…)

+

Alias to on(…)

removeEventListener() this -

Alias to off(…)

+

Alias to off(…)

clearAllEventListeners() this -

Alias to off()

+

Alias to off()

addOneTimeEventListener() this -

Alias to once(…)

+

Alias to once(…)

fireEvent() this -

Alias to fire(…)

+

Alias to fire(…)

hasEventListeners() Boolean -

Alias to listens(…)

+

Alias to listens(…)

diff --git a/dist/leaflet.docset/Contents/Resources/docSet.dsidx b/dist/leaflet.docset/Contents/Resources/docSet.dsidx index 63d29fa..216bad5 100644 Binary files a/dist/leaflet.docset/Contents/Resources/docSet.dsidx and b/dist/leaflet.docset/Contents/Resources/docSet.dsidx differ