leaflet
Version:
JavaScript library for mobile-friendly interactive maps
1,754 lines • 449 kB
JSON
{
"namespaces": {
"Map": {
"name": "Map",
"aka": [
"L.Map"
],
"comments": [
"The central class of the API — it is used to create a map on a page and manipulate it."
],
"supersections": {
"option": {
"name": "option",
"aka": [],
"comments": [],
"sections": {
"__default": {
"name": "__default",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"preferCanvas": {
"name": "preferCanvas",
"aka": [],
"comments": [
"Whether `Path`s should be rendered on a `Canvas` renderer.",
"By default, all `Path`s are rendered in a `SVG` renderer."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "false",
"id": "map-prefercanvas"
}
},
"type": "option",
"id": "map-option"
},
"Control options": {
"name": "Control options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"attributionControl": {
"name": "attributionControl",
"aka": [],
"comments": [
"Whether a [attribution control](#control-attribution) is added to the map by default."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-attributioncontrol"
},
"zoomControl": {
"name": "zoomControl",
"aka": [],
"comments": [
"Whether a [zoom control](#control-zoom) is added to the map by default."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-zoomcontrol"
}
},
"type": "option",
"id": "map-control-options"
},
"Interaction Options": {
"name": "Interaction Options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"closePopupOnClick": {
"name": "closePopupOnClick",
"aka": [],
"comments": [
"Set it to `false` if you don't want popups to close when user clicks the map.",
" "
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-closepopuponclick"
},
"zoomSnap": {
"name": "zoomSnap",
"aka": [],
"comments": [
"Forces the map's zoom level to always be a multiple of this, particularly",
"right after a [`fitBounds()`](#map-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."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "1",
"id": "map-zoomsnap"
},
"zoomDelta": {
"name": "zoomDelta",
"aka": [],
"comments": [
"Controls how much the map's zoom level will change after a",
"[`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`",
"or `-` on the keyboard, or using the [zoom controls](#control-zoom).",
"Values smaller than `1` (e.g. `0.5`) allow for greater granularity."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "1",
"id": "map-zoomdelta"
},
"trackResize": {
"name": "trackResize",
"aka": [],
"comments": [
"Whether the map automatically handles browser window resize to update itself."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-trackresize"
},
"boxZoom": {
"name": "boxZoom",
"aka": [],
"comments": [
"Whether the map can be zoomed to a rectangular area specified by",
"dragging the mouse while pressing the shift key."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-boxzoom"
},
"doubleClickZoom": {
"name": "doubleClickZoom",
"aka": [],
"comments": [
"Whether 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."
],
"params": {},
"type": "Boolean|String",
"optional": false,
"defaultValue": "true",
"id": "map-doubleclickzoom"
},
"dragging": {
"name": "dragging",
"aka": [],
"comments": [
"Whether the map be draggable with mouse/touch or not."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-dragging"
}
},
"type": "option",
"id": "map-interaction-options"
},
"Map State Options": {
"name": "Map State Options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"crs": {
"name": "crs",
"aka": [],
"comments": [
"The [Coordinate Reference System](#crs) to use. Don't change this if you're not",
"sure what it means."
],
"params": {},
"type": "CRS",
"optional": false,
"defaultValue": "L.CRS.EPSG3857",
"id": "map-crs"
},
"center": {
"name": "center",
"aka": [],
"comments": [
"Initial geographic center of the map"
],
"params": {},
"type": "LatLng",
"optional": false,
"defaultValue": "undefined",
"id": "map-center"
},
"zoom": {
"name": "zoom",
"aka": [],
"comments": [
"Initial map zoom level"
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "undefined",
"id": "map-zoom"
},
"minZoom": {
"name": "minZoom",
"aka": [],
"comments": [
"Minimum zoom level of the map. Overrides any `minZoom` option set on map layers."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "undefined",
"id": "map-minzoom"
},
"maxZoom": {
"name": "maxZoom",
"aka": [],
"comments": [
"Maximum zoom level of the map. Overrides any `maxZoom` option set on map layers."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "undefined",
"id": "map-maxzoom"
},
"layers": {
"name": "layers",
"aka": [],
"comments": [
"Array of layers that will be added to the map initially"
],
"params": {},
"type": "Layer[]",
"optional": false,
"defaultValue": "[]",
"id": "map-layers"
},
"maxBounds": {
"name": "maxBounds",
"aka": [],
"comments": [
"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`](#map-setmaxbounds) method."
],
"params": {},
"type": "LatLngBounds",
"optional": false,
"defaultValue": "null",
"id": "map-maxbounds"
},
"renderer": {
"name": "renderer",
"aka": [],
"comments": [
"The default method for drawing vector layers on the map. `L.SVG`",
"or `L.Canvas` by default depending on browser support."
],
"params": {},
"type": "Renderer",
"optional": false,
"defaultValue": "*",
"id": "map-renderer"
}
},
"type": "option",
"id": "map-map-state-options"
},
"Animation Options": {
"name": "Animation Options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"zoomAnimation": {
"name": "zoomAnimation",
"aka": [],
"comments": [
"Whether the map zoom animation is enabled. By default it's enabled",
"in all browsers that support CSS3 Transitions except Android."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-zoomanimation"
},
"zoomAnimationThreshold": {
"name": "zoomAnimationThreshold",
"aka": [],
"comments": [
"Won't animate zoom if the zoom difference exceeds this value."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "4",
"id": "map-zoomanimationthreshold"
},
"fadeAnimation": {
"name": "fadeAnimation",
"aka": [],
"comments": [
"Whether the tile fade animation is enabled. By default it's enabled",
"in all browsers that support CSS3 Transitions except Android."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-fadeanimation"
},
"markerZoomAnimation": {
"name": "markerZoomAnimation",
"aka": [],
"comments": [
"Whether 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."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-markerzoomanimation"
},
"transform3DLimit": {
"name": "transform3DLimit",
"aka": [],
"comments": [
"Defines 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`."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "2^23",
"id": "map-transform3dlimit"
}
},
"type": "option",
"id": "map-animation-options"
},
"Panning Inertia Options": {
"name": "Panning Inertia Options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"inertia": {
"name": "inertia",
"aka": [],
"comments": [
"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."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "*",
"id": "map-inertia"
},
"inertiaDeceleration": {
"name": "inertiaDeceleration",
"aka": [],
"comments": [
"The rate with which the inertial movement slows down, in pixels/second²."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "3000",
"id": "map-inertiadeceleration"
},
"inertiaMaxSpeed": {
"name": "inertiaMaxSpeed",
"aka": [],
"comments": [
"Max speed of the inertial movement, in pixels/second."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "Infinity",
"id": "map-inertiamaxspeed"
},
"easeLinearity": {
"name": "easeLinearity",
"aka": [],
"comments": [],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "0.2",
"id": "map-easelinearity"
},
"worldCopyJump": {
"name": "worldCopyJump",
"aka": [],
"comments": [
"With 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."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "false",
"id": "map-worldcopyjump"
},
"maxBoundsViscosity": {
"name": "maxBoundsViscosity",
"aka": [],
"comments": [
"If `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."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "0.0",
"id": "map-maxboundsviscosity"
}
},
"type": "option",
"id": "map-panning-inertia-options"
},
"Keyboard Navigation Options": {
"name": "Keyboard Navigation Options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"keyboard": {
"name": "keyboard",
"aka": [],
"comments": [
"Makes the map focusable and allows users to navigate the map with keyboard",
"arrows and `+`/`-` keys."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-keyboard"
},
"keyboardPanDelta": {
"name": "keyboardPanDelta",
"aka": [],
"comments": [
"Amount of pixels to pan when pressing an arrow key."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "80",
"id": "map-keyboardpandelta"
}
},
"type": "option",
"id": "map-keyboard-navigation-options"
},
"Mousewheel options": {
"name": "Mousewheel options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"scrollWheelZoom": {
"name": "scrollWheelZoom",
"aka": [],
"comments": [
"Whether 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."
],
"params": {},
"type": "Boolean|String",
"optional": false,
"defaultValue": "true",
"id": "map-scrollwheelzoom"
},
"wheelDebounceTime": {
"name": "wheelDebounceTime",
"aka": [],
"comments": [
"Limits 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."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "40",
"id": "map-wheeldebouncetime"
},
"wheelPxPerZoomLevel": {
"name": "wheelPxPerZoomLevel",
"aka": [],
"comments": [
"How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))",
"mean a change of one full zoom level. Smaller values will make wheel-zooming",
"faster (and vice versa)."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "60",
"id": "map-wheelpxperzoomlevel"
}
},
"type": "option",
"id": "map-mousewheel-options"
},
"Touch interaction options": {
"name": "Touch interaction options",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"tap": {
"name": "tap",
"aka": [],
"comments": [
"Enables mobile hacks for supporting instant taps (fixing 200ms click",
"delay on iOS/Android) and touch holds (fired as `contextmenu` events)."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-tap"
},
"tapTolerance": {
"name": "tapTolerance",
"aka": [],
"comments": [
"The max number of pixels a user can shift his finger during touch",
"for it to be considered a valid tap."
],
"params": {},
"type": "Number",
"optional": false,
"defaultValue": "15",
"id": "map-taptolerance"
},
"touchZoom": {
"name": "touchZoom",
"aka": [],
"comments": [
"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."
],
"params": {},
"type": "Boolean|String",
"optional": false,
"defaultValue": "*",
"id": "map-touchzoom"
},
"bounceAtZoomLimits": {
"name": "bounceAtZoomLimits",
"aka": [],
"comments": [
"Set it to false if you don't want the map to zoom beyond min/max zoom",
"and then bounce back when pinch-zooming."
],
"params": {},
"type": "Boolean",
"optional": false,
"defaultValue": "true",
"id": "map-bounceatzoomlimits"
}
},
"type": "option",
"id": "map-touch-interaction-options"
}
},
"id": "map-option"
},
"event": {
"name": "event",
"aka": [],
"comments": [],
"sections": {
"Layer events": {
"name": "Layer events",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"baselayerchange": {
"name": "baselayerchange",
"aka": [],
"comments": [
"Fired when the base layer is changed through the [layer control](#control-layers)."
],
"params": {},
"type": "LayersControlEvent",
"optional": false,
"defaultValue": null,
"id": "map-baselayerchange"
},
"overlayadd": {
"name": "overlayadd",
"aka": [],
"comments": [
"Fired when an overlay is selected through the [layer control](#control-layers)."
],
"params": {},
"type": "LayersControlEvent",
"optional": false,
"defaultValue": null,
"id": "map-overlayadd"
},
"overlayremove": {
"name": "overlayremove",
"aka": [],
"comments": [
"Fired when an overlay is deselected through the [layer control](#control-layers)."
],
"params": {},
"type": "LayersControlEvent",
"optional": false,
"defaultValue": null,
"id": "map-overlayremove"
},
"layeradd": {
"name": "layeradd",
"aka": [],
"comments": [
"Fired when a new layer is added to the map."
],
"params": {},
"type": "LayerEvent",
"optional": false,
"defaultValue": null,
"id": "map-layeradd"
},
"layerremove": {
"name": "layerremove",
"aka": [],
"comments": [
"Fired when some layer is removed from the map"
],
"params": {},
"type": "LayerEvent",
"optional": false,
"defaultValue": null,
"id": "map-layerremove"
}
},
"type": "event",
"id": "map-layer-events"
},
"Map state change events": {
"name": "Map state change events",
"aka": [],
"comments": [
" "
],
"uninheritable": false,
"documentables": {
"zoomlevelschange": {
"name": "zoomlevelschange",
"aka": [],
"comments": [
"Fired when the number of zoomlevels on the map is changed due",
"to adding or removing a layer."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-zoomlevelschange"
},
"resize": {
"name": "resize",
"aka": [],
"comments": [
"Fired when the map is resized."
],
"params": {},
"type": "ResizeEvent",
"optional": false,
"defaultValue": null,
"id": "map-resize"
},
"unload": {
"name": "unload",
"aka": [],
"comments": [
"Fired when the map is destroyed with [remove](#map-remove) method."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-unload"
},
"viewreset": {
"name": "viewreset",
"aka": [],
"comments": [
"Fired when the map needs to redraw its content (this usually happens",
"on map zoom or load). Very useful for creating custom overlays."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-viewreset"
},
"load": {
"name": "load",
"aka": [],
"comments": [
"Fired when the map is initialized (when its center and zoom are set",
"for the first time)."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-load"
},
"zoomstart": {
"name": "zoomstart",
"aka": [],
"comments": [
"Fired when the map zoom is about to change (e.g. before zoom animation)."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-zoomstart"
},
"movestart": {
"name": "movestart",
"aka": [],
"comments": [
"Fired when the view of the map starts changing (e.g. user starts dragging the map)."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-movestart"
},
"zoom": {
"name": "zoom",
"aka": [],
"comments": [
"Fired repeatedly during any change in zoom level, including zoom",
"and fly animations."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-zoom"
},
"move": {
"name": "move",
"aka": [],
"comments": [
"Fired repeatedly during any movement of the map, including pan and",
"fly animations."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-move"
},
"zoomend": {
"name": "zoomend",
"aka": [],
"comments": [
"Fired when the map has changed, after any animations."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-zoomend"
},
"moveend": {
"name": "moveend",
"aka": [],
"comments": [
"Fired when the center of the map stops changing (e.g. user stopped",
"dragging the map)."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-moveend"
}
},
"type": "event",
"id": "map-map-state-change-events"
},
"Popup events": {
"name": "Popup events",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"popupopen": {
"name": "popupopen",
"aka": [],
"comments": [
"Fired when a popup is opened in the map"
],
"params": {},
"type": "PopupEvent",
"optional": false,
"defaultValue": null,
"id": "map-popupopen"
},
"popupclose": {
"name": "popupclose",
"aka": [],
"comments": [
"Fired when a popup in the map is closed"
],
"params": {},
"type": "PopupEvent",
"optional": false,
"defaultValue": null,
"id": "map-popupclose"
},
"autopanstart": {
"name": "autopanstart",
"aka": [],
"comments": [
"Fired when the map starts autopanning when opening a popup."
],
"params": {},
"type": "Event",
"optional": false,
"defaultValue": null,
"id": "map-autopanstart"
}
},
"type": "event",
"id": "map-popup-events"
},
"Tooltip events": {
"name": "Tooltip events",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"tooltipopen": {
"name": "tooltipopen",
"aka": [],
"comments": [
"Fired when a tooltip is opened in the map."
],
"params": {},
"type": "TooltipEvent",
"optional": false,
"defaultValue": null,
"id": "map-tooltipopen"
},
"tooltipclose": {
"name": "tooltipclose",
"aka": [],
"comments": [
"Fired when a tooltip in the map is closed."
],
"params": {},
"type": "TooltipEvent",
"optional": false,
"defaultValue": null,
"id": "map-tooltipclose"
}
},
"type": "event",
"id": "map-tooltip-events"
},
"Location events": {
"name": "Location events",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"locationerror": {
"name": "locationerror",
"aka": [],
"comments": [
"Fired when geolocation (using the [`locate`](#map-locate) method) failed."
],
"params": {},
"type": "ErrorEvent",
"optional": false,
"defaultValue": null,
"id": "map-locationerror"
},
"locationfound": {
"name": "locationfound",
"aka": [],
"comments": [
"Fired when geolocation (using the [`locate`](#map-locate) method)",
"went successfully."
],
"params": {},
"type": "LocationEvent",
"optional": false,
"defaultValue": null,
"id": "map-locationfound"
}
},
"type": "event",
"id": "map-location-events"
},
"Interaction events": {
"name": "Interaction events",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"click": {
"name": "click",
"aka": [],
"comments": [
"Fired when the user clicks (or taps) the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-click"
},
"dblclick": {
"name": "dblclick",
"aka": [],
"comments": [
"Fired when the user double-clicks (or double-taps) the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-dblclick"
},
"mousedown": {
"name": "mousedown",
"aka": [],
"comments": [
"Fired when the user pushes the mouse button on the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-mousedown"
},
"mouseup": {
"name": "mouseup",
"aka": [],
"comments": [
"Fired when the user releases the mouse button on the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-mouseup"
},
"mouseover": {
"name": "mouseover",
"aka": [],
"comments": [
"Fired when the mouse enters the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-mouseover"
},
"mouseout": {
"name": "mouseout",
"aka": [],
"comments": [
"Fired when the mouse leaves the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-mouseout"
},
"mousemove": {
"name": "mousemove",
"aka": [],
"comments": [
"Fired while the mouse moves over the map."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-mousemove"
},
"contextmenu": {
"name": "contextmenu",
"aka": [],
"comments": [
"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",
"for a second (also called long press)."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-contextmenu"
},
"keypress": {
"name": "keypress",
"aka": [],
"comments": [
"Fired when the user presses a key from the keyboard while the map is focused."
],
"params": {},
"type": "KeyboardEvent",
"optional": false,
"defaultValue": null,
"id": "map-keypress"
},
"preclick": {
"name": "preclick",
"aka": [],
"comments": [
"Fired before mouse click on the map (sometimes useful when you",
"want something to happen on click before any existing click",
"handlers start running)."
],
"params": {},
"type": "MouseEvent",
"optional": false,
"defaultValue": null,
"id": "map-preclick"
}
},
"type": "event",
"id": "map-interaction-events"
},
"Other Methods": {
"name": "Other Methods",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"zoomanim": {
"name": "zoomanim",
"aka": [],
"comments": [
"Fired on every frame of a zoom animation"
],
"params": {},
"type": "ZoomAnimEvent",
"optional": false,
"defaultValue": null,
"id": "map-zoomanim"
}
},
"type": "event",
"id": "map-other-methods"
}
},
"id": "map-event"
},
"method": {
"name": "method",
"aka": [],
"comments": [],
"sections": {
"__default": {
"name": "__default",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"getRenderer": {
"name": "getRenderer",
"aka": [],
"comments": [
"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."
],
"params": {
"layer": {
"name": "layer",
"type": "Path"
}
},
"type": "Renderer",
"optional": false,
"defaultValue": null,
"id": "map-getrenderer"
}
},
"type": "method",
"id": "map-method"
},
"Methods for Layers and Controls": {
"name": "Methods for Layers and Controls",
"aka": [],
"comments": [
" "
],
"uninheritable": false,
"documentables": {
"addControl": {
"name": "addControl",
"aka": [],
"comments": [
"Adds the given control to the map"
],
"params": {
"control": {
"name": "control",
"type": "Control"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-addcontrol"
},
"removeControl": {
"name": "removeControl",
"aka": [],
"comments": [
"Removes the given control from the map"
],
"params": {
"control": {
"name": "control",
"type": "Control"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-removecontrol"
},
"addLayer": {
"name": "addLayer",
"aka": [],
"comments": [
"Adds the given layer to the map"
],
"params": {
"layer": {
"name": "layer",
"type": "Layer"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-addlayer"
},
"removeLayer": {
"name": "removeLayer",
"aka": [],
"comments": [
"Removes the given layer from the map."
],
"params": {
"layer": {
"name": "layer",
"type": "Layer"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-removelayer"
},
"hasLayer": {
"name": "hasLayer",
"aka": [],
"comments": [
"Returns `true` if the given layer is currently added to the map"
],
"params": {
"layer": {
"name": "layer",
"type": "Layer"
}
},
"type": "Boolean",
"optional": false,
"defaultValue": null,
"id": "map-haslayer"
},
"eachLayer": {
"name": "eachLayer",
"aka": [],
"comments": [
"Iterates over the layers of the map, optionally specifying context of the iterator function.",
"```",
"map.eachLayer(function(layer){",
" layer.bindPopup('Hello');",
"});",
"```",
"\t "
],
"params": {
"fn": {
"name": "fn",
"type": "Function"
},
"context?": {
"name": "context?",
"type": "Object"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-eachlayer"
},
"openPopup": {
"name": "openPopup",
"aka": [],
"comments": [
"Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability)."
],
"params": {
"popup": {
"name": "popup",
"type": "Popup"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-openpopup"
},
"openPopup-alternative-1": {
"name": "openPopup",
"aka": [],
"comments": [
"Creates a popup with the specified content and options and opens it in the given point on a map."
],
"params": {
"content": {
"name": "content",
"type": "String|HTMLElement"
},
"latlng": {
"name": "latlng",
"type": "LatLng"
},
"options?": {
"name": "options?",
"type": "Popup options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-openpopup"
},
"closePopup": {
"name": "closePopup",
"aka": [],
"comments": [
"Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one)."
],
"params": {
"popup?": {
"name": "popup?",
"type": "Popup"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-closepopup"
},
"openTooltip": {
"name": "openTooltip",
"aka": [],
"comments": [
"Opens the specified tooltip."
],
"params": {
"tooltip": {
"name": "tooltip",
"type": "Tooltip"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-opentooltip"
},
"openTooltip-alternative-1": {
"name": "openTooltip",
"aka": [],
"comments": [
"Creates a tooltip with the specified content and options and open it."
],
"params": {
"content": {
"name": "content",
"type": "String|HTMLElement"
},
"latlng": {
"name": "latlng",
"type": "LatLng"
},
"options?": {
"name": "options?",
"type": "Tooltip options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-opentooltip"
},
"closeTooltip": {
"name": "closeTooltip",
"aka": [],
"comments": [
"Closes the tooltip given as parameter."
],
"params": {
"tooltip?": {
"name": "tooltip?",
"type": "Tooltip"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-closetooltip"
}
},
"type": "method",
"id": "map-methods-for-layers-and-controls"
},
"Methods for modifying map state": {
"name": "Methods for modifying map state",
"aka": [],
"comments": [],
"uninheritable": false,
"documentables": {
"setView": {
"name": "setView",
"aka": [],
"comments": [
"Sets the view of the map (geographical center and zoom) with the given",
"animation options."
],
"params": {
"center": {
"name": "center",
"type": "LatLng"
},
"zoom": {
"name": "zoom",
"type": "Number"
},
"options?": {
"name": "options?",
"type": "Zoom/pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setview"
},
"setZoom": {
"name": "setZoom",
"aka": [],
"comments": [
"Sets the zoom of the map."
],
"params": {
"zoom": {
"name": "zoom",
"type": "Number"
},
"options": {
"name": "options",
"type": "Zoom/pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setzoom"
},
"zoomIn": {
"name": "zoomIn",
"aka": [],
"comments": [
"Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default)."
],
"params": {
"delta?": {
"name": "delta?",
"type": "Number"
},
"options?": {
"name": "options?",
"type": "Zoom options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-zoomin"
},
"zoomOut": {
"name": "zoomOut",
"aka": [],
"comments": [
"Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default)."
],
"params": {
"delta?": {
"name": "delta?",
"type": "Number"
},
"options?": {
"name": "options?",
"type": "Zoom options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-zoomout"
},
"setZoomAround": {
"name": "setZoomAround",
"aka": [],
"comments": [
"Zooms the map while keeping a specified geographical point on the map",
"stationary (e.g. used internally for scroll zoom and double-click zoom)."
],
"params": {
"latlng": {
"name": "latlng",
"type": "LatLng"
},
"zoom": {
"name": "zoom",
"type": "Number"
},
"options": {
"name": "options",
"type": "Zoom options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setzoomaround"
},
"setZoomAround-alternative-1": {
"name": "setZoomAround",
"aka": [],
"comments": [
"Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary."
],
"params": {
"offset": {
"name": "offset",
"type": "Point"
},
"zoom": {
"name": "zoom",
"type": "Number"
},
"options": {
"name": "options",
"type": "Zoom options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setzoomaround"
},
"fitBounds": {
"name": "fitBounds",
"aka": [],
"comments": [
"Sets a map view that contains the given geographical bounds with the",
"maximum zoom level possible."
],
"params": {
"bounds": {
"name": "bounds",
"type": "LatLngBounds"
},
"options?": {
"name": "options?",
"type": "fitBounds options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-fitbounds"
},
"fitWorld": {
"name": "fitWorld",
"aka": [],
"comments": [
"Sets a map view that mostly contains the whole world with the maximum",
"zoom level possible."
],
"params": {
"options?": {
"name": "options?",
"type": "fitBounds options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-fitworld"
},
"panTo": {
"name": "panTo",
"aka": [],
"comments": [
"Pans the map to a given center."
],
"params": {
"latlng": {
"name": "latlng",
"type": "LatLng"
},
"options?": {
"name": "options?",
"type": "Pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-panto"
},
"panBy": {
"name": "panBy",
"aka": [],
"comments": [
"Pans the map by a given number of pixels (animated)."
],
"params": {
"offset": {
"name": "offset",
"type": "Point"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-panby"
},
"flyTo": {
"name": "flyTo",
"aka": [],
"comments": [
"Sets the view of the map (geographical center and zoom) performing a smooth",
"pan-zoom animation."
],
"params": {
"latlng": {
"name": "latlng",
"type": "LatLng"
},
"zoom?": {
"name": "zoom?",
"type": "Number"
},
"options?": {
"name": "options?",
"type": "Zoom/pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-flyto"
},
"flyToBounds": {
"name": "flyToBounds",
"aka": [],
"comments": [
"Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),",
"but takes a bounds parameter like [`fitBounds`](#map-fitbounds)."
],
"params": {
"bounds": {
"name": "bounds",
"type": "LatLngBounds"
},
"options?": {
"name": "options?",
"type": "fitBounds options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-flytobounds"
},
"setMaxBounds": {
"name": "setMaxBounds",
"aka": [],
"comments": [
"Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option)."
],
"params": {
"bounds": {
"name": "bounds",
"type": "Bounds"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setmaxbounds"
},
"setMinZoom": {
"name": "setMinZoom",
"aka": [],
"comments": [
"Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option)."
],
"params": {
"zoom": {
"name": "zoom",
"type": "Number"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setminzoom"
},
"setMaxZoom": {
"name": "setMaxZoom",
"aka": [],
"comments": [
"Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option)."
],
"params": {
"zoom": {
"name": "zoom",
"type": "Number"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-setmaxzoom"
},
"panInsideBounds": {
"name": "panInsideBounds",
"aka": [],
"comments": [
"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."
],
"params": {
"bounds": {
"name": "bounds",
"type": "LatLngBounds"
},
"options?": {
"name": "options?",
"type": "Pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-paninsidebounds"
},
"invalidateSize": {
"name": "invalidateSize",
"aka": [],
"comments": [
"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."
],
"params": {
"options": {
"name": "options",
"type": "Zoom/Pan options"
}
},
"type": "this",
"optional": false,
"defaultValue": null,
"id": "map-invalidatesize"
},
"invalidateSize-alternative-1": {
"name": "invalidateSize",
"aka": [],
"comments": [
"Checks if the map container size ch