Layer.EnabledDuringQuickUpdates Property
Determines whether the Layer is temporarily turned off during mouse interactions.
Syntax
public System.Boolean EnabledDuringQuickUpdates { get; set; }
Property Value
Default: Differs depending on type. See the table below.
True if layer is enabled even during mouse pan and zooms; False if the layer is temporarily turned off.
Default values
Class | Default value |
---|---|
AggregatingLayer | true |
BitmapLayer | true |
CatalogLayer | true |
CatalogLoadLayerSet | true |
CatalogMap | true |
GlobeTileLayer | Not used. |
LabelOrganizingLayer | true |
LayerSet | true |
LoadLayerSet | true |
OgcWmsLayer | true |
OgcWmsServerLayer | true |
OgcWmtsLayer | true |
OgcWmtsServerLayer | true |
OrdinaryLayer | true |
PlotLayer | true |
RadarVideoLayer | true |
ScreenLayer | true |
TileLayer | true |
Remarks
This property can be used to turn off the layer during certain mouse interactions. This can improve the frame rate while the user is manipulating the map, and provide better feedback to the user. For instance, text layers and maybe other layers like roads can be turned off while the map is zoomed or panned. The layers will be automatically restored when the interaction is complete.
This is accomplished by setting an update attribute on the view (see View.UpdateAttributes) with the key "quickUpdate". This is done by StandardTool for all updates during mouse pan and zoom interactions. The tool has a property to turn off this feature, even if this parameter is set to False on a layer, see StandardTool.QuickUpdateEnabled.
Note that EnabledDuringQuickUpdates can only be used to turn off a layer during quick updates. If you want to do the opposite, i.e. enable a layer only during quick updates, you can achieve this by setting an appropriate Condition instead, that checks if the "quickUpdate" attribute is set; the condition can formulated simply as
quickUpdate
since the attribute will be either True or undefined (null). This can be used to temporarily enable a fast replacement layer when other, slower layers are disabled with this feature.
Example
// Disable the layer during quick updates
public static void DisableLayerDuringQuickUpdates(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())
{
layer.EnabledDuringQuickUpdates = false;
}
}
Platforms
Windows, Linux, Android