Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DynamicMapLayer

Hierarchy

Implements

Index

Constructors

constructor

Methods

addEventListener

  • 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 DynamicMapLayer

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

    Parameters

    • eventMap: any
    • Optional context: any

    Returns DynamicMapLayer

addOneTimeEventListener

  • addOneTimeEventListener(type: string, fn: function, context?: any): DynamicMapLayer
  • The same as above except the listener will only get fired once and then removed.

    Parameters

    Returns DynamicMapLayer

addTo

bringToBack

bringToFront

clearAllEventListeners

fire

  • Alias to fireEvent.

    Parameters

    • type: string
    • Optional data: any

    Returns DynamicMapLayer

fireEvent

  • Fires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties.

    Parameters

    • type: string
    • Optional data: any

    Returns DynamicMapLayer

getLayers

  • getLayers(): Array<any>
  • Returns Array<any>

hasEventListeners

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

    Parameters

    • type: string

    Returns boolean

off

  • Alias to removeEventListener.

    Parameters

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

    Returns DynamicMapLayer

  • Alias to removeEventListener.

    Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns DynamicMapLayer

on

  • Alias to addEventListener.

    Parameters

    Returns DynamicMapLayer

  • Alias to addEventListener.

    Parameters

    • eventMap: any
    • Optional context: any

    Returns DynamicMapLayer

onAdd

  • onAdd(map: Map): void
  • Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

    Parameters

    Returns void

onRemove

  • onRemove(map: Map): void
  • Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

    Parameters

    Returns void

once

  • Alias to addOneTimeEventListener.

    Parameters

    Returns DynamicMapLayer

removeEventListener

  • removeEventListener(type: string, fn?: function, context?: any): DynamicMapLayer
  • removeEventListener(eventMap?: any, context?: any): DynamicMapLayer
  • Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object.

    Parameters

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

    Returns DynamicMapLayer

  • Removes a set of type/listener pairs.

    Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns DynamicMapLayer

setLayers

  • setLayers(layerIds: Array<number>): void
  • Parameters

    • layerIds: Array<number>

    Returns void

setOpacity

  • Sets the opacity of the overlay.

    Parameters

    • opacity: number

    Returns ImageOverlay

setUrl

  • Changes the URL of the image.

    Parameters

    • imageUrl: string

    Returns ImageOverlay

Static addInitHook

  • addInitHook(methodName: string, ...args: any[]): void
  • You can also use the following shortcut when you just need to make one additional method call.

    Parameters

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

    Returns void

Static extend

  • You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it.

    Parameters

    Returns any