LuciadCPillar C# 2024.1.09
Luciad.Layers.Layer Class Reference

Common representation for layers that can be added to a map. More...

Inheritance diagram for Luciad.Layers.Layer:
Luciad.Layers.Features.FeatureLayer Luciad.Layers.Grids.GridLayer Luciad.Layers.MbTiles.MbTilesFeatureLayer Luciad.Layers.Rasters.RasterLayer Luciad.Layers.TileSet3D.TileSet3DLayer Luciad.Layers.Grids.LonLat.LonLatGridLayer Luciad.Layers.Grids.Mgrs.MgrsGridLayer

Public Member Functions

void AddObserver (Luciad.Layers.ILayerObserver layerObserver)
 Adds an observer that allows to receive change events from this layer. More...
 
void Dispose ()
 
void RemoveObserver (Luciad.Layers.ILayerObserver layerObserver)
 Removes the given observer. More...
 

Properties

ulong Id [get]
 The layer's unique id. More...
 
bool IsBusy [get]
 Whether this layer is busy loading data, rendering, loading attributions, or anything else. More...
 
bool IsVisible [get, set]
 Whether this layer is visible. More...
 
static string PropertyBusy = PropertyBusyInternal() [get]
 Property name for the LayerEvent that is fired as a result of the layer's busy flag changing. More...
 
static string PropertyTitle = PropertyTitleInternal() [get]
 Property name for the LayerEvent that is fired as a result of changing the layer's title. More...
 
static string PropertyVisible = PropertyVisibleInternal() [get]
 Property name for the LayerEvent that is fired as a result of changing the layer's visible flag. More...
 
string Title [get, set]
 The layer's title. More...
 

Detailed Description

Common representation for layers that can be added to a map.

A layer has a few properties that can be changed.

  • visibility
  • title

An observer can be attached to get notifications about layer changes.

A Layer can only be active on a single Map. It can be part of multiple LayerLists if at most one of them is attached to a map, either directly, or indirectly via a IController.

Use one of the concrete classes extending this class.

Note that this class tracks on which thread it is constructed. This is done so that, in subsequent calls, it can verify that the same threads are used consistently. When an inconsistency is detected, an assertion is triggered. This means that all functions on Layer (and its subclasses) must be called on the thread on which the Map was constructed (the "UI" thread). The only exception is adding and removing observers. Related article: Threading rules for the Map

Member Function Documentation

◆ AddObserver()

void Luciad.Layers.Layer.AddObserver ( Luciad.Layers.ILayerObserver  layerObserver)
inline

Adds an observer that allows to receive change events from this layer.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

Parameters
layerObserveran observer.
Exceptions
System.ArgumentExceptionwhen the observer was already added.
System.ArgumentNullExceptionwhen the observer is null.

◆ Dispose()

void Luciad.Layers.Layer.Dispose ( )
inline

◆ RemoveObserver()

void Luciad.Layers.Layer.RemoveObserver ( Luciad.Layers.ILayerObserver  layerObserver)
inline

Removes the given observer.

If the given observer was never added, an exception is thrown.

Parameters
layerObserveran observer.
Exceptions
System.ArgumentExceptionwhen the observer is not known.
System.ArgumentNullExceptionwhen the observer is null.

Property Documentation

◆ Id

ulong Luciad.Layers.Layer.Id
get

The layer's unique id.

[get]

Returns the layer's unique id.

◆ IsBusy

bool Luciad.Layers.Layer.IsBusy
get

Whether this layer is busy loading data, rendering, loading attributions, or anything else.

[get]

Returns whether this layer is busy loading data, rendering, loading attributions, or anything else. When this property changes, a LayerEvent is delivered to the observers with the property name propertyBusy.

Note: when the map is moving around it can be that the layer is repeatedly loading new data, but does this fast enough that it is done by the time new data is needed, resulting in a repeatedly changing busyness state.

Since
2024.1 [get]

◆ IsVisible

bool Luciad.Layers.Layer.IsVisible
getset

Whether this layer is visible.

[get]

Returns whether this layer is visible.

[set]

Sets whether this layer is visible. Changes this layer's visibility. If the new visibility is different from the old one, a LayerEvent is delivered to the observers with the property name PropertyVisible.

◆ PropertyBusy

string Luciad.Layers.Layer.PropertyBusy = PropertyBusyInternal()
staticget

Property name for the LayerEvent that is fired as a result of the layer's busy flag changing.

Since
2024.1
See also
isBusy

◆ PropertyTitle

string Luciad.Layers.Layer.PropertyTitle = PropertyTitleInternal()
staticget

Property name for the LayerEvent that is fired as a result of changing the layer's title.

See also
Title

◆ PropertyVisible

string Luciad.Layers.Layer.PropertyVisible = PropertyVisibleInternal()
staticget

Property name for the LayerEvent that is fired as a result of changing the layer's visible flag.

See also
setVisible

◆ Title

string Luciad.Layers.Layer.Title
getset

The layer's title.

[get]

Returns the layer's title. Should be suitable for presenting to the user.

[set]

Sets the layer's title. Should be suitable for presenting to the user.

If the new title is indeed different from the old one, a LayerEvent is delivered to the observers with the property name PropertyTitle.