Class: LayerSwitcher

cercalia.Control.LayerSwitcher

Control in the tools topbar where you can change the map type using a selector menu.

You can also add additional layers not included by default, and with different projections. For adding a layer ol.layer.Layer or the own Cercalia API WMS class cercalia.WMS

new cercalia.Control.LayerSwitcher(options)

Name Type Description
options
Name Type Description
listMaptypes Array.<string> | undefined optional

Maps array to be painted. Admitted values: cercalia.MapTypes.CERCALIA
cercalia.MapTypes.OPENSTREETMAP
cercalia.MapTypes.HYBRID
cercalia.MapTypes.OSM
cercalia.MapTypes.SATELLITE

Extends

Methods

addBaseLayer(name, layer, projectionCode, logoUrl)

Name Type Description
name string
layer cercalia.WMS | ol.layer.Layer
projectionCode string | undefined optional

If you don't include a projection code, the API will use the default projection: EPSG:3857

logoUrl string | undefined optional

Map copyright image URL

Returns:
class

Obtain the control DOM element

Returns:
DOM Element

Returns the menú (list) HTML element

Returns the control name

Returns:
Control name

Hide the control

Change base layer who has been added before in this control using addBaseLayer function.

Name Type Description
name string

Shows the control