@types/leaflet
- Version 1.9.16
- Published
- 113 kB
- 1 dependency
- MIT license
Install
npm i @types/leaflet
yarn add @types/leaflet
pnpm add @types/leaflet
Overview
TypeScript definitions for leaflet
Index
Variables
Functions
Classes
Layer
- addInteractiveTarget()
- addTo()
- beforeAdd()
- bindPopup()
- bindTooltip()
- closePopup()
- closeTooltip()
- getAttribution()
- getEvents()
- getPane()
- getPopup()
- getTooltip()
- isPopupOpen()
- isTooltipOpen()
- onAdd()
- onRemove()
- openPopup()
- openTooltip()
- options
- remove()
- removeFrom()
- removeInteractiveTarget()
- setPopupContent()
- setTooltipContent()
- togglePopup()
- toggleTooltip()
- unbindPopup()
- unbindTooltip()
Map
- addControl()
- addHandler()
- addLayer()
- attributionControl
- boxZoom
- closePopup()
- closeTooltip()
- containerPointToLatLng()
- containerPointToLayerPoint()
- createPane()
- distance()
- doubleClickZoom
- dragging
- eachLayer()
- fitBounds()
- fitWorld()
- flyTo()
- flyToBounds()
- getBounds()
- getBoundsZoom()
- getCenter()
- getContainer()
- getMaxZoom()
- getMinZoom()
- getPane()
- getPanes()
- getPixelBounds()
- getPixelOrigin()
- getPixelWorldBounds()
- getRenderer()
- getScaleZoom()
- getSize()
- getZoom()
- getZoomScale()
- hasLayer()
- invalidateSize()
- keyboard
- latLngToContainerPoint()
- latLngToLayerPoint()
- layerPointToContainerPoint()
- layerPointToLatLng()
- locate()
- mouseEventToContainerPoint()
- mouseEventToLatLng()
- mouseEventToLayerPoint()
- openPopup()
- openTooltip()
- options
- panBy()
- panInside()
- panInsideBounds()
- panTo()
- project()
- remove()
- removeControl()
- removeLayer()
- scrollWheelZoom
- setMaxBounds()
- setMaxZoom()
- setMinZoom()
- setView()
- setZoom()
- setZoomAround()
- stop()
- stopLocate()
- tapHold
- touchZoom
- unproject()
- whenReady()
- wrapLatLng()
- wrapLatLngBounds()
- zoomControl
- zoomIn()
- zoomOut()
Interfaces
LeafletEventHandlerFnMap
- add
- autopanstart
- baselayerchange
- click
- contextmenu
- dblclick
- down
- drag
- dragend
- dragstart
- error
- keydown
- keypress
- keyup
- layeradd
- layerremove
- load
- loading
- locationerror
- locationfound
- mousedown
- mousemove
- mouseout
- mouseover
- mouseup
- move
- moveend
- movestart
- overlayadd
- overlayremove
- popupclose
- popupopen
- preclick
- predrag
- remove
- resize
- tileabort
- tileerror
- tileload
- tileloadstart
- tileunload
- tooltipclose
- tooltipopen
- unload
- update
- viewreset
- zoom
- zoomanim
- zoomend
- zoomlevelschange
- zoomstart
MapOptions
- attributionControl
- bounceAtZoomLimits
- boxZoom
- center
- closePopupOnClick
- crs
- doubleClickZoom
- dragging
- easeLinearity
- fadeAnimation
- inertia
- inertiaDeceleration
- inertiaMaxSpeed
- keyboard
- keyboardPanDelta
- layers
- markerZoomAnimation
- maxBounds
- maxBoundsViscosity
- maxZoom
- minZoom
- preferCanvas
- renderer
- scrollWheelZoom
- tapHold
- tapTolerance
- touchZoom
- trackResize
- transform3DLimit
- wheelDebounceTime
- wheelPxPerZoomLevel
- worldCopyJump
- zoom
- zoomAnimation
- zoomAnimationThreshold
- zoomControl
- zoomDelta
- zoomSnap
Type Aliases
- BoundsExpression
- BoundsLiteral
- CircleOptions
- Content
- ControlPosition
- CrossOrigin
- Direction
- DoneCallback
- DragEndEventHandlerFn
- ErrorEventHandlerFn
- FillRule
- LatLngBoundsExpression
- LatLngBoundsLiteral
- LatLngExpression
- LatLngTuple
- LayerEventHandlerFn
- LayersControlEventHandlerFn
- LeafletEventHandlerFn
- LeafletKeyboardEventHandlerFn
- LeafletMouseEventHandlerFn
- LineCapShape
- LineJoinShape
- LocationEventHandlerFn
- PointExpression
- PointTuple
- PopupEventHandlerFn
- ReferrerPolicy
- ResizeEventHandlerFn
- StyleFunction
- SVGOverlayStyleOptions
- TileErrorEventHandlerFn
- TileEventHandlerFn
- TooltipEventHandlerFn
- Zoom
- ZoomAnimEventHandlerFn
Namespaces
DomUtil
- addClass()
- create()
- disableImageDrag()
- disableTextSelection()
- empty()
- enableImageDrag()
- enableTextSelection()
- get()
- getClass()
- getPosition()
- getScale()
- getSizedParentNode()
- getStyle()
- hasClass()
- preventOutline()
- remove()
- removeClass()
- restoreOutline()
- setClass()
- setOpacity()
- setPosition()
- setTransform()
- testProp()
- toBack()
- toFront()
- TRANSFORM
- TRANSITION
- TRANSITION_END
Variables
variable bind
const bind: (fn: (...args: any[]) => void, ...obj: any[]) => () => void;
variable extend
const extend: { <D extends object, S1 extends object = {}>(dest: D, src?: S1): D & S1; <D extends object, S1 extends object, S2 extends object>( dest: D, src1: S1, src2: S2 ): D & S1 & S2; <D extends object, S1 extends object, S2 extends object, S3 extends object>( dest: D, src1: S1, src2: S2, src3: S3 ): D & S1 & S2 & S3; (dest: any, ...src: any[]): any;};
variable Mixin
const Mixin: MixinType;
variable setOptions
const setOptions: (obj: any, options: any) => any;
variable stamp
const stamp: (obj: any) => number;
variable version
const version: string;
A constant that represents the Leaflet version in use.
Functions
function bounds
bounds: { (topLeft: PointExpression, bottomRight: PointExpression): Bounds; (points: Point[] | BoundsLiteral): Bounds;};
function canvas
canvas: (options?: RendererOptions) => Canvas;
function circle
circle: { <P = any>(latlng: LatLngExpression, options: CircleMarkerOptions): Circle<P>; <P = any>( latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions ): Circle<P>;};
Deprecated
Passing the radius outside the options is deperecated. Use instead.
function circleMarker
circleMarker: <P = any>( latlng: LatLngExpression, options?: CircleMarkerOptions) => CircleMarker<P>;
function divIcon
divIcon: (options?: DivIconOptions) => DivIcon;
function featureGroup
featureGroup: <P = any>( layers?: Layer[], options?: LayerOptions) => FeatureGroup<P>;
Create a feature group, optionally given an initial set of layers.
function geoJson
geoJson: <P = any, G extends geojson.GeometryObject = geojson.GeometryObject>( geojson?: geojson.GeoJsonObject | geojson.GeoJsonObject[] | null, options?: GeoJSONOptions<P, G> | null) => GeoJSON<P, G>;
function geoJSON
geoJSON: <P = any, G extends geojson.GeometryObject = geojson.GeometryObject>( geojson?: geojson.GeoJsonObject | geojson.GeoJsonObject[] | null, options?: GeoJSONOptions<P, G> | null) => GeoJSON<P, G>;
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.
function gridLayer
gridLayer: (options?: GridLayerOptions) => GridLayer;
function icon
icon: (options: IconOptions) => Icon;
function imageOverlay
imageOverlay: ( imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions) => ImageOverlay;
function latLng
latLng: { (latitude: number, longitude: number, altitude?: number): LatLng; ( coords: | LatLngTuple | [number, number, number] | LatLngLiteral | { lat: number; lng: number; alt?: number } ): LatLng;};
function latLngBounds
latLngBounds: { (southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds; (latlngs: LatLngExpression[]): LatLngBounds;};
function layerGroup
layerGroup: <P = any>(layers?: Layer[], options?: LayerOptions) => LayerGroup<P>;
Create a layer group, optionally given an initial set of layers and an
options
object.
function map
map: (element: string | HTMLElement, options?: MapOptions) => Map;
ID of a HTML-Element as string or the HTML-ELement itself
function marker
marker: <P = any>( latlng: LatLngExpression, options?: MarkerOptions) => Marker<P>;
function noConflict
noConflict: () => any;
function point
point: { (x: number, y: number, round?: boolean): Point; (coords: PointTuple | { x: number; y: number }): Point;};
function polygon
polygon: <P = any>( latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions) => Polygon<P>;
function polyline
polyline: <T extends geojson.GeometryObject = any, P = any>( latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions) => Polyline<T, P>;
function popup
popup: (options?: PopupOptions, source?: Layer) => Popup;
function rectangle
rectangle: <P = any>( latLngBounds: LatLngBoundsExpression, options?: PolylineOptions) => Rectangle<P>;
function svg
svg: (options?: RendererOptions) => SVG;
function svgOverlay
svgOverlay: ( svgImage: string | SVGElement, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions) => SVGOverlay;
function tileLayer
tileLayer: typeof tileLayer;
function tooltip
tooltip: (options?: TooltipOptions, source?: Layer) => Tooltip;
function transformation
transformation: { (a: number, b: number, c: number, d: number): Transformation; (coefficients: [number, number, number, number]): Transformation;};
Instantiates a Transformation object with the given coefficients.
Expects an coefficients array of the form
[a: Number, b: Number, c: Number, d: Number]
.
function videoOverlay
videoOverlay: ( video: string | string[] | HTMLVideoElement, bounds: LatLngBoundsExpression, options?: VideoOverlayOptions) => VideoOverlay;
Classes
class Bounds
class Bounds {}
constructor
constructor(topLeft: PointExpression, bottomRight: PointExpression);
constructor
constructor(points?: Point[] | BoundsLiteral);
property max
max?: Point;
property min
min?: Point;
method contains
contains: (pointOrBounds: BoundsExpression | PointExpression) => boolean;
method equals
equals: (otherBounds: BoundsExpression) => boolean;
method extend
extend: { (point: PointExpression): this; (otherBounds: BoundsExpression): this;};
method getBottomLeft
getBottomLeft: () => Point;
method getBottomRight
getBottomRight: () => Point;
method getCenter
getCenter: (round?: boolean) => Point;
method getSize
getSize: () => Point;
method getTopLeft
getTopLeft: () => Point;
method getTopRight
getTopRight: () => Point;
method intersects
intersects: (otherBounds: BoundsExpression) => boolean;
method isValid
isValid: () => boolean;
method overlaps
overlaps: (otherBounds: BoundsExpression) => boolean;
method pad
pad: (bufferRatio: number) => Bounds;
class Canvas
class Canvas extends Renderer {}
class Circle
class Circle<P = any> extends CircleMarker<P> {}
constructor
constructor(latlng: LatLngExpression, options: CircleMarkerOptions);
constructor
constructor( latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions);
method getBounds
getBounds: () => LatLngBounds;
method getRadius
getRadius: () => number;
method setRadius
setRadius: (radius: number) => this;
method setStyle
setStyle: (style: PathOptions) => this;
method toGeoJSON
toGeoJSON: (precision?: number | false) => any;
class CircleMarker
class CircleMarker<P = any> extends Path {}
constructor
constructor(latlng: LatLngExpression, options: CircleMarkerOptions);
property feature
feature?: any;
property options
options: CircleMarkerOptions;
method getLatLng
getLatLng: () => LatLng;
method getRadius
getRadius: () => number;
method setLatLng
setLatLng: (latLng: LatLngExpression) => this;
method setRadius
setRadius: (radius: number) => this;
method setStyle
setStyle: (options: Partial<CircleMarkerOptions>) => this;
method toGeoJSON
toGeoJSON: (precision?: number | false) => geojson.Feature<geojson.Point, P>;
class Class
class Class {}
method addInitHook
static addInitHook: { (initHookFn: () => void): any & typeof Class; (methodName: string, ...args: any[]): any;};
method callInitHooks
static callInitHooks: () => void;
method extend
static extend: (props: any) => (new (...args: any[]) => any) & typeof Class;
method include
static include: (props: any) => any & typeof Class;
method mergeOptions
static mergeOptions: (props: any) => any & typeof Class;
class Control
class Control<Options extends ControlOptions = ControlOptions> extends Class {}
constructor
constructor(options?: ControlOptions);
property options
options: ControlOptions;
method addTo
addTo: (map: Map) => this;
method extend
static extend: any;
method getContainer
getContainer: () => HTMLElement | undefined;
method getPosition
getPosition: () => ControlPosition;
method onAdd
onAdd: (map: Map) => HTMLElement;
method onRemove
onRemove: (map: Map) => void;
method remove
remove: () => this;
method setPosition
setPosition: (position: ControlPosition) => this;
class DivIcon
class DivIcon extends Icon<DivIconOptions> {}
constructor
constructor(options?: DivIconOptions);
class DivOverlay
abstract class DivOverlay extends Layer {}
constructor
constructor(latlng: LatLngExpression, options?: TooltipOptions);
constructor
constructor(options?: DivOverlayOptions, source?: Layer);
property options
options: DivOverlayOptions;
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method close
close: () => this;
method getContent
getContent: () => Content | ((source: Layer) => Content);
method getElement
getElement: () => HTMLElement | undefined;
method getLatLng
getLatLng: () => LatLng | undefined;
method isOpen
isOpen: () => boolean;
method openOn
openOn: (map: Map) => this;
method setContent
setContent: (htmlContent: Content | ((source: Layer) => Content)) => this;
method setLatLng
setLatLng: (latlng: LatLngExpression) => this;
method toggle
toggle: (layer?: Layer) => this;
method update
update: () => void;
class Draggable
class Draggable extends Evented {}
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
](#domutil-setposition).
constructor
constructor( element: HTMLElement, dragStartTarget?: HTMLElement, preventOutline?: boolean, options?: DraggableOptions);
method disable
disable: () => void;
method enable
enable: () => void;
method finishDrag
finishDrag: () => void;
class Evented
abstract class Evented extends Class {}
Base class of Leaflet classes supporting events
method addEventListener
addEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for on(...)
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').
Alias for on(...)
Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
method addEventParent
addEventParent: (obj: Evented) => this;
Adds an event parent - an Evented that will receive propagated events
method addOneTimeEventListener
addOneTimeEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for once(...)
Behaves as on(...), except the listener will only get fired once and then removed.
method clearAllEventListeners
clearAllEventListeners: () => this;
Alias for off()
Removes all listeners to all events on the object.
method fire
fire: (type: string, data?: any, propagate?: boolean) => this;
Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.
method fireEvent
fireEvent: (type: string, data?: any, propagate?: boolean) => this;
Alias for fire(...)
Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.
method hasEventListeners
hasEventListeners: (type: string) => boolean;
Alias for listens(...)
Returns true if a particular event type has any listeners attached to it.
method listens
listens: { ( type: | 'baselayerchange' | 'overlayadd' | 'overlayremove' | 'layeradd' | 'layerremove' | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag' | 'resize' | 'popupopen' | 'tooltipopen' | 'tooltipclose' | 'locationerror' | 'locationfound' | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick' | 'keypress' | 'keydown' | 'keyup' | 'zoomanim' | 'dragend' | 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort' | 'tileerror', propagate?: boolean ): boolean; ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'resize', fn: ResizeEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'locationerror', fn: ErrorEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'locationfound', fn: LocationEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'dragend', fn: DragEndEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tileerror', fn: TileEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: string, fn: LeafletEventHandlerFn, context?: any, propagate?: boolean ): boolean;};
Returns true if a particular event type has any listeners attached to it.
method off
off: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn?: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn?: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn?: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn?: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn?: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn?: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn?: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn?: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn?: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn?: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn?: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn?: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn?: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn?: TileErrorEventHandlerFn, context?: any): this; (type: string, fn?: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this; (): 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.
Removes a set of type/listener pairs.
Removes all listeners to all events on the object.
method on
on: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): 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').
Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
method once
once: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Behaves as on(...), except the listener will only get fired once and then removed.
method removeEventListener
removeEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn?: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn?: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn?: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn?: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn?: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn?: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn?: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn?: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn?: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn?: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn?: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn?: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn?: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn?: TileErrorEventHandlerFn, context?: any): this; (type: string, fn?: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for off(...)
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.
Alias for off(...)
Removes a set of type/listener pairs.
method removeEventParent
removeEventParent: (obj: Evented) => this;
Removes an event parent, so it will stop receiving propagated events
class Events
class Events {}
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).
method addEventListener
addEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for on(...)
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').
Alias for on(...)
Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
method addEventParent
addEventParent: (obj: Evented) => this;
Adds an event parent - an Evented that will receive propagated events
method addOneTimeEventListener
addOneTimeEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for once(...)
Behaves as on(...), except the listener will only get fired once and then removed.
method clearAllEventListeners
clearAllEventListeners: () => this;
Alias for off()
Removes all listeners to all events on the object.
method fire
fire: (type: string, data?: any, propagate?: boolean) => this;
Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.
method fireEvent
fireEvent: (type: string, data?: any, propagate?: boolean) => this;
Alias for fire(...)
Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.
method hasEventListeners
hasEventListeners: (type: string) => boolean;
Alias for listens(...)
Returns true if a particular event type has any listeners attached to it.
method listens
listens: { ( type: | 'baselayerchange' | 'overlayadd' | 'overlayremove' | 'layeradd' | 'layerremove' | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag' | 'resize' | 'popupopen' | 'tooltipopen' | 'tooltipclose' | 'locationerror' | 'locationfound' | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick' | 'keypress' | 'keydown' | 'keyup' | 'zoomanim' | 'dragend' | 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort' | 'tileerror', propagate?: boolean ): boolean; ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'resize', fn: ResizeEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'locationerror', fn: ErrorEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'locationfound', fn: LocationEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'dragend', fn: DragEndEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: 'tileerror', fn: TileEventHandlerFn, context?: any, propagate?: boolean ): boolean; ( type: string, fn: LeafletEventHandlerFn, context?: any, propagate?: boolean ): boolean;};
Returns true if a particular event type has any listeners attached to it.
method off
off: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn?: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn?: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn?: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn?: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn?: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn?: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn?: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn?: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn?: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn?: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn?: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn?: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn?: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn?: TileErrorEventHandlerFn, context?: any): this; (type: string, fn?: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this; (): 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.
Removes a set of type/listener pairs.
Removes all listeners to all events on the object.
method on
on: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileErrorEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): 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').
Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
method once
once: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn: TileEventHandlerFn, context?: any): this; (type: string, fn: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Behaves as on(...), except the listener will only get fired once and then removed.
method removeEventListener
removeEventListener: { ( type: 'baselayerchange' | 'overlayadd' | 'overlayremove', fn?: LayersControlEventHandlerFn, context?: any ): this; ( type: 'layeradd' | 'layerremove', fn?: LayerEventHandlerFn, context?: any ): this; ( type: | 'zoomlevelschange' | 'unload' | 'viewreset' | 'load' | 'zoomstart' | 'movestart' | 'zoom' | 'move' | 'zoomend' | 'moveend' | 'autopanstart' | 'dragstart' | 'drag' | 'add' | 'remove' | 'loading' | 'error' | 'update' | 'down' | 'predrag', fn?: LeafletEventHandlerFn, context?: any ): this; (type: 'resize', fn?: ResizeEventHandlerFn, context?: any): this; ( type: 'popupopen' | 'popupclose', fn?: PopupEventHandlerFn, context?: any ): this; ( type: 'tooltipopen' | 'tooltipclose', fn?: TooltipEventHandlerFn, context?: any ): this; (type: 'locationerror', fn?: ErrorEventHandlerFn, context?: any): this; (type: 'locationfound', fn?: LocationEventHandlerFn, context?: any): this; ( type: | 'click' | 'dblclick' | 'mousedown' | 'mouseup' | 'mouseover' | 'mouseout' | 'mousemove' | 'contextmenu' | 'preclick', fn?: LeafletMouseEventHandlerFn, context?: any ): this; ( type: 'keypress' | 'keydown' | 'keyup', fn?: LeafletKeyboardEventHandlerFn, context?: any ): this; (type: 'zoomanim', fn?: ZoomAnimEventHandlerFn, context?: any): this; (type: 'dragend', fn?: DragEndEventHandlerFn, context?: any): this; ( type: 'tileunload' | 'tileloadstart' | 'tileload' | 'tileabort', fn?: TileEventHandlerFn, context?: any ): this; (type: 'tileerror', fn?: TileErrorEventHandlerFn, context?: any): this; (type: string, fn?: LeafletEventHandlerFn, context?: any): this; (eventMap: LeafletEventHandlerFnMap): this;};
Alias for off(...)
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.
Alias for off(...)
Removes a set of type/listener pairs.
method removeEventParent
removeEventParent: (obj: Evented) => this;
Removes an event parent, so it will stop receiving propagated events
class FeatureGroup
class FeatureGroup<P = any> extends LayerGroup<P> {}
Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method.
method addLayer
addLayer: (layer: Layer) => this;
Adds the given layer to the group.
method bringToBack
bringToBack: () => this;
Brings the layer group to the top [sic] of all other layers
method bringToFront
bringToFront: () => this;
Brings the layer group to the top of all other layers
method getBounds
getBounds: () => LatLngBounds;
Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
method removeLayer
removeLayer: (layer: number | Layer) => this;
Removes the layer with the given internal ID or the given layer from the group.
method setStyle
setStyle: (style: PathOptions) => this;
Sets the given path options to each layer of the group that has a setStyle method.
class GeoJSON
class GeoJSON< P = any, G extends geojson.GeometryObject = geojson.GeometryObject> extends FeatureGroup<P> {}
Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
constructor
constructor(geojson?: any, options?: GeoJSONOptions<P, G>);
property options
options: GeoJSONOptions<P, G>;
method addData
addData: (data: geojson.GeoJsonObject) => this;
Adds a GeoJSON object to the layer.
method asFeature
static asFeature: < P = any, G extends geojson.GeometryObject = geojson.GeometryObject>( geojson: geojson.Feature<G, P> | G) => geojson.Feature<G, P>;
Normalize GeoJSON geometries/features into GeoJSON features.
method coordsToLatLng
static coordsToLatLng: ( coords: [number, number] | [number, number, number]) => LatLng;
Creates a LatLng object from an array of 2 numbers (longitude, latitude) or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
method coordsToLatLngs
static coordsToLatLngs: ( coords: any[], levelsDeep?: number, coordsToLatLng?: ( coords: [number, number] | [number, number, number] ) => LatLng) => any[];
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.
method geometryToLayer
static geometryToLayer: < P = any, G extends geojson.GeometryObject = geojson.GeometryObject>( featureData: geojson.Feature<G, P>, options?: GeoJSONOptions<P, G>) => Layer;
Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer and/or coordsToLatLng functions if provided as options.
method getFeature
static getFeature: < P = any, G extends geojson.GeometryObject = geojson.GeometryObject>( layer: Layer, newGeometry: geojson.Feature<G, P> | G) => geojson.Feature<G, P>;
Convert layer into GeoJSON feature
method latLngsToCoords
static latLngsToCoords: ( latlngs: any[], levelsDeep?: number, closed?: boolean) => any[];
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.
method latLngToCoords
static latLngToCoords: ( latlng: LatLng) => [number, number] | [number, number, number];
Reverse of coordsToLatLng
method resetStyle
resetStyle: (layer?: Layer) => this;
Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
method setStyle
setStyle: (style: PathOptions | StyleFunction<P>) => this;
Same as FeatureGroup's setStyle method, but style-functions are also allowed here to set the style according to the feature.
class GridLayer
class GridLayer extends Layer {}
constructor
constructor(options?: GridLayerOptions);
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method createTile
protected createTile: (coords: Coords, done: DoneCallback) => HTMLElement;
method getContainer
getContainer: () => HTMLElement | null;
method getTileSize
getTileSize: () => Point;
method isLoading
isLoading: () => boolean;
method redraw
redraw: () => this;
method setOpacity
setOpacity: (opacity: number) => this;
method setZIndex
setZIndex: (zIndex: number) => this;
class Handler
class Handler extends Class {}
constructor
constructor(map: Map);
method addHooks
addHooks: () => void;
method disable
disable: () => this;
method enable
enable: () => this;
method enabled
enabled: () => boolean;
method removeHooks
removeHooks: () => void;
class Icon
class Icon<T extends BaseIconOptions = IconOptions> extends Layer {}
constructor
constructor(options: BaseIconOptions);
property options
options: BaseIconOptions;
method createIcon
createIcon: (oldIcon?: HTMLElement) => HTMLElement;
method createShadow
createShadow: (oldIcon?: HTMLElement) => HTMLElement;
class ImageOverlay
class ImageOverlay extends Layer {}
constructor
constructor( imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions);
property options
options: ImageOverlayOptions;
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method getBounds
getBounds: () => LatLngBounds;
Get the bounds that this ImageOverlay covers
method getCenter
getCenter: () => Point;
Get the center of the bounds this ImageOverlay covers
method getElement
getElement: () => HTMLImageElement | undefined;
Get the img element that represents the ImageOverlay on the map
method setBounds
setBounds: (bounds: LatLngBounds) => this;
Update the bounds that this ImageOverlay covers
method setOpacity
setOpacity: (opacity: number) => this;
Changes the opacity of the image element
method setStyle
setStyle: (styleOpts: ImageOverlayStyleOptions) => this;
Changes the style of the image element. As of 1.8, only the opacity is changed
method setUrl
setUrl: (url: string) => this;
method setZIndex
setZIndex: (value: number) => this;
Changes the zIndex of the image overlay
class LatLng
class LatLng {}
constructor
constructor(latitude: number, longitude: number, altitude?: number);
property alt
alt?: number;
property lat
lat: number;
property lng
lng: number;
method clone
clone: () => LatLng;
method distanceTo
distanceTo: (otherLatLng: LatLngExpression) => number;
method equals
equals: (otherLatLng: LatLngExpression, maxMargin?: number) => boolean;
method toBounds
toBounds: (sizeInMeters: number) => LatLngBounds;
method toString
toString: () => string;
method wrap
wrap: () => LatLng;
class LatLngBounds
class LatLngBounds {}
constructor
constructor(southWest: LatLngExpression, northEast: LatLngExpression);
constructor
constructor(latlngs: LatLngExpression[]);
method contains
contains: ( otherBoundsOrLatLng: LatLngBoundsExpression | LatLngExpression) => boolean;
method equals
equals: (otherBounds: LatLngBoundsExpression, maxMargin?: number) => boolean;
method extend
extend: (latlngOrBounds: LatLngExpression | LatLngBoundsExpression) => this;
method getCenter
getCenter: () => LatLng;
method getEast
getEast: () => number;
method getNorth
getNorth: () => number;
method getNorthEast
getNorthEast: () => LatLng;
method getNorthWest
getNorthWest: () => LatLng;
method getSouth
getSouth: () => number;
method getSouthEast
getSouthEast: () => LatLng;
method getSouthWest
getSouthWest: () => LatLng;
method getWest
getWest: () => number;
method intersects
intersects: (otherBounds: LatLngBoundsExpression) => boolean;
method isValid
isValid: () => boolean;
method overlaps
overlaps: (otherBounds: LatLngBoundsExpression) => boolean;
method pad
pad: (bufferRatio: number) => LatLngBounds;
method toBBoxString
toBBoxString: () => string;
class Layer
class Layer extends Evented {}
constructor
constructor(options?: LayerOptions);
property options
options: LayerOptions;
method addInteractiveTarget
addInteractiveTarget: (targetEl: HTMLElement) => this;
method addTo
addTo: (map: Map | LayerGroup) => this;
method beforeAdd
beforeAdd: (map: Map) => this;
method bindPopup
bindPopup: ( content: Popup | ((layer: Layer) => Content) | Content, options?: PopupOptions) => this;
method bindTooltip
bindTooltip: ( content: Tooltip | Content | ((layer: Layer) => Content), options?: TooltipOptions) => this;
method closePopup
closePopup: () => this;
method closeTooltip
closeTooltip: () => this;
method getAttribution
getAttribution: () => string | null;
method getEvents
getEvents: () => { [name: string]: LeafletEventHandlerFn };
method getPane
getPane: (name?: string) => HTMLElement | undefined;
method getPopup
getPopup: () => Popup | undefined;
method getTooltip
getTooltip: () => Tooltip | undefined;
method isPopupOpen
isPopupOpen: () => boolean;
method isTooltipOpen
isTooltipOpen: () => boolean;
method onAdd
onAdd: (map: Map) => this;
method onRemove
onRemove: (map: Map) => this;
method openPopup
openPopup: (latlng?: LatLngExpression) => this;
method openTooltip
openTooltip: (latlng?: LatLngExpression) => this;
method remove
remove: () => this;
method removeFrom
removeFrom: (map: Map) => this;
method removeInteractiveTarget
removeInteractiveTarget: (targetEl: HTMLElement) => this;
method setPopupContent
setPopupContent: (content: Content | Popup) => this;
method setTooltipContent
setTooltipContent: (content: Content | Tooltip) => this;
method togglePopup
togglePopup: () => this;
method toggleTooltip
toggleTooltip: () => this;
method unbindPopup
unbindPopup: () => this;
method unbindTooltip
unbindTooltip: () => this;
class LayerGroup
class LayerGroup<P = any> extends Layer {}
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.
constructor
constructor(layers?: Layer[], options?: LayerOptions);
property feature
feature?: any;
method addLayer
addLayer: (layer: Layer) => this;
Adds the given layer to the group.
method clearLayers
clearLayers: () => this;
Removes all the layers from the group.
method eachLayer
eachLayer: (fn: (layer: Layer) => void, context?: any) => this;
Iterates over the layers of the group, optionally specifying context of the iterator function.
method getLayer
getLayer: (id: number) => Layer | undefined;
Returns the layer with the given internal ID.
method getLayerId
getLayerId: (layer: Layer) => number;
Returns the internal ID for a layer
method getLayers
getLayers: () => Layer[];
Returns an array of all the layers added to the group.
method hasLayer
hasLayer: (layer: Layer) => boolean;
Returns true if the given layer is currently added to the group.
method invoke
invoke: (methodName: string, ...params: any[]) => 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.
method removeLayer
removeLayer: (layer: number | Layer) => this;
Removes the layer with the given internal ID or the given layer from the group.
method setZIndex
setZIndex: (zIndex: number) => this;
Calls setZIndex on every layer contained in this group, passing the z-index.
method toGeoJSON
toGeoJSON: ( precision?: number | false) => | geojson.FeatureCollection<geojson.GeometryObject, P> | geojson.Feature<geojson.MultiPoint, P> | geojson.GeometryCollection;
Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection, GeoJSONFeatureCollection or Multipoint).
method toMultiPoint
toMultiPoint: (precision?: number) => geojson.Feature<geojson.MultiPoint, P>;
class Map
class Map extends Evented {}
constructor
constructor(element: string | HTMLElement, options?: MapOptions);
property attributionControl
attributionControl: Control.Attribution;
property boxZoom
boxZoom: Handler;
property doubleClickZoom
doubleClickZoom: Handler;
property dragging
dragging: Handler;
property keyboard
keyboard: Handler;
property options
options: MapOptions;
property scrollWheelZoom
scrollWheelZoom: Handler;
property tapHold
tapHold?: Handler;
property touchZoom
touchZoom: Handler;
property zoomControl
zoomControl: Control.Zoom;
method addControl
addControl: (control: Control) => this;
method addHandler
addHandler: (name: string, HandlerClass: typeof Handler) => this;
method addLayer
addLayer: (layer: Layer) => this;
method closePopup
closePopup: (popup?: Popup) => this;
method closeTooltip
closeTooltip: (tooltip?: Tooltip) => this;
method containerPointToLatLng
containerPointToLatLng: (point: PointExpression) => LatLng;
method containerPointToLayerPoint
containerPointToLayerPoint: (point: PointExpression) => Point;
method createPane
createPane: (name: string, container?: HTMLElement) => HTMLElement;
method distance
distance: (latlng1: LatLngExpression, latlng2: LatLngExpression) => number;
method eachLayer
eachLayer: (fn: (layer: Layer) => void, context?: any) => this;
method fitBounds
fitBounds: (bounds: LatLngBoundsExpression, options?: FitBoundsOptions) => this;
method fitWorld
fitWorld: (options?: FitBoundsOptions) => this;
method flyTo
flyTo: ( latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions) => this;
method flyToBounds
flyToBounds: ( bounds: LatLngBoundsExpression, options?: FitBoundsOptions) => this;
method getBounds
getBounds: () => LatLngBounds;
method getBoundsZoom
getBoundsZoom: ( bounds: LatLngBoundsExpression, inside?: boolean, padding?: Point) => number;
method getCenter
getCenter: () => LatLng;
method getContainer
getContainer: () => HTMLElement;
method getMaxZoom
getMaxZoom: () => number;
method getMinZoom
getMinZoom: () => number;
method getPane
getPane: (pane: string | HTMLElement) => HTMLElement | undefined;
Name of the pane or the pane as HTML-Element
method getPanes
getPanes: () => { [name: string]: HTMLElement } & DefaultMapPanes;
method getPixelBounds
getPixelBounds: () => Bounds;
method getPixelOrigin
getPixelOrigin: () => Point;
method getPixelWorldBounds
getPixelWorldBounds: (zoom?: number) => Bounds;
method getRenderer
getRenderer: (layer: Path) => Renderer;
method getScaleZoom
getScaleZoom: (scale: number, fromZoom?: number) => number;
method getSize
getSize: () => Point;
method getZoom
getZoom: () => number;
method getZoomScale
getZoomScale: (toZoom: number, fromZoom?: number) => number;
method hasLayer
hasLayer: (layer: Layer) => boolean;
method invalidateSize
invalidateSize: (options?: boolean | InvalidateSizeOptions) => this;
Boolean for animate or advanced ZoomPanOptions
method latLngToContainerPoint
latLngToContainerPoint: (latlng: LatLngExpression) => Point;
method latLngToLayerPoint
latLngToLayerPoint: (latlng: LatLngExpression) => Point;
method layerPointToContainerPoint
layerPointToContainerPoint: (point: PointExpression) => Point;
method layerPointToLatLng
layerPointToLatLng: (point: PointExpression) => LatLng;
method locate
locate: (options?: LocateOptions) => this;
method mouseEventToContainerPoint
mouseEventToContainerPoint: (ev: MouseEvent) => Point;
method mouseEventToLatLng
mouseEventToLatLng: (ev: MouseEvent) => LatLng;
method mouseEventToLayerPoint
mouseEventToLayerPoint: (ev: MouseEvent) => Point;
method openPopup
openPopup: { (popup: Popup): this; (content: Content, latlng: LatLngExpression, options?: PopupOptions): this;};
method openTooltip
openTooltip: { (tooltip: Tooltip): this; (content: Content, latlng: LatLngExpression, options?: TooltipOptions): this;};
method panBy
panBy: (offset: PointExpression, options?: PanOptions) => this;
method panInside
panInside: (latLng: LatLngExpression, options?: PanInsideOptions) => this;
method panInsideBounds
panInsideBounds: (bounds: LatLngBoundsExpression, options?: PanOptions) => this;
method panTo
panTo: (latlng: LatLngExpression, options?: PanOptions) => this;
method project
project: (latlng: LatLngExpression, zoom?: number) => Point;
method remove
remove: () => this;
method removeControl
removeControl: (control: Control) => this;
method removeLayer
removeLayer: (layer: Layer) => this;
method setMaxBounds
setMaxBounds: (bounds?: LatLngBoundsExpression) => this;
method setMaxZoom
setMaxZoom: (zoom: number) => this;
method setMinZoom
setMinZoom: (zoom: number) => this;
method setView
setView: ( center: LatLngExpression, zoom?: number, options?: ZoomPanOptions) => this;
method setZoom
setZoom: (zoom: number, options?: ZoomPanOptions) => this;
method setZoomAround
setZoomAround: ( position: Point | LatLngExpression, zoom: number, options?: ZoomOptions) => this;
method stop
stop: () => this;
method stopLocate
stopLocate: () => this;
method unproject
unproject: (point: PointExpression, zoom?: number) => LatLng;
method whenReady
whenReady: (fn: () => void, context?: any) => this;
method wrapLatLng
wrapLatLng: (latlng: LatLngExpression) => LatLng;
method wrapLatLngBounds
wrapLatLngBounds: (bounds: LatLngBounds) => LatLngBounds;
method zoomIn
zoomIn: (delta?: number, options?: ZoomOptions) => this;
method zoomOut
zoomOut: (delta?: number, options?: ZoomOptions) => this;
class Marker
class Marker<P = any> extends Layer {}
constructor
constructor(latlng: LatLngExpression, options?: MarkerOptions);
property dragging
dragging?: Handler;
property feature
feature?: any;
property options
options: MarkerOptions;
method getElement
getElement: () => HTMLElement | undefined;
method getIcon
getIcon: () => Icon | DivIcon;
method getLatLng
getLatLng: () => LatLng;
method setIcon
setIcon: (icon: Icon | DivIcon) => this;
method setLatLng
setLatLng: (latlng: LatLngExpression) => this;
method setOpacity
setOpacity: (opacity: number) => this;
method setZIndexOffset
setZIndexOffset: (offset: number) => this;
method toGeoJSON
toGeoJSON: (precision?: number | false) => geojson.Feature<geojson.Point, P>;
class Path
abstract class Path extends Layer {}
property options
options: PathOptions;
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method getElement
getElement: () => Element | undefined;
method redraw
redraw: () => this;
method setStyle
setStyle: (style: PathOptions) => this;
class Point
class Point {}
constructor
constructor(x: number, y: number, round?: boolean);
property x
x: number;
property y
y: number;
method add
add: (otherPoint: PointExpression) => Point;
method ceil
ceil: () => Point;
method clone
clone: () => Point;
method contains
contains: (otherPoint: PointExpression) => boolean;
method distanceTo
distanceTo: (otherPoint: PointExpression) => number;
method divideBy
divideBy: (num: number) => Point;
method equals
equals: (otherPoint: PointExpression) => boolean;
method floor
floor: () => Point;
method multiplyBy
multiplyBy: (num: number) => Point;
method round
round: () => Point;
method scaleBy
scaleBy: (scale: PointExpression) => Point;
method subtract
subtract: (otherPoint: PointExpression) => Point;
method toString
toString: () => string;
method trunc
trunc: () => Point;
method unscaleBy
unscaleBy: (scale: PointExpression) => Point;
class Polygon
class Polygon<P = any> extends Polyline<geojson.Polygon | geojson.MultiPolygon, P> {}
constructor
constructor( latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions);
class Polyline
class Polyline< T extends geojson.GeometryObject = geojson.LineString | geojson.MultiLineString, P = any> extends Path {}
constructor
constructor( latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions);
property feature
feature?: any;
property options
options: PolylineOptions;
method addLatLng
addLatLng: ( latlng: LatLngExpression | LatLngExpression[], latlngs?: LatLng[]) => this;
method closestLayerPoint
closestLayerPoint: (p: Point) => Point;
method getBounds
getBounds: () => LatLngBounds;
method getCenter
getCenter: () => LatLng;
method getLatLngs
getLatLngs: () => LatLng[] | LatLng[][] | LatLng[][][];
method isEmpty
isEmpty: () => boolean;
method setLatLngs
setLatLngs: ( latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][]) => this;
method toGeoJSON
toGeoJSON: (precision?: number | false) => geojson.Feature<T, P>;
class Popup
class Popup extends DivOverlay {}
constructor
constructor(latlng: LatLngExpression, options?: TooltipOptions);
constructor
constructor(options?: PopupOptions, source?: Layer);
property options
options: PopupOptions;
method openOn
openOn: (map: Map) => this;
class PosAnimation
class PosAnimation extends Evented {}
class Rectangle
class Rectangle<P = any> extends Polygon<P> {}
constructor
constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
method setBounds
setBounds: (latLngBounds: LatLngBoundsExpression) => this;
class Renderer
class Renderer extends Layer {}
constructor
constructor(options?: RendererOptions);
property options
options: RendererOptions;
class SVG
class SVG extends Renderer {}
class SVGOverlay
class SVGOverlay extends Layer {}
constructor
constructor( svgImage: string | SVGElement, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions);
SVGOverlay doesn't extend ImageOverlay because SVGOverlay.getElement returns SVGElement
property options
options: ImageOverlayOptions;
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method getBounds
getBounds: () => LatLngBounds;
Get the bounds that this SVGOverlay covers
method getCenter
getCenter: () => Point;
Get the center of the bounds this ImageOverlay covers
method getElement
getElement: () => SVGElement | undefined;
Get the img element that represents the SVGOverlay on the map
method setBounds
setBounds: (bounds: LatLngBounds) => this;
Update the bounds that this SVGOverlay covers
method setOpacity
setOpacity: (opacity: number) => this;
Changes the opacity of the image element
method setStyle
setStyle: (styleOpts: SVGOverlayStyleOptions) => this;
Changes the style of the image element. As of 1.8, only the opacity is changed
method setUrl
setUrl: (url: string) => this;
method setZIndex
setZIndex: (value: number) => this;
Changes the zIndex of the image overlay
class TileLayer
class TileLayer extends GridLayer {}
constructor
constructor(urlTemplate: string, options?: TileLayerOptions);
property options
options: TileLayerOptions;
method getTileUrl
getTileUrl: (coords: L.Coords) => string;
method setUrl
setUrl: (url: string, noRedraw?: boolean) => this;
class Tooltip
class Tooltip extends DivOverlay {}
constructor
constructor(latlng: LatLngExpression, options?: TooltipOptions);
constructor
constructor(options?: TooltipOptions, source?: Layer);
property options
options: TooltipOptions;
method setOpacity
setOpacity: (val: number) => void;
class Transformation
class Transformation {}
constructor
constructor(a: number, b: number, c: number, d: number);
method transform
transform: (point: Point, scale?: number) => Point;
method untransform
untransform: (point: Point, scale?: number) => Point;
class VideoOverlay
class VideoOverlay extends Layer {}
constructor
constructor( video: string | string[] | HTMLVideoElement, bounds: LatLngBoundsExpression, options?: VideoOverlayOptions);
VideoOverlay doesn't extend ImageOverlay because VideoOverlay.getElement returns HTMLImageElement
property options
options: VideoOverlayOptions;
method bringToBack
bringToBack: () => this;
method bringToFront
bringToFront: () => this;
method getBounds
getBounds: () => LatLngBounds;
Get the bounds that this VideoOverlay covers
method getCenter
getCenter: () => Point;
Get the center of the bounds this ImageOverlay covers
method getElement
getElement: () => HTMLVideoElement | undefined;
Get the video element that represents the VideoOverlay on the map
method setBounds
setBounds: (bounds: LatLngBounds) => this;
Update the bounds that this VideoOverlay covers
method setOpacity
setOpacity: (opacity: number) => this;
Changes the opacity of the image element
method setStyle
setStyle: (styleOpts: SVGOverlayStyleOptions) => this;
Changes the style of the image element. As of 1.8, only the opacity is changed
method setUrl
setUrl: (url: string) => this;
method setZIndex
setZIndex: (value: number) => this;
Changes the zIndex of the image overlay
Interfaces
interface BaseIconOptions
interface BaseIconOptions extends LayerOptions {}
property className
className?: string | undefined;
property iconAnchor
iconAnchor?: PointExpression | undefined;
property iconRetinaUrl
iconRetinaUrl?: string | undefined;
property iconSize
iconSize?: PointExpression | undefined;
property iconUrl
iconUrl?: string | undefined;
property popupAnchor
popupAnchor?: PointExpression | undefined;
property shadowAnchor
shadowAnchor?: PointExpression | undefined;
property shadowRetinaUrl
shadowRetinaUrl?: string | undefined;
property shadowSize
shadowSize?: PointExpression | undefined;
property shadowUrl
shadowUrl?: string | undefined;
property tooltipAnchor
tooltipAnchor?: PointExpression | undefined;
interface CircleMarkerOptions
interface CircleMarkerOptions extends PathOptions {}
property radius
radius: number;
interface ControlOptions
interface ControlOptions {}
property position
position?: ControlPosition | undefined;
interface CRS
interface CRS {}
property code
code?: string | undefined;
property infinite
infinite: boolean;
property wrapLat
wrapLat?: [number, number] | undefined;
property wrapLng
wrapLng?: [number, number] | undefined;
method distance
distance: (latlng1: LatLngExpression, latlng2: LatLngExpression) => number;
method getProjectedBounds
getProjectedBounds: (zoom: number) => Bounds;
method latLngToPoint
latLngToPoint: (latlng: LatLngExpression, zoom: number) => Point;
method pointToLatLng
pointToLatLng: (point: PointExpression, zoom: number) => LatLng;
method project
project: (latlng: LatLng | LatLngLiteral) => Point;
method scale
scale: (zoom: number) => number;
method unproject
unproject: (point: PointExpression) => LatLng;
method wrapLatLng
wrapLatLng: (latlng: LatLng | LatLngLiteral) => LatLng;
method zoom
zoom: (scale: number) => number;
interface DefaultMapPanes
interface DefaultMapPanes {}
property mapPane
mapPane: HTMLElement;
property markerPane
markerPane: HTMLElement;
property overlayPane
overlayPane: HTMLElement;
property popupPane
popupPane: HTMLElement;
property shadowPane
shadowPane: HTMLElement;
property tilePane
tilePane: HTMLElement;
property tooltipPane
tooltipPane: HTMLElement;
interface DivIconOptions
interface DivIconOptions extends BaseIconOptions {}
property bgPos
bgPos?: PointExpression | undefined;
property className
className?: string | undefined;
property html
html?: string | HTMLElement | false | undefined;
property iconAnchor
iconAnchor?: PointExpression | undefined;
property iconSize
iconSize?: PointExpression | undefined;
property popupAnchor
popupAnchor?: PointExpression | undefined;
interface DivOverlayOptions
interface DivOverlayOptions {}
property className
className?: string | undefined;
property content
content?: | string | HTMLElement | ((layer: Layer) => string) | ((layer: Layer) => HTMLElement);
property interactive
interactive?: boolean | undefined;
property offset
offset?: PointExpression | undefined;
property pane
pane?: string | undefined;
interface DragEndEvent
interface DragEndEvent extends LeafletEvent {}
property distance
distance: number;
interface DraggableOptions
interface DraggableOptions {}
property clickTolerance
clickTolerance: number;
The 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).
interface ErrorEvent
interface ErrorEvent extends LeafletEvent {}
interface FitBoundsOptions
interface FitBoundsOptions extends ZoomOptions, PanOptions {}
property maxZoom
maxZoom?: number | undefined;
property padding
padding?: PointExpression | undefined;
property paddingBottomRight
paddingBottomRight?: PointExpression | undefined;
property paddingTopLeft
paddingTopLeft?: PointExpression | undefined;
interface GeoJSONEvent
interface GeoJSONEvent extends LeafletEvent {}
property geometryType
geometryType: string;
property id
id: string;
property layer
layer: Layer;
property properties
properties: any;
interface GeoJSONOptions
interface GeoJSONOptions< P = any, G extends geojson.GeometryObject = geojson.GeometryObject> extends InteractiveLayerOptions {}
property markersInheritOptions
markersInheritOptions?: boolean | undefined;
Whether default Markers for "Point" type Features inherit from group options.
property style
style?: PathOptions | StyleFunction<P> | undefined;
PathOptions or 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 {}}
method coordsToLatLng
coordsToLatLng: (coords: [number, number] | [number, number, number]) => LatLng;
A Function that will be used for converting GeoJSON coordinates to LatLngs. The default is the coordsToLatLng static method.
method filter
filter: (geoJsonFeature: geojson.Feature<G, P>) => boolean;
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;}
method onEachFeature
onEachFeature: (feature: geojson.Feature<G, P>, layer: Layer) => void;
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) {}
method pointToLayer
pointToLayer: ( geoJsonPoint: geojson.Feature<geojson.Point, P>, latlng: LatLng) => Layer;
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);}
interface GridLayerOptions
interface GridLayerOptions extends LayerOptions {}
property bounds
bounds?: LatLngBoundsExpression | undefined;
property className
className?: string | undefined;
property keepBuffer
keepBuffer?: number | undefined;
property maxNativeZoom
maxNativeZoom?: number | undefined;
Maximum zoom number the tile source has available. If it is specified, the tiles on all zoom levels higher than
maxNativeZoom
will be loaded frommaxNativeZoom
level and auto-scaled.
property maxZoom
maxZoom?: number | undefined;
property minNativeZoom
minNativeZoom?: number | undefined;
Minimum zoom number the tile source has available. If it is specified, the tiles on all zoom levels lower than
minNativeZoom
will be loaded fromminNativeZoom
level and auto-scaled.
property minZoom
minZoom?: number | undefined;
property noWrap
noWrap?: boolean | undefined;
property opacity
opacity?: number | undefined;
property pane
pane?: string | undefined;
property tileSize
tileSize?: number | Point | undefined;
property updateInterval
updateInterval?: number | undefined;
property updateWhenIdle
updateWhenIdle?: boolean | undefined;
property updateWhenZooming
updateWhenZooming?: boolean | undefined;
property zIndex
zIndex?: number | undefined;
interface IconOptions
interface IconOptions extends BaseIconOptions {}
property crossOrigin
crossOrigin?: CrossOrigin | boolean | undefined;
property iconUrl
iconUrl: string;
interface ImageOverlayOptions
interface ImageOverlayOptions extends InteractiveLayerOptions {}
property alt
alt?: string | undefined;
property className
className?: string | undefined;
property crossOrigin
crossOrigin?: CrossOrigin | boolean | undefined;
property errorOverlayUrl
errorOverlayUrl?: string | undefined;
property interactive
interactive?: boolean | undefined;
property opacity
opacity?: number | undefined;
property zIndex
zIndex?: number | undefined;
interface ImageOverlayStyleOptions
interface ImageOverlayStyleOptions {}
property opacity
opacity?: number;
index signature
[name: string]: any;
interface InteractiveLayerOptions
interface InteractiveLayerOptions extends LayerOptions {}
property bubblingMouseEvents
bubblingMouseEvents?: boolean | undefined;
property interactive
interactive?: boolean | undefined;
interface InternalTiles
interface InternalTiles {}
index signature
[key: string]: { active?: boolean | undefined; coords: Coords; current: boolean; el: HTMLElement; loaded?: Date | undefined; retain?: boolean | undefined;};
interface InvalidateSizeOptions
interface InvalidateSizeOptions extends ZoomPanOptions {}
property debounceMoveend
debounceMoveend?: boolean | undefined;
property pan
pan?: boolean | undefined;
interface LatLngLiteral
interface LatLngLiteral {}
interface LayerEvent
interface LayerEvent extends LeafletEvent {}
property layer
layer: Layer;
interface LayerOptions
interface LayerOptions {}
property attribution
attribution?: string | undefined;
property pane
pane?: string | undefined;
interface LayersControlEvent
interface LayersControlEvent extends LayerEvent {}
property name
name: string;
interface LeafletEvent
interface LeafletEvent {}
property layer
layer: any;
Deprecated
The same as .
property popup
popup: any;
property propagatedFrom
propagatedFrom: any;
property sourceTarget
sourceTarget: any;
property target
target: any;
property type
type: string;
interface LeafletEventHandlerFnMap
interface LeafletEventHandlerFnMap {}
property add
add?: LeafletEventHandlerFn | undefined;
property autopanstart
autopanstart?: LeafletEventHandlerFn | undefined;
property baselayerchange
baselayerchange?: LayersControlEventHandlerFn | undefined;
property click
click?: LeafletMouseEventHandlerFn | undefined;
property contextmenu
contextmenu?: LeafletMouseEventHandlerFn | undefined;
property dblclick
dblclick?: LeafletMouseEventHandlerFn | undefined;
property down
down?: LeafletEventHandlerFn | undefined;
property drag
drag?: LeafletEventHandlerFn | undefined;
property dragend
dragend?: DragEndEventHandlerFn | undefined;
property dragstart
dragstart?: LeafletEventHandlerFn | undefined;
property error
error?: LeafletEventHandlerFn | undefined;
property keydown
keydown?: LeafletKeyboardEventHandlerFn | undefined;
property keypress
keypress?: LeafletKeyboardEventHandlerFn | undefined;
property keyup
keyup?: LeafletKeyboardEventHandlerFn | undefined;
property layeradd
layeradd?: LayerEventHandlerFn | undefined;
property layerremove
layerremove?: LayerEventHandlerFn | undefined;
property load
load?: LeafletEventHandlerFn | undefined;
property loading
loading?: LeafletEventHandlerFn | undefined;
property locationerror
locationerror?: ErrorEventHandlerFn | undefined;
property locationfound
locationfound?: LocationEventHandlerFn | undefined;
property mousedown
mousedown?: LeafletMouseEventHandlerFn | undefined;
property mousemove
mousemove?: LeafletMouseEventHandlerFn | undefined;
property mouseout
mouseout?: LeafletMouseEventHandlerFn | undefined;
property mouseover
mouseover?: LeafletMouseEventHandlerFn | undefined;
property mouseup
mouseup?: LeafletMouseEventHandlerFn | undefined;
property move
move?: LeafletEventHandlerFn | undefined;
property moveend
moveend?: LeafletEventHandlerFn | undefined;
property movestart
movestart?: LeafletEventHandlerFn | undefined;
property overlayadd
overlayadd?: LayersControlEventHandlerFn | undefined;
property overlayremove
overlayremove?: LayersControlEventHandlerFn | undefined;
property popupclose
popupclose?: PopupEventHandlerFn | undefined;
property popupopen
popupopen?: PopupEventHandlerFn | undefined;
property preclick
preclick?: LeafletMouseEventHandlerFn | undefined;
property predrag
predrag?: LeafletEventHandlerFn | undefined;
property remove
remove?: LeafletEventHandlerFn | undefined;
property resize
resize?: ResizeEventHandlerFn | undefined;
property tileabort
tileabort?: TileEventHandlerFn | undefined;
property tileerror
tileerror?: TileErrorEventHandlerFn | undefined;
property tileload
tileload?: TileEventHandlerFn | undefined;
property tileloadstart
tileloadstart?: TileEventHandlerFn | undefined;
property tileunload
tileunload?: TileEventHandlerFn | undefined;
property tooltipclose
tooltipclose?: TooltipEventHandlerFn | undefined;
property tooltipopen
tooltipopen?: TooltipEventHandlerFn | undefined;
property unload
unload?: LeafletEventHandlerFn | undefined;
property update
update?: LeafletEventHandlerFn | undefined;
property viewreset
viewreset?: LeafletEventHandlerFn | undefined;
property zoom
zoom?: LeafletEventHandlerFn | undefined;
property zoomanim
zoomanim?: ZoomAnimEventHandlerFn | undefined;
property zoomend
zoomend?: LeafletEventHandlerFn | undefined;
property zoomlevelschange
zoomlevelschange?: LeafletEventHandlerFn | undefined;
property zoomstart
zoomstart?: LeafletEventHandlerFn | undefined;
interface LeafletKeyboardEvent
interface LeafletKeyboardEvent extends LeafletEvent {}
property originalEvent
originalEvent: KeyboardEvent;
interface LeafletMouseEvent
interface LeafletMouseEvent extends LeafletEvent {}
property containerPoint
containerPoint: Point;
property latlng
latlng: LatLng;
property layerPoint
layerPoint: Point;
property originalEvent
originalEvent: MouseEvent;
interface LocateOptions
interface LocateOptions {}
property enableHighAccuracy
enableHighAccuracy?: boolean | undefined;
property maximumAge
maximumAge?: number | undefined;
property maxZoom
maxZoom?: number | undefined;
property setView
setView?: boolean | undefined;
property timeout
timeout?: number | undefined;
property watch
watch?: boolean | undefined;
interface LocationEvent
interface LocationEvent extends LeafletEvent {}
interface MapOptions
interface MapOptions {}
property attributionControl
attributionControl?: boolean | undefined;
property bounceAtZoomLimits
bounceAtZoomLimits?: boolean | undefined;
property boxZoom
boxZoom?: boolean | undefined;
property center
center?: LatLngExpression | undefined;
property closePopupOnClick
closePopupOnClick?: boolean | undefined;
property crs
crs?: CRS | undefined;
property doubleClickZoom
doubleClickZoom?: Zoom | undefined;
property dragging
dragging?: boolean | undefined;
property easeLinearity
easeLinearity?: number | undefined;
property fadeAnimation
fadeAnimation?: boolean | undefined;
property inertia
inertia?: boolean | undefined;
property inertiaDeceleration
inertiaDeceleration?: number | undefined;
property inertiaMaxSpeed
inertiaMaxSpeed?: number | undefined;
property keyboard
keyboard?: boolean | undefined;
property keyboardPanDelta
keyboardPanDelta?: number | undefined;
property layers
layers?: Layer[] | undefined;
property markerZoomAnimation
markerZoomAnimation?: boolean | undefined;
property maxBounds
maxBounds?: LatLngBoundsExpression | undefined;
property maxBoundsViscosity
maxBoundsViscosity?: number | undefined;
property maxZoom
maxZoom?: number | undefined;
property minZoom
minZoom?: number | undefined;
property preferCanvas
preferCanvas?: boolean | undefined;
property renderer
renderer?: Renderer | undefined;
property scrollWheelZoom
scrollWheelZoom?: Zoom | undefined;
property tapHold
tapHold?: boolean | undefined;
property tapTolerance
tapTolerance?: number | undefined;
property touchZoom
touchZoom?: Zoom | undefined;
property trackResize
trackResize?: boolean | undefined;
property transform3DLimit
transform3DLimit?: number | undefined;
property wheelDebounceTime
wheelDebounceTime?: number | undefined;
property wheelPxPerZoomLevel
wheelPxPerZoomLevel?: number | undefined;
property worldCopyJump
worldCopyJump?: boolean | undefined;
property zoom
zoom?: number | undefined;
property zoomAnimation
zoomAnimation?: boolean | undefined;
property zoomAnimationThreshold
zoomAnimationThreshold?: number | undefined;
property zoomControl
zoomControl?: boolean | undefined;
property zoomDelta
zoomDelta?: number | undefined;
property zoomSnap
zoomSnap?: number | undefined;
interface MarkerOptions
interface MarkerOptions extends InteractiveLayerOptions {}
property alt
alt?: string | undefined;
Text for the
alt
attribute of the icon image (useful for accessibility).
property autoPan
autoPan?: boolean | undefined;
Whether to pan the map when dragging this marker near its edge or not.
property autoPanOnFocus
autoPanOnFocus?: boolean | undefined;
property autoPanPadding
autoPanPadding?: PointExpression | undefined;
Distance (in pixels to the left/right and to the top/bottom) of the map edge to start panning the map.
property autoPanSpeed
autoPanSpeed?: number | undefined;
Number of pixels the map should pan by.
property draggable
draggable?: boolean | undefined;
Whether the marker is draggable with mouse/touch or not.
property icon
icon?: Icon | DivIcon | undefined;
property keyboard
keyboard?: boolean | undefined;
Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
property opacity
opacity?: number | undefined;
The opacity of the marker.
property riseOffset
riseOffset?: number | undefined;
The z-index offset used for the
riseOnHover
feature.
property riseOnHover
riseOnHover?: boolean | undefined;
If
true
, the marker will get on top of others when you hover the mouse over it.
property shadowPane
shadowPane?: string | undefined;
Map pane
where the markers shadow will be added.
property title
title?: string | undefined;
Text for the browser tooltip that appear on marker hover (no tooltip by default).
property zIndexOffset
zIndexOffset?: number | undefined;
Option for putting the marker on top of all others (or below).
interface PanInsideOptions
interface PanInsideOptions extends PanOptions {}
property padding
padding?: PointExpression | undefined;
property paddingBottomRight
paddingBottomRight?: PointExpression | undefined;
property paddingTopLeft
paddingTopLeft?: PointExpression | undefined;
interface PanOptions
interface PanOptions {}
property animate
animate?: boolean | undefined;
property duration
duration?: number | undefined;
property easeLinearity
easeLinearity?: number | undefined;
property noMoveStart
noMoveStart?: boolean | undefined;
interface PathOptions
interface PathOptions extends InteractiveLayerOptions {}
property className
className?: string | undefined;
property color
color?: string | undefined;
property dashArray
dashArray?: string | number[] | undefined;
property dashOffset
dashOffset?: string | undefined;
property fill
fill?: boolean | undefined;
property fillColor
fillColor?: string | undefined;
property fillOpacity
fillOpacity?: number | undefined;
property fillRule
fillRule?: FillRule | undefined;
property lineCap
lineCap?: LineCapShape | undefined;
property lineJoin
lineJoin?: LineJoinShape | undefined;
property opacity
opacity?: number | undefined;
property renderer
renderer?: Renderer | undefined;
property stroke
stroke?: boolean | undefined;
property weight
weight?: number | undefined;
interface PolylineOptions
interface PolylineOptions extends PathOptions {}
property noClip
noClip?: boolean | undefined;
property smoothFactor
smoothFactor?: number | undefined;
interface PopupEvent
interface PopupEvent extends LeafletEvent {}
property popup
popup: Popup;
interface PopupOptions
interface PopupOptions extends DivOverlayOptions {}
property autoClose
autoClose?: boolean | undefined;
property autoPan
autoPan?: boolean | undefined;
property autoPanPadding
autoPanPadding?: PointExpression | undefined;
property autoPanPaddingBottomRight
autoPanPaddingBottomRight?: PointExpression | undefined;
property autoPanPaddingTopLeft
autoPanPaddingTopLeft?: PointExpression | undefined;
property closeButton
closeButton?: boolean | undefined;
property closeOnClick
closeOnClick?: boolean | undefined;
property closeOnEscapeKey
closeOnEscapeKey?: boolean | undefined;
property keepInView
keepInView?: boolean | undefined;
property maxHeight
maxHeight?: number | undefined;
property maxWidth
maxWidth?: number | undefined;
property minWidth
minWidth?: number | undefined;
interface Projection
interface Projection {}
interface RendererOptions
interface RendererOptions extends LayerOptions {}
interface ResizeEvent
interface ResizeEvent extends LeafletEvent {}
interface TileErrorEvent
interface TileErrorEvent extends TileEvent {}
property error
error: Error;
interface TileEvent
interface TileEvent extends LeafletEvent {}
interface TileLayerOptions
interface TileLayerOptions extends GridLayerOptions {}
property accessToken
accessToken?: string | undefined;
property crossOrigin
crossOrigin?: CrossOrigin | boolean | undefined;
property detectRetina
detectRetina?: boolean | undefined;
property errorTileUrl
errorTileUrl?: string | undefined;
property id
id?: string | undefined;
property maxNativeZoom
maxNativeZoom?: number | undefined;
property maxZoom
maxZoom?: number | undefined;
property minNativeZoom
minNativeZoom?: number | undefined;
property minZoom
minZoom?: number | undefined;
property referrerPolicy
referrerPolicy?: ReferrerPolicy | boolean | undefined;
property subdomains
subdomains?: string | string[] | undefined;
property tms
tms?: boolean | undefined;
property zoomOffset
zoomOffset?: number | undefined;
property zoomReverse
zoomReverse?: boolean | undefined;
interface TooltipEvent
interface TooltipEvent extends LeafletEvent {}
property tooltip
tooltip: Tooltip;
interface TooltipOptions
interface TooltipOptions extends DivOverlayOptions {}
interface VideoOverlayOptions
interface VideoOverlayOptions extends ImageOverlayOptions {}
property autoplay
autoplay?: boolean | undefined;
Whether the video starts playing automatically when loaded.
property keepAspectRatio
keepAspectRatio?: boolean | undefined;
Whether the video will save aspect ratio after the projection. Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)
property loop
loop?: boolean | undefined;
Whether the video will loop back to the beginning when played.
property muted
muted?: boolean | undefined;
Whether the video starts on mute when loaded.
property playsInline
playsInline?: boolean | undefined;
interface WMSOptions
interface WMSOptions extends TileLayerOptions {}
property crs
crs?: CRS | undefined;
property format
format?: string | undefined;
property layers
layers?: string | undefined;
property styles
styles?: string | undefined;
property transparent
transparent?: boolean | undefined;
property uppercase
uppercase?: boolean | undefined;
property version
version?: string | undefined;
interface WMSParams
interface WMSParams {}
property format
format?: string | undefined;
property height
height?: number | undefined;
property layers
layers: string;
property request
request?: string | undefined;
property service
service?: string | undefined;
property styles
styles?: string | undefined;
property transparent
transparent?: boolean | undefined;
property version
version?: string | undefined;
property width
width?: number | undefined;
interface ZoomAnimEvent
interface ZoomAnimEvent extends LeafletEvent {}
interface ZoomOptions
interface ZoomOptions {}
property animate
animate?: boolean | undefined;
interface ZoomPanOptions
interface ZoomPanOptions extends ZoomOptions, PanOptions {}
Type Aliases
type BoundsExpression
type BoundsExpression = Bounds | BoundsLiteral;
type BoundsLiteral
type BoundsLiteral = [PointTuple, PointTuple];
type CircleOptions
type CircleOptions = CircleMarkerOptions;
type Content
type Content = string | HTMLElement;
type ControlPosition
type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
type CrossOrigin
type CrossOrigin = 'anonymous' | 'use-credentials' | '';
type Direction
type Direction = 'right' | 'left' | 'top' | 'bottom' | 'center' | 'auto';
type DoneCallback
type DoneCallback = (error?: Error, tile?: HTMLElement) => void;
type DragEndEventHandlerFn
type DragEndEventHandlerFn = (event: DragEndEvent) => void;
type ErrorEventHandlerFn
type ErrorEventHandlerFn = (event: ErrorEvent) => void;
type FillRule
type FillRule = 'nonzero' | 'evenodd' | 'inherit';
type LatLngBoundsExpression
type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral;
type LatLngBoundsLiteral
type LatLngBoundsLiteral = LatLngTuple[];
type LatLngExpression
type LatLngExpression = LatLng | LatLngLiteral | LatLngTuple;
type LatLngTuple
type LatLngTuple = [number, number, number?];
type LayerEventHandlerFn
type LayerEventHandlerFn = (event: LayerEvent) => void;
type LayersControlEventHandlerFn
type LayersControlEventHandlerFn = (event: LayersControlEvent) => void;
type LeafletEventHandlerFn
type LeafletEventHandlerFn = (event: LeafletEvent) => void;
type LeafletKeyboardEventHandlerFn
type LeafletKeyboardEventHandlerFn = (event: LeafletKeyboardEvent) => void;
type LeafletMouseEventHandlerFn
type LeafletMouseEventHandlerFn = (event: LeafletMouseEvent) => void;
type LineCapShape
type LineCapShape = 'butt' | 'round' | 'square' | 'inherit';
type LineJoinShape
type LineJoinShape = 'miter' | 'round' | 'bevel' | 'inherit';
type LocationEventHandlerFn
type LocationEventHandlerFn = (event: LocationEvent) => void;
type PointExpression
type PointExpression = Point | PointTuple;
type PointTuple
type PointTuple = [number, number];
type PopupEventHandlerFn
type PopupEventHandlerFn = (event: PopupEvent) => void;
type ReferrerPolicy
type ReferrerPolicy = | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
type ResizeEventHandlerFn
type ResizeEventHandlerFn = (event: ResizeEvent) => void;
type StyleFunction
type StyleFunction<P = any> = ( feature?: geojson.Feature<geojson.GeometryObject, P>) => PathOptions;
type SVGOverlayStyleOptions
type SVGOverlayStyleOptions = ImageOverlayStyleOptions;
type TileErrorEventHandlerFn
type TileErrorEventHandlerFn = (event: TileErrorEvent) => void;
type TileEventHandlerFn
type TileEventHandlerFn = (event: TileEvent) => void;
type TooltipEventHandlerFn
type TooltipEventHandlerFn = (event: TooltipEvent) => void;
type Zoom
type Zoom = boolean | 'center';
type ZoomAnimEventHandlerFn
type ZoomAnimEventHandlerFn = (event: ZoomAnimEvent) => void;
Namespaces
namespace Browser
namespace Browser {}
variable android
const android: boolean;
variable android23
const android23: boolean;
variable androidStock
const androidStock: boolean;
variable any3d
const any3d: boolean;
variable canvas
const canvas: boolean;
variable chrome
const chrome: boolean;
variable edge
const edge: boolean;
variable gecko
const gecko: boolean;
variable gecko3d
const gecko3d: boolean;
variable ie
const ie: boolean;
variable ie3d
const ie3d: boolean;
variable ielt9
const ielt9: boolean;
variable mobile
const mobile: boolean;
variable mobileGecko
const mobileGecko: boolean;
variable mobileOpera
const mobileOpera: boolean;
variable mobileWebkit
const mobileWebkit: boolean;
variable mobileWebkit3d
const mobileWebkit3d: boolean;
variable msPointer
const msPointer: boolean;
variable opera
const opera: boolean;
variable opera12
const opera12: boolean;
variable pointer
const pointer: boolean;
variable retina
const retina: boolean;
variable safari
const safari: boolean;
variable svg
const svg: boolean;
variable touch
const touch: boolean;
variable vml
const vml: boolean;
variable webkit
const webkit: boolean;
variable webkit3d
const webkit3d: boolean;
variable win
const win: boolean;
namespace control
namespace control {}
function attribution
attribution: (options?: Control.AttributionOptions) => Control.Attribution;
function layers
layers: ( baseLayers?: Control.LayersObject, overlays?: Control.LayersObject, options?: Control.LayersOptions) => Control.Layers;
function scale
scale: (options?: Control.ScaleOptions) => Control.Scale;
function zoom
zoom: (options?: Control.ZoomOptions) => Control.Zoom;
namespace Control
namespace Control {}
class Attribution
class Attribution extends Control {}
constructor
constructor(options?: AttributionOptions);
property options
options: AttributionOptions;
method addAttribution
addAttribution: (text: string) => this;
method removeAttribution
removeAttribution: (text: string) => this;
method setPrefix
setPrefix: (prefix: string | false) => this;
class Layers
class Layers extends Control {}
constructor
constructor( baseLayers?: LayersObject, overlays?: LayersObject, options?: LayersOptions);
property options
options: LayersOptions;
method addBaseLayer
addBaseLayer: (layer: Layer, name: string) => this;
method addOverlay
addOverlay: (layer: Layer, name: string) => this;
method collapse
collapse: () => this;
method expand
expand: () => this;
method removeLayer
removeLayer: (layer: Layer) => this;
class Scale
class Scale extends Control {}
constructor
constructor(options?: ScaleOptions);
property options
options: ScaleOptions;
class Zoom
class Zoom extends Control {}
constructor
constructor(options?: ZoomOptions);
property options
options: ZoomOptions;
interface AttributionOptions
interface AttributionOptions extends ControlOptions {}
property prefix
prefix?: string | boolean | undefined;
interface LayersObject
interface LayersObject {}
index signature
[name: string]: Layer;
interface LayersOptions
interface LayersOptions extends ControlOptions {}
property autoZIndex
autoZIndex?: boolean | undefined;
property collapsed
collapsed?: boolean | undefined;
property hideSingleBase
hideSingleBase?: boolean | undefined;
property sortFunction
sortFunction?: | ((layerA: Layer, layerB: Layer, nameA: string, nameB: string) => number) | undefined;
A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) that will be used for sorting the layers, when
sortLayers
istrue
. The function receives both the [L.Layer
](https://leafletjs.com/reference.html#layer) instances and their names, as insortFunction(layerA, layerB, nameA, nameB)
. By default, it sorts layers alphabetically by their name.
property sortLayers
sortLayers?: boolean | undefined;
Whether to sort the layers. When
false
, layers will keep the order in which they were added to the control.
interface ScaleOptions
interface ScaleOptions extends ControlOptions {}
property imperial
imperial?: boolean | undefined;
property maxWidth
maxWidth?: number | undefined;
property metric
metric?: boolean | undefined;
property updateWhenIdle
updateWhenIdle?: boolean | undefined;
interface ZoomOptions
interface ZoomOptions extends ControlOptions {}
property zoomInText
zoomInText?: string | undefined;
property zoomInTitle
zoomInTitle?: string | undefined;
property zoomOutText
zoomOutText?: string | undefined;
property zoomOutTitle
zoomOutTitle?: string | undefined;
namespace CRS
namespace CRS {}
namespace DomEvent
namespace DomEvent {}
function addListener
addListener: { ( el: HTMLElement, types: string, fn: EventHandlerFn, context?: any ): typeof DomEvent; ( el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any ): typeof DomEvent;};
function disableClickPropagation
disableClickPropagation: (el: HTMLElement) => typeof DomEvent;
function disableScrollPropagation
disableScrollPropagation: (el: HTMLElement) => typeof DomEvent;
function getMousePosition
getMousePosition: (ev: MouseEvent, container?: HTMLElement) => Point;
function getPropagationPath
getPropagationPath: (ev: Event) => HTMLElement[];
function getWheelDelta
getWheelDelta: (ev: Event) => number;
function off
off: { (el: HTMLElement): typeof DomEvent; ( el: HTMLElement, types: string, fn: EventHandlerFn, context?: any ): typeof DomEvent; ( el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any ): typeof DomEvent;};
function on
on: { ( el: HTMLElement, types: string, fn: EventHandlerFn, context?: any ): typeof DomEvent; ( el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any ): typeof DomEvent;};
function preventDefault
preventDefault: (ev: Event) => typeof DomEvent;
function removeListener
removeListener: { ( el: HTMLElement, types: string, fn: EventHandlerFn, context?: any ): typeof DomEvent; ( el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any ): typeof DomEvent;};
function stop
stop: (ev: PropagableEvent) => typeof DomEvent;
function stopPropagation
stopPropagation: (ev: PropagableEvent) => typeof DomEvent;
type EventHandlerFn
type EventHandlerFn = (event: Event) => void;
type PropagableEvent
type PropagableEvent = | LeafletMouseEvent | LeafletKeyboardEvent | LeafletEvent | Event;
namespace DomUtil
namespace DomUtil {}
variable TRANSFORM
let TRANSFORM: string;
variable TRANSITION
let TRANSITION: string;
variable TRANSITION_END
let TRANSITION_END: string;
function addClass
addClass: (el: HTMLElement, name: string) => void;
function create
create: { <T extends keyof HTMLElementTagNameMap>( tagName: T, className?: string, container?: HTMLElement ): HTMLElementTagNameMap[T]; (tagName: string, className?: string, container?: HTMLElement): HTMLElement;};
Creates an HTML element with
tagName
, sets its class toclassName
, and optionally appends it tocontainer
element.Parameter tagName
The name of the tag to create (for example:
div
orcanvas
).Parameter className
The class to set on the created element.
Parameter container
The container to append the created element to.
function disableImageDrag
disableImageDrag: () => void;
function disableTextSelection
disableTextSelection: () => void;
function empty
empty: (el: HTMLElement) => void;
function enableImageDrag
enableImageDrag: () => void;
function enableTextSelection
enableTextSelection: () => void;
function get
get: (element: string | HTMLElement) => HTMLElement | null;
Get Element by its ID or with the given HTML-Element
function getClass
getClass: (el: HTMLElement) => string;
function getPosition
getPosition: (el: HTMLElement) => Point;
function getScale
getScale: (el: HTMLElement) => { x: number; y: number; boundingClientRect: DOMRect;};
function getSizedParentNode
getSizedParentNode: (el: HTMLElement) => HTMLElement;
function getStyle
getStyle: (el: HTMLElement, styleAttrib: string) => string | null;
function hasClass
hasClass: (el: HTMLElement, name: string) => boolean;
function preventOutline
preventOutline: (el: HTMLElement) => void;
function remove
remove: (el: HTMLElement) => void;
function removeClass
removeClass: (el: HTMLElement, name: string) => void;
function restoreOutline
restoreOutline: () => void;
function setClass
setClass: (el: HTMLElement, name: string) => void;
function setOpacity
setOpacity: (el: HTMLElement, opacity: number) => void;
function setPosition
setPosition: (el: HTMLElement, position: Point) => void;
function setTransform
setTransform: (el: HTMLElement, offset: Point, scale?: number) => void;
function testProp
testProp: (props: string[]) => string | false;
function toBack
toBack: (el: HTMLElement) => void;
function toFront
toFront: (el: HTMLElement) => void;
namespace Icon
namespace Icon {}
class Default
class Default extends Icon<DefaultIconOptions> {}
constructor
constructor(options?: DefaultIconOptions);
property imagePath
static imagePath?: string;
interface DefaultIconOptions
interface DefaultIconOptions extends BaseIconOptions {}
property imagePath
imagePath?: string | undefined;
namespace LineUtil
namespace LineUtil {}
See Also
https://github.com/Leaflet/Leaflet/blob/bc918d4bdc2ba189807bc207c77080fb41ecc196/src/geometry/LineUtil.js#L118
function clipSegment
clipSegment: ( a: Point, b: Point, bounds: Bounds, useLastCode?: boolean, round?: boolean) => [Point, Point] | false;
function closestPointOnSegment
closestPointOnSegment: (p: Point, p1: Point, p2: Point) => Point;
function isFlat
isFlat: (latlngs: LatLngExpression[]) => boolean;
function pointToSegmentDistance
pointToSegmentDistance: (p: Point, p1: Point, p2: Point) => number;
function polylineCenter
polylineCenter: (latlngs: LatLngExpression[], crs: CRS) => LatLng;
function simplify
simplify: (points: Point[], tolerance: number) => Point[];
namespace PolyUtil
namespace PolyUtil {}
function clipPolygon
clipPolygon: ( points: Point[], bounds: BoundsExpression, round?: boolean) => Point[];
function polygonCenter
polygonCenter: (latlngs: LatLngExpression[], crs: CRS) => LatLng;
namespace Projection
namespace Projection {}
variable LonLat
const LonLat: Projection;
variable Mercator
const Mercator: Projection;
variable SphericalMercator
const SphericalMercator: Projection;
namespace SVG
namespace SVG {}
function create
create: { <K extends keyof SVGElementTagNameMap>(name: K): SVGElementTagNameMap[K]; (name: string): SVGElement;};
function pointsToPath
pointsToPath: (rings: PointExpression[], closed: boolean) => string;
namespace tileLayer
namespace tileLayer {}
function wms
wms: (baseUrl: string, options?: WMSOptions) => TileLayer.WMS;
namespace TileLayer
namespace TileLayer {}
class WMS
class WMS extends TileLayer {}
constructor
constructor(baseUrl: string, options: WMSOptions);
property options
options: WMSOptions;
property wmsParams
wmsParams: WMSParams;
method setParams
setParams: (params: WMSParams, noRedraw?: boolean) => this;
namespace Util
namespace Util {}
variable emptyImageUrl
let emptyImageUrl: string;
variable lastId
let lastId: number;
function bind
bind: (fn: (...args: any[]) => void, ...obj: any[]) => () => void;
function cancelAnimFrame
cancelAnimFrame: (id: number) => void;
function create
create: (proto: object | null, properties?: PropertyDescriptorMap) => any;
function extend
extend: { <D extends object, S1 extends object = {}>(dest: D, src?: S1): D & S1; <D extends object, S1 extends object, S2 extends object>( dest: D, src1: S1, src2: S2 ): D & S1 & S2; <D extends object, S1 extends object, S2 extends object, S3 extends object>( dest: D, src1: S1, src2: S2, src3: S3 ): D & S1 & S2 & S3; (dest: any, ...src: any[]): any;};
function falseFn
falseFn: () => false;
function formatNum
formatNum: (num: number, digits?: number | false) => number;
function getParamString
getParamString: (obj: any, existingUrl?: string, uppercase?: boolean) => string;
function indexOf
indexOf: (array: any[], el: any) => number;
function isArray
isArray: (obj: any) => boolean;
function requestAnimFrame
requestAnimFrame: ( fn: (timestamp: number) => void, context?: any, immediate?: boolean) => number;
function setOptions
setOptions: (obj: any, options: any) => any;
function splitWords
splitWords: (str: string) => string[];
function stamp
stamp: (obj: any) => number;
function template
template: (str: string, data: any) => string;
function throttle
throttle: (fn: () => void, time: number, context: any) => () => void;
function trim
trim: (str: string) => string;
function wrapNum
wrapNum: (num: number, range: number[], includeMax?: boolean) => number;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/leaflet
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/leaflet)
- HTML<a href="https://www.jsdocs.io/package/@types/leaflet"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 13379 ms. - Missing or incorrect documentation? Open an issue for this package.