Home Reference Source Repository
import {Dropdown} from 'leaflet-coverage/'
public class | source

Dropdown

Mixin Extends:

L.Control, EventMixin

An event-enabled dropdown control with optional title.

Used in VerticalAxis.

Constructor Summary

Public Constructor
public

constructor(choices: Array<Object>, options: Object)

Member Summary

Public Members
public get

Returns the value of the currently selected item.

public set

Selects the item with the given value.

Public Constructors

public constructor(choices: Array<Object>, options: Object) source

Params:

NameTypeAttributeDescription
choices Array<Object>

The dropdown items given as an array of {value, label} objects.

options Object
  • optional

The options object.

options.position string
  • optional
  • default: 'topleft'

The position of the control (one of the map corners). Possible values are 'topleft', 'topright', 'bottomleft' or 'bottomright'.

options.title string
  • optional

The dropdown title that is displayed above the dropdown.

options.value string
  • optional

Value of the item that should be initially selected.

options.templateId string
  • optional

Element ID of an alternative HTML <template> element to use.

Public Members

public get value: string source

Returns the value of the currently selected item.

Example:

let current = dropdown.value

public set value: string source

Selects the item with the given value.

Example:

dropdown.value = 'foobar'