Home Reference Source Repository
import VariablesControl from './controls/VariablesControl.js'
public class | source

VariablesControl

Extends:

L.ControlButtonGroupControl → VariablesControl

A button group control for switching between different climate/energy variable dropdowns and selecting a specific variable using radio buttons.

Note that the dropdowns are an extension to the ButtonGroupControl class.

Template: VariablesControlTemplate

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

The currently selected variable.

Inherited Summary

From class ButtonGroupControl
public

The name of the currently active button.

public

addTo(map: L.Map): *

Adds the control to the given map.

public

Creates the HTMLElement of the control, registers listeners, and returns it.

Public Constructors

public constructor source

Override:

ButtonGroupControl#constructor

Params:

NameTypeAttributeDescription
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.initialActive string
  • optional

If set, the name of the button that is initially active, either climate or energy.

options.initialVariable string
  • optional
  • default: 'T2M'

If set, the name of the variable that is initially selected, see template for possible values.

Public Members

public variable: string source

The currently selected variable.