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.

Type Parameters

  • P = any

Hierarchy

Constructors

  • Type Parameters

    • P = any

    Parameters

    Returns LayerGroup<P>

Properties

_map: Map
options: LayerOptions

Methods

  • 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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Alias for on(...)

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

    Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

  • Adds the given layer to the group.

    Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Alias for off()

    Removes all listeners to all events on the object.

    Returns LayerGroup<P>

  • Removes all the layers from the group.

    Returns LayerGroup<P>

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

    Parameters

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

          Returns void

    • Optional context: any

    Returns LayerGroup<P>

  • 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 LayerGroup<P>

  • 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 LayerGroup<P>

  • Returns string

  • Returns the layer with the given internal ID.

    Parameters

    • id: number

    Returns Layer

  • Returns the internal ID for a layer

    Parameters

    Returns number

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

    Returns Layer[]

  • Parameters

    • Optional name: string

    Returns HTMLElement

  • Returns Popup

  • Returns Tooltip

  • Alias for listens(...)

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

    Parameters

    • type: string

    Returns boolean

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

    Parameters

    Returns boolean

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

    Parameters

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

    Returns LayerGroup<P>

  • Returns boolean

  • Returns boolean

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

    Parameters

    • type: "add" | "error" | "remove" | "resize" | "move" | "loading" | "click" | "contextmenu" | "dblclick" | "drag" | "dragend" | "dragstart" | "keydown" | "keypress" | "keyup" | "load" | "mousedown" | "mousemove" | "mouseout" | "mouseover" | "mouseup" | "unload" | "update" | "zoom" | "baselayerchange" | "overlayadd" | "overlayremove" | "layeradd" | "layerremove" | "zoomlevelschange" | "viewreset" | "zoomstart" | "movestart" | "zoomend" | "moveend" | "autopanstart" | "down" | "predrag" | "popupopen" | "tooltipopen" | "tooltipclose" | "locationerror" | "locationfound" | "preclick" | "zoomanim" | "tileunload" | "tileloadstart" | "tileload" | "tileabort" | "tileerror"
    • Optional propagate: boolean

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

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

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • 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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Removes a set of type/listener pairs.

    Parameters

    Returns LayerGroup<P>

  • Removes all listeners to all events on the object.

    Returns LayerGroup<P>

  • 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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

  • Returns LayerGroup<P>

  • 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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

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

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

  • Parameters

    Returns LayerGroup<P>

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

    Parameters

    Returns LayerGroup<P>

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

    Parameters

    • zIndex: number

    Returns LayerGroup<P>

  • Parameters

    • Optional precision: number

    Returns Feature<MultiPoint, P>

  • Parameters

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

    Returns any

  • Parameters

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

    Returns any

  • Returns void

  • Parameters

    • props: any

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

  • Parameters

    • props: any

    Returns any

  • Parameters

    • props: any

    Returns any

Generated using TypeDoc