Class: LayerRegions

cercaliagl.control/LayerRegions


This class add administrative dividers such as: neighbourhoods, postal codes and municipalities. You can enable these layers in dropdown UI component.

new LayerRegions()

Extends

Methods

Disable and remove layer.

Returns cercalia Map object

Returns:
Cercalia map.

getClass(){string} inherited

Get class name.

Returns:
Class name.

getElement(){Element} inherited

Get control HTML Element

Returns:
HTML Element

Get control id.

Returns:
Id.

getMap(){module:maplibre-gl~Map} inherited

Returns mapboxgl Map object

getName(){string|null} inherited

Get control name. Null if control has not defined name.

Returns:
Class name.

Hide control.

selectOption(option)

Options available for regions.

  • cercaliagl.control.LayerRegionsOptions.NONE: No layer region option. Value: none
  • cercaliagl.control.LayerRegionsOptions.NEIGHBOURHOODS: Layer neighbourhoods. Value: neighbourhoods
  • cercaliagl.control.LayerRegionsOptions.POSTALCODES: Layer postal codes. Value: postalcodes
  • cercaliagl.control.LayerRegionsOptions.MUNICIPALITIES: Layer municipalities. Value: municipalities

Example: Enable postal codes feature layer.

const map = new cercaliagl.Map({ target: 'map' });
const control = map.getControlByName(cercaliagl.control.MapControls.LAYER_REGIONS);
control.enableOption(cercaliagl.control.LayerRegionsOptions.POSTALCODES);

Name Type Description
option module:cercaliagl/layer/LayerRegions~LayerRegionsType

Option to enable. See above

Show control.