Skip to main content

@mapgear/geoapps > LayerItem

LayerItem class

A layer object in the map

Signature:
export declare class LayerItem 

Events

PropertyModifiersTypeDescription
VisibilityChangedreadonlyGAEvent<GAEventArgs>Triggered when the visibility of the layer is changed, based on the zoom levels

Constructors

ConstructorModifiersDescription
(constructor)(map, categoryType, displayType, parentLayer)Constructs a new instance of the LayerItem class

Properties

PropertyModifiersTypeDescription
CategoryTypereadonlyLayerCategoryTypeRetrieve the layer category type
ChildLayersreadonlyLayerItem[]Get the childlayers
DisplayTypereadonlyLayerDisplayTypeRetrieve the layer display type
EnabledbooleanRetrieve whether or not the layer is enabled
IsVisiblereadonlybooleanIndicate whether the layer is visible or not, based on the zoom levels of the map
LayerLayerReference to layer object
LayerItemIdstringUnique id of layer item
OpacitynumberRetrieve the current opacity of the layer
ShowInLegendbooleanWhether to show layer item in legend
ShowSymbologybooleanWhether to show layer item's symbology in legend
SymbologySymbologyReference to symbology object
TitlestringTitle of the layer item

Methods

MethodModifiersDescription
ApplyFilter(filters)Apply a filter on the layer
ApplyFilter2(filter)Apply a filter on the layer
ClearFilter()Remove filter from specified layer
EnableHover(enable, options)Enable hover on the layer, which shows a pointer cursor when hovering a layer
GetChildLayerItem(layerItemId, recursive)Retrieve a child layer item
GetFeatureById(id)Retrieve the features specified by the filter in the parameter
GetFeaturesAtPixel(coordinate)Retrieve the features found at the specified coordinate
GetFeaturesByFilter(filter)Retrieve the features specified by the filter in the parameter
GetFeaturesByFilter2(filter)Retrieve the features specified by the filter in the parameter
Refresh()Refresh the data on the map
ToggleEnabled()Toggle enabled state of the layer
ToggleSymbologyUI()Toggle the state of the symbology UI
UpdateSymbologyUI(visible)Enable or disable the symbology UI