Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LMap

Leaflet地图,继承自原生L.Map

export

Hierarchy

  • Map
    • LMap

Implements

Index

Constructors

  • 构建 LMap

    memberof

    LMap

    Parameters

    • element: string | HTMLElement

      container

    • Optional options: LMapOptions

    Returns LMap

Properties

attributionControl: Attribution
boxZoom: Handler
doubleClickZoom: Handler
dragging: Handler
keyboard: Handler
options: LMapOptions

构建参数

memberof

LMap

scrollWheelZoom: Handler
tap?: Handler
toolService: MapToolService

绘制工具服务

memberof

LMap

touchZoom: Handler
zoomControl: Zoom
EventTypes: { defaultLayersLoaded: string; themeChanged: string } = ...

Type declaration

  • defaultLayersLoaded: string
  • themeChanged: string

Methods

  • addControl(control: Control): LMap
  • Parameters

    • control: Control

    Returns LMap

  • addEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): LMap
  • addEventListener(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): LMap
  • addEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): LMap
  • addEventListener(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): LMap
  • addEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): LMap
  • addEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): LMap
  • addEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): LMap
  • addEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): LMap
  • addEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): LMap
  • addEventListener(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn: LeafletMouseEventHandlerFn, context?: any): LMap
  • addEventListener(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • addEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): LMap
  • addEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): LMap
  • addEventListener(type: "tileunload" | "tileloadstart" | "tileload", fn: TileEventHandlerFn, context?: any): LMap
  • addEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): LMap
  • addEventListener(eventMap: LeafletEventHandlerFnMap): LMap
  • 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').

    Parameters

    • type: string
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "layeradd" | "layerremove"
    • fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "resize"
    • fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "popupopen" | "popupclose"
    • fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "locationerror"
    • fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "locationfound"
    • fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "zoomanim"
    • fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "dragend"
    • fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • type: "tileerror"
    • fn: TileErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for on(...)

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

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • addEventParent(obj: Evented): LMap
  • Adds an event parent - an Evented that will receive propagated events

    Parameters

    • obj: Evented

    Returns LMap

  • addHandler(name: string, HandlerClass: typeof Handler): LMap
  • Parameters

    • name: string
    • HandlerClass: typeof Handler

    Returns LMap

  • addLayer(layer: Layer): LMap
  • Parameters

    • layer: Layer

    Returns LMap

  • addOneTimeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(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): LMap
  • addOneTimeEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn: LeafletMouseEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "tileunload" | "tileloadstart" | "tileload", fn: TileEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): LMap
  • addOneTimeEventListener(eventMap: LeafletEventHandlerFnMap): LMap
  • Alias for once(...)

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

    Parameters

    • type: string
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "layeradd" | "layerremove"
    • fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "resize"
    • fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "popupopen" | "popupclose"
    • fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "locationerror"
    • fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "locationfound"
    • fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "zoomanim"
    • fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "dragend"
    • fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • type: "tileerror"
    • fn: TileErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for once(...)

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

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • clearAllEventListeners(): LMap
  • Alias for off()

    Removes all listeners to all events on the object.

    Returns LMap

  • closePopup(popup?: Popup): LMap
  • Parameters

    • Optional popup: Popup

    Returns LMap

  • closeTooltip(tooltip?: Tooltip): LMap
  • Parameters

    • Optional tooltip: Tooltip

    Returns LMap

  • containerPointToLatLng(point: PointExpression): LatLng
  • Parameters

    • point: PointExpression

    Returns LatLng

  • containerPointToLayerPoint(point: PointExpression): Point
  • Parameters

    • point: PointExpression

    Returns Point

  • createPane(name: string, container?: HTMLElement): HTMLElement
  • Parameters

    • name: string
    • Optional container: HTMLElement

    Returns HTMLElement

  • distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number
  • Parameters

    • latlng1: LatLngExpression
    • latlng2: LatLngExpression

    Returns number

  • eachLayer(fn: ((layer: Layer) => void), context?: any): LMap
  • Parameters

    • fn: ((layer: Layer) => void)
        • (layer: Layer): void
        • Parameters

          • layer: Layer

          Returns void

    • Optional context: any

    Returns LMap

  • fire(type: string, data?: any, propagate?: boolean): LMap
  • 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.

    Parameters

    • type: string
    • Optional data: any
    • Optional propagate: boolean

    Returns LMap

  • fireEvent(type: string, data?: any, propagate?: boolean): LMap
  • 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.

    Parameters

    • type: string
    • Optional data: any
    • Optional propagate: boolean

    Returns LMap

  • fitBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): LMap
  • Parameters

    • bounds: LatLngBoundsExpression
    • Optional options: FitBoundsOptions

    Returns LMap

  • fitWorld(options?: FitBoundsOptions): LMap
  • Parameters

    • Optional options: FitBoundsOptions

    Returns LMap

  • flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): LMap
  • Parameters

    • latlng: LatLngExpression
    • Optional zoom: number
    • Optional options: ZoomPanOptions

    Returns LMap

  • flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): LMap
  • Parameters

    • bounds: LatLngBoundsExpression
    • Optional options: FitBoundsOptions

    Returns LMap

  • getBounds(): LatLngBounds
  • Returns LatLngBounds

  • getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean, padding?: Point): number
  • Parameters

    • bounds: LatLngBoundsExpression
    • Optional inside: boolean
    • Optional padding: Point

    Returns number

  • getCenter(): LatLng
  • Returns LatLng

  • getContainer(): HTMLElement
  • Returns HTMLElement

  • getMaxZoom(): number
  • Returns number

  • getMinZoom(): number
  • Returns number

  • getPane(pane: string | HTMLElement): HTMLElement
  • Name of the pane or the pane as HTML-Element

    Parameters

    • pane: string | HTMLElement

    Returns HTMLElement

  • getPanes(): {} & DefaultMapPanes
  • Returns {} & DefaultMapPanes

  • getPixelBounds(): Bounds
  • Returns Bounds

  • getPixelOrigin(): Point
  • Returns Point

  • getPixelWorldBounds(zoom?: number): Bounds
  • Parameters

    • Optional zoom: number

    Returns Bounds

  • getRenderer(layer: Path): Renderer
  • Parameters

    • layer: Path

    Returns Renderer

  • getScaleZoom(scale: number, fromZoom?: number): number
  • Parameters

    • scale: number
    • Optional fromZoom: number

    Returns number

  • getSize(): Point
  • Returns Point

  • getTheme(): string
  • Returns string

  • getZoom(): number
  • Returns number

  • getZoomScale(toZoom: number, fromZoom?: number): number
  • Parameters

    • toZoom: number
    • Optional fromZoom: number

    Returns number

  • hasEventListeners(type: string): boolean
  • Alias for listens(...)

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

    Parameters

    • type: string

    Returns boolean

  • hasLayer(layer: Layer): boolean
  • Parameters

    • layer: Layer

    Returns boolean

  • invalidateSize(options?: boolean | InvalidateSizeOptions): LMap
  • Boolean for animate or advanced ZoomPanOptions

    Parameters

    • Optional options: boolean | InvalidateSizeOptions

    Returns LMap

  • latLngToContainerPoint(latlng: LatLngExpression): Point
  • Parameters

    • latlng: LatLngExpression

    Returns Point

  • latLngToLayerPoint(latlng: LatLngExpression): Point
  • Parameters

    • latlng: LatLngExpression

    Returns Point

  • layerPointToContainerPoint(point: PointExpression): Point
  • Parameters

    • point: PointExpression

    Returns Point

  • layerPointToLatLng(point: PointExpression): LatLng
  • Parameters

    • point: PointExpression

    Returns LatLng

  • listens(type: string): boolean
  • Returns true if a particular event type has any listeners attached to it.

    Parameters

    • type: string

    Returns boolean

  • locate(options?: LocateOptions): LMap
  • Parameters

    • Optional options: LocateOptions

    Returns LMap

  • mouseEventToContainerPoint(ev: MouseEvent): Point
  • Parameters

    • ev: MouseEvent

    Returns Point

  • mouseEventToLatLng(ev: MouseEvent): LatLng
  • Parameters

    • ev: MouseEvent

    Returns LatLng

  • mouseEventToLayerPoint(ev: MouseEvent): Point
  • Parameters

    • ev: MouseEvent

    Returns Point

  • off(type: string, fn?: LeafletEventHandlerFn, context?: any): LMap
  • off(type: "baselayerchange" | "overlayadd" | "overlayremove", fn?: LayersControlEventHandlerFn, context?: any): LMap
  • off(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): LMap
  • off(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): LMap
  • off(type: "resize", fn?: ResizeEventHandlerFn, context?: any): LMap
  • off(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): LMap
  • off(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): LMap
  • off(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): LMap
  • off(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): LMap
  • off(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn?: LeafletMouseEventHandlerFn, context?: any): LMap
  • off(type: "keypress" | "keydown" | "keyup", fn?: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • off(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): LMap
  • off(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): LMap
  • off(type: "tileunload" | "tileloadstart" | "tileload", fn?: TileEventHandlerFn, context?: any): LMap
  • off(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): LMap
  • off(eventMap: LeafletEventHandlerFnMap): LMap
  • off(): LMap
  • 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.

    Parameters

    • type: string
    • Optional fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • Optional fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "layeradd" | "layerremove"
    • Optional fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • Optional fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "resize"
    • Optional fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "popupopen" | "popupclose"
    • Optional fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • Optional fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "locationerror"
    • Optional fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "locationfound"
    • Optional fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • Optional fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • Optional fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "zoomanim"
    • Optional fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "dragend"
    • Optional fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • Optional fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes all listeners to all events on the object.

    Parameters

    • type: "tileerror"
    • Optional fn: TileErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Removes a set of type/listener pairs.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • Removes all listeners to all events on the object.

    Returns LMap

  • on(type: string, fn: LeafletEventHandlerFn, context?: any): LMap
  • on(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): LMap
  • on(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): LMap
  • on(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): LMap
  • on(type: "resize", fn: ResizeEventHandlerFn, context?: any): LMap
  • on(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): LMap
  • on(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): LMap
  • on(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): LMap
  • on(type: "locationfound", fn: LocationEventHandlerFn, context?: any): LMap
  • on(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn: LeafletMouseEventHandlerFn, context?: any): LMap
  • on(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • on(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): LMap
  • on(type: "dragend", fn: DragEndEventHandlerFn, context?: any): LMap
  • on(type: "tileunload" | "tileloadstart" | "tileload", fn: TileEventHandlerFn, context?: any): LMap
  • on(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): LMap
  • on(eventMap: LeafletEventHandlerFnMap): LMap
  • 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').

    Parameters

    • type: string
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "layeradd" | "layerremove"
    • fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "resize"
    • fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "popupopen" | "popupclose"
    • fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "locationerror"
    • fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "locationfound"
    • fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "zoomanim"
    • fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "dragend"
    • fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tileerror"
    • fn: TileErrorEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • once(type: string, fn: LeafletEventHandlerFn, context?: any): LMap
  • once(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): LMap
  • once(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): LMap
  • once(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): LMap
  • once(type: "resize", fn: ResizeEventHandlerFn, context?: any): LMap
  • once(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): LMap
  • once(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): LMap
  • once(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): LMap
  • once(type: "locationfound", fn: LocationEventHandlerFn, context?: any): LMap
  • once(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn: LeafletMouseEventHandlerFn, context?: any): LMap
  • once(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • once(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): LMap
  • once(type: "dragend", fn: DragEndEventHandlerFn, context?: any): LMap
  • once(type: "tileunload" | "tileloadstart" | "tileload", fn: TileEventHandlerFn, context?: any): LMap
  • once(type: "tileerror", fn: TileEventHandlerFn, context?: any): LMap
  • once(eventMap: LeafletEventHandlerFnMap): LMap
  • Behaves as on(...), except the listener will only get fired once and then removed.

    Parameters

    • type: string
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "layeradd" | "layerremove"
    • fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "resize"
    • fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "popupopen" | "popupclose"
    • fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "locationerror"
    • fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "locationfound"
    • fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "zoomanim"
    • fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "dragend"
    • fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • type: "tileerror"
    • fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

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

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • openPopup(popup: Popup): LMap
  • openPopup(content: Content, latlng: LatLngExpression, options?: PopupOptions): LMap
  • Parameters

    • popup: Popup

    Returns LMap

  • Parameters

    • content: Content
    • latlng: LatLngExpression
    • Optional options: PopupOptions

    Returns LMap

  • openTooltip(tooltip: Tooltip): LMap
  • openTooltip(content: Content, latlng: LatLngExpression, options?: TooltipOptions): LMap
  • Parameters

    • tooltip: Tooltip

    Returns LMap

  • Parameters

    • content: Content
    • latlng: LatLngExpression
    • Optional options: TooltipOptions

    Returns LMap

  • panBy(offset: PointExpression, options?: PanOptions): LMap
  • Parameters

    • offset: PointExpression
    • Optional options: PanOptions

    Returns LMap

  • panInside(latLng: LatLngExpression, options?: PanInsideOptions): LMap
  • Parameters

    • latLng: LatLngExpression
    • Optional options: PanInsideOptions

    Returns LMap

  • panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): LMap
  • Parameters

    • bounds: LatLngBoundsExpression
    • Optional options: PanOptions

    Returns LMap

  • panTo(latlng: LatLngExpression, options?: PanOptions): LMap
  • Parameters

    • latlng: LatLngExpression
    • Optional options: PanOptions

    Returns LMap

  • project(latlng: LatLngExpression, zoom?: number): Point
  • Parameters

    • latlng: LatLngExpression
    • Optional zoom: number

    Returns Point

  • Returns LMap

  • removeControl(control: Control): LMap
  • Parameters

    • control: Control

    Returns LMap

  • removeEventListener(type: string, fn?: LeafletEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "baselayerchange" | "overlayadd" | "overlayremove", fn?: LayersControlEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): LMap
  • removeEventListener(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): LMap
  • removeEventListener(type: "resize", fn?: ResizeEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick", fn?: LeafletMouseEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "keypress" | "keydown" | "keyup", fn?: LeafletKeyboardEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "tileunload" | "tileloadstart" | "tileload", fn?: TileEventHandlerFn, context?: any): LMap
  • removeEventListener(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): LMap
  • removeEventListener(eventMap: LeafletEventHandlerFnMap): LMap
  • 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.

    Parameters

    • type: string
    • Optional fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "baselayerchange" | "overlayadd" | "overlayremove"
    • Optional fn: LayersControlEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "layeradd" | "layerremove"
    • Optional fn: LayerEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "zoomlevelschange" | "unload" | "viewreset" | "load" | "zoomstart" | "movestart" | "zoom" | "move" | "zoomend" | "moveend" | "autopanstart" | "dragstart" | "drag" | "add" | "remove" | "loading" | "error" | "update" | "down" | "predrag"
    • Optional fn: LeafletEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "resize"
    • Optional fn: ResizeEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "popupopen" | "popupclose"
    • Optional fn: PopupEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "tooltipopen" | "tooltipclose"
    • Optional fn: TooltipEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "locationerror"
    • Optional fn: ErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "locationfound"
    • Optional fn: LocationEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "click" | "dblclick" | "mousedown" | "mouseup" | "mouseover" | "mouseout" | "mousemove" | "contextmenu" | "preclick"
    • Optional fn: LeafletMouseEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "keypress" | "keydown" | "keyup"
    • Optional fn: LeafletKeyboardEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "zoomanim"
    • Optional fn: ZoomAnimEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "dragend"
    • Optional fn: DragEndEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "tileunload" | "tileloadstart" | "tileload"
    • Optional fn: TileEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • type: "tileerror"
    • Optional fn: TileErrorEventHandlerFn
    • Optional context: any

    Returns LMap

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns LMap

  • removeEventParent(obj: Evented): LMap
  • Removes an event parent, so it will stop receiving propagated events

    Parameters

    • obj: Evented

    Returns LMap

  • removeLayer(layer: Layer): LMap
  • Parameters

    • layer: Layer

    Returns LMap

  • setMaxBounds(bounds: LatLngBoundsExpression): LMap
  • Parameters

    • bounds: LatLngBoundsExpression

    Returns LMap

  • setMaxZoom(zoom: number): LMap
  • Parameters

    • zoom: number

    Returns LMap

  • setMinZoom(zoom: number): LMap
  • Parameters

    • zoom: number

    Returns LMap

  • setTheme(theme: string): void
  • Parameters

    • theme: string

    Returns void

  • setView(center: LatLngExpression, zoom?: number, options?: ZoomPanOptions): LMap
  • Parameters

    • center: LatLngExpression
    • Optional zoom: number
    • Optional options: ZoomPanOptions

    Returns LMap

  • setZoom(zoom: number, options?: ZoomPanOptions): LMap
  • Parameters

    • zoom: number
    • Optional options: ZoomPanOptions

    Returns LMap

  • setZoomAround(position: Point | LatLngExpression, zoom: number, options?: ZoomOptions): LMap
  • Parameters

    • position: Point | LatLngExpression
    • zoom: number
    • Optional options: ZoomOptions

    Returns LMap

  • Returns LMap

  • Returns LMap

  • unproject(point: PointExpression, zoom?: number): LatLng
  • Parameters

    • point: PointExpression
    • Optional zoom: number

    Returns LatLng

  • whenReady(fn: (() => void), context?: any): LMap
  • Parameters

    • fn: (() => void)
        • (): void
        • Returns void

    • Optional context: any

    Returns LMap

  • wrapLatLng(latlng: LatLngExpression): LatLng
  • Parameters

    • latlng: LatLngExpression

    Returns LatLng

  • wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
  • Parameters

    • bounds: LatLngBounds

    Returns LatLngBounds

  • zoomIn(delta?: number, options?: ZoomOptions): LMap
  • Parameters

    • Optional delta: number
    • Optional options: ZoomOptions

    Returns LMap

  • zoomOut(delta?: number, options?: ZoomOptions): LMap
  • Parameters

    • Optional delta: number
    • Optional options: ZoomOptions

    Returns LMap

  • addInitHook(initHookFn: (() => void)): any
  • addInitHook(methodName: string, ...args: any[]): any
  • Parameters

    • initHookFn: (() => void)
        • (): void
        • Returns void

    Returns any

  • Parameters

    • methodName: string
    • Rest ...args: any[]

    Returns any

  • extend(props: any): (new (...args: any[]) => any) & typeof Class
  • Parameters

    • props: any

    Returns (new (...args: any[]) => any) & typeof Class

  • include(props: any): any
  • Parameters

    • props: any

    Returns any

  • mergeOptions(props: any): any
  • Parameters

    • props: any

    Returns any

Generated using TypeDoc