Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EasyButton

Hierarchy

  • Control
    • EasyButton

Implements

Index

Constructors

constructor

Properties

options

Methods

addTo

  • addTo(map: Map): Control
  • Adds the control to the map.

    Parameters

    Returns Control

disable

  • Returns EasyButton

enable

  • Returns EasyButton

getContainer

  • getContainer(): HTMLElement
  • Returns the HTML container of the control.

    Returns HTMLElement

getPosition

  • getPosition(): string
  • Returns the current position of the control.

    Returns string

onAdd

  • 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

onRemove

  • onRemove(map: Map): void
  • 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

    Returns void

removeFrom

setPosition

  • setPosition(position: string): Control
  • Sets the position of the control. See control positions.

    Parameters

    • position: string

    Returns Control

state

  • Parameters

    • newState: string

    Returns EasyButton

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