Layer.Condition Property
Gets or sets the Condition that determines whether the Layer is drawn or not.
Syntax
public Condition Condition { get; set; }
Property Value
Remarks
If this property is set and the condition evaluates to False, the layer will not be drawn when updating the map. The condition is evaluated once at the beginning of an update cycle and it can only use the update attributes from the view or parent layers, it cannot access attributes from any features.
Note that the Enabled, MinScale and MaxScale properties are also used to control if the layer is drawn.
Example
// Disable the layer when printing
public static void DisableLayerForPrinting(Layer layer)
{
// This property is a member of a type that might be referred to by a View
// or a GlobeView, either directly or indirectly through other objects, which means
// that you must use the Guard class to take the global configuration lock when it
// is modified to synchronize access with any running Carmenta Engine threads.
using (Guard guard = new Guard())
{
// Disable the Layer if the updatePrinting update attribute is True
layer.Condition = new Condition("updatePrinting = false");
}
}
Platforms
Windows, Linux, Android