Class: LayerRegions

cercaliagl.control/LayerRegions


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

new LayerRegions()

Extends

Methods

Disable and remove layer.

enableOption(option)

Options available for regions.

  • cercaliagl.control.LayerRegionsOptions.NONE: No layer region option. Value: none
  • cercaliagl.control.LayerRegionsOptions.NEIGHBORHOODS: Layer neighborhoods. Value: neighborhoods
  • 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 string

Option to enable. See above

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.

Show control.