Interface IControl

Index

Methods

Methods

public onAdd(map: Map): HTMLElement

Should contain code that creates all the neccessary DOM elements for the control, adds listeners on relevant map events, and returns the element containing the control. Called on map.addControl(control) or control.addTo(map).

Parameters

Returns

HTMLElement

public onRemove(map: Map)

Optional, should contain all clean up code (e.g. removes control's event listeners). Called on map.removeControl(control) or control.removeFrom(map). The control's DOM container is removed automatically.

Parameters