LayersControl.js

LayersControl()


constructor

LayersControl class is responsible for displaying all the layers on the map in a user interface. Controls should be added using Map

Options:
  • offset(Array)The offset in pixels from the control's original position (default: [0, 0])
  • fontSize(Number)The size of control's font (default: 10)
  • fontFamily(String)The family of control's font (default: 'Tahoma')
Parameter Type Description
options Object The options of the control

createLayer()


method

Creates and adds to DOM a layer UI for a given layer

Parameter Type Description
layer BaseLayer | TileLayer | VectorLayer | MarkersLayer | ImageLayer | PopupsLayer | WmsLayer The layer for which to create the UI

toggleLayers()


method

Show / Hides the list of layers and adds collapse class to header element

showLayers()


method

Displays the layers UI on the map

hideLayers()


method

Hides the layers UI