PointVisualizer.Rotation Property
Gets or sets a value specifying the direction of the object.
Syntax
public AttributeVariable< System.Double > Rotation { get; set; }
Property Value
Default: 0.0
An angle in degrees, clockwise from an up direction specified by other properties.
Remarks
This property adds a rotation to the object. Loosely speaking, the value zero means unrotated, but this makes sense only if we have defined the up direction. There are five common definitions of up:
Heading (in a moving map with heading-up).
Grid north (north according to the grid lines of the View.Crs map projection).
True north.
Segment direction along a line or a polygon perimeter.
Parent direction: the overall direction of a PointVisualizerSet that contains this PointVisualizer.
![]() |
The image shows a view that uses a standard map projection for Europe, Crs.EtrsLcc. The purple grid, annotated in kilometers, shows the EtrsLcc grid, while the brown graticule, annotated in degrees, shows longitude and latitude. Since the map projection is conic, all meridians meet at the north pole and grid north differs from true north. (See Crs.AngleFromAzimuth for more details.)
Furthermore, the view has a View.Rotation = 340°, to show a heading-up moving map. This means that the heading differs from both grid north and true north.
The image shows five text labels in red outlines, "S", "H", "G", "T" and "kn". Each of them was generated by a TextVisualizer that had Rotation = 0.0, but used its own definition of up (zero direction).
The black "H" uses the heading as up.
The purple "G" uses the grid north as up.
The brown "T" uses true north as up.
The green "S" was generated by a text visualizer applied directly to the green line feature, and the up is the direction of the segment on which the label appears.
The blue "kn" was generated by a text visualizer that is part of a PointVisualizerSet that generated "25 kn", and the up for "kn" is the overall rotation of the point visualizer set (the parent visualizer).
To choose one of the five definitions, one must set values for AzimuthRotation and RotationMode, according to this table:
Definition | ||
---|---|---|
Heading | False | Fixed |
Grid north | False | FixedToView |
True north | True | FixedToView |
Segment direction | False | Rotated, Up or FlipUp |
Parent direction | False | Rotated |
Other combinations of AzimuthRotation and RotationMode are not very useful. Up and FlipUp behaves much like Rotated, but can rotate a text an extra 180° (in different ways) to avoid upside-down texts; see the Rotation enumeration.
Note that the combination that specifies parent direction can also mean segment direction: which one is used depends on whether the PointVisualizer is used on its own, or is part of a PointVisualizerSet, the parent. If you need the ability to rotate the result of a PointVisualizerSet as one rigid chunk, you should set RotationMode = Rotated on all its parts and subparts; only the root itself may have some other rotation mode.
Unlike a PointVisualizerSet, the simpler VisualizerSet does not give a parent direction to its parts.
If up is specified to be segment direction according to the table, but the point visualizer is applied to a point feature (or to a polygon feature using AtCenter = True), then there is no segment to use, and it is assumed that up is grid north; in other words Rotated would behave like FixedToView.
Note that when up is segment direction, a Rotation = 0.0 will cause a long text label to be perpendicular to the segment. To make a long text label parallel to a segment, one must use Rotation = -90 or 270. Even then, the segment direction is retrieved only from the insertion point of the point visualizer, so if the line feature is curved, it may be better to set TextVisualizer.FollowLine = True instead (the Rotation value will then be ignored).
Example
// Set the rotation true north from attribute
public static void SetRotationTrueNorthFromAttribute(
PointVisualizer pointVisualizer, Atom rotationAttributeKey)
{
// 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())
{
// Enable AzimuthRotation
pointVisualizer.AzimuthRotation = true;
// Set RotationMode FixedToView
pointVisualizer.RotationMode = Rotation.FixedToView;
// True north rotation is achieved by the combination of AzimuthRotation and
// RotationMode = FixedToView.
// Add the rotation to the SymbolVisualizer.
pointVisualizer.Rotation =
new IndirectAttributeVariable<double>(rotationAttributeKey, 0.0);
}
}
Platforms
Windows, Linux, Android