M/impl/control/LayerSwitcher~LayerSwitcher


import LayerSwitcher from 'M/impl/control/LayerSwitcher';

new LayerSwitcher()

impl/ol/control/Layerswitcher.js, line 23

Extends

  • ol.control.Control

Members

module:M/impl/control/LayerSwitcher~LayerSwitcher.PANEL_ID{string}

LayerSwitcher panel id

Methods

addTo(map, template)

impl/ol/control/Layerswitcher.js, line 44

This function adds the control to the specified map

Name Type Description
map M.Map

to add the plugin

template function

template of this control

clickLayer()

impl/ol/control/Layerswitcher.js, line 116

Sets the visibility of the clicked layer const groupId = evt.target.getAttribute('data-group-id');

inputLayer()

impl/ol/control/Layerswitcher.js, line 68

Sets the visibility of the clicked layer

registerEvents()

impl/ol/control/Layerswitcher.js, line 209

Registers events on map and layers to render the layerswitcher

renderPanel()

impl/ol/control/Layerswitcher.js, line 185

Re-draw the layer panel to represent the current state of the layers.

unregisterEvents()

impl/ol/control/Layerswitcher.js, line 226

Unegisters events for map and layers from the layerswitcher