View.UpdateAttributes Property
Gets an AttributeSet defining application-specific update attributes.
Syntax
public AttributeSet UpdateAttributes { get; }
Property Value
Remarks
Update attributes can be specified in the configuration file or by application code. Other components in the configuration file may use these attributes to control their behavior, just as they would use attributes from the features. Typically the attributes are accessed via an attribute variable.
You could - for instance - specify the AntiAlias value for some visualizers as indirect values based on the "globalAntiAlias" attribute, and then set "globalAntiAlias" in the UpdateAttributes of the view to True or False to modify the global appearance of the map. Combine this kind of indirect value with the ability to set a default value of an attribute variable for even greater flexibility.
Predefined update attributes
Apart from your own application-specific attributes that you can specify with this property, there are some predefined update attributes that may be recomputed at each update. These will not be retrieved by the UpdateAttributes getter method, but they will be available in conditions and attribute variables.
The predefined update attributes are:
AttributeName | Attribute type | Description |
---|---|---|
updateViewScale | Double | The current (inverted) nominal scale of the view |
updateDataScale | Double | The same as updateViewScale in all layers except in a TileLayer, where it is the (inverted) nominal scale being used for the current tile level. |
updatePixelHeight | Double | The height of one pixel as defined in the coordinate reference system of the view. |
updatePixelWidth | Double | The width of one pixel as defined in the coordinate reference system of the view. |
updateSelectionVisualization | Bool | True if the current rendering is the selection visualization. Note that this update attribute is only available to visualizers. It can not not be used in layer conditions, operators, or by custom code in custom datasets and custom operators. |
update3D | Bool | True if the current rendering is for a 3D visualization. (For operators and visualizers below RasterizeOperator and LayerRasterizeOperator this value will be False.) |
updatePrinting | Bool | True if the current rendering is for a Printer drawable. (For operators and visualizers below RasterizeOperator and LayerRasterizeOperator this value will be False.) |
updateCameraBearing | Double | The bearing of the "camera", i.e. GlobeView.CameraBearing or Rotation. |
distance3D | Double | The distance between the center of the feature being rendered and the camera position in a GlobeView, in meters. Note that this update attribute is only available to visualizers rendering 3D objects. It can not be used in 2D, by other objects in 3D like operators, or even visualizers in 3D operating in "2D mode" (like in the surface layers of a GlobeView. It can not be used in custom symbols or visualizers. For TacticalVisualizer the attribute can be used in the condition, but not in the related parameter classes. The visualization created by visualizers using this attribute will be automatically updated when the 3D camera is changed, even if the visualization is cached by a or GlobeTileLayer or an OrdinaryLayer with dynamic caching. This can affect performance if used for a large number of objects. If possible, use multiple visualizers with different conditions based on the distance3D attribute, rather than using a keyed attribute variable in a single visualizer. |
quickUpdate | Bool | Not always defined, but a value of True indicates that the current update needs to be extra quick. It can be set to True by an application, and is usually also set by the standard tool during mouse pan and zoom interactions, see StandardTool.QuickUpdateEnabled. A slow layer can disable itself during a quick update, see the Layer.EnabledDuringQuickUpdates property . |
Example
// Set update attribute in a View
public static void TurnOnNightMode(View view)
{
// Set the user property Mode = "Night", all UpdateAttributes set on a View
// are available when conditions and attribute variables are evaluted and the
// the View is rendered. In this case the "Mode" property could be used to
// turn off visualization of certain layers/features or to select other colors.
view.UpdateAttributes.Add("Mode", "Night");
// Update the View with the new user property set
view.Update();
}
Platforms
Windows, Linux, Android