LuciadCPillar C# 2023.1.02
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Class Reference

Command to draw labels for a feature. More...

Inheritance diagram for Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand:

Public Member Functions

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Anchor (Luciad.Geometries.Geometry anchor)
 Sets the anchor of the label. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand AnchorDraped (bool draped)
 Specify whether the anchor is draped or not. More...
 
void Dispose ()
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Icon (Luciad.Drawing.IIcon icon)
 Sets the icon to use for the label. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand InPath ()
 Configure the LabelDrawCommand to paint the label inside the anchor. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand LabelGroup (Luciad.Layers.Features.LabelGroup labelGroup)
 Set the LabelGroup for label decluttering. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand OnPath (Luciad.Layers.Styles.OnPathLabelStyle onPathLabelStyle)
 Configure the LabelDrawCommand to position a single label along a line. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand OnPath (Luciad.Layers.Styles.PathLabelPosition verticalPosition, double additionalVerticalOffset)
 Configure the LabelDrawCommand to position a single label along a line. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand PinStyle (Luciad.Layers.Styles.PinStyle pinStyle)
 This method enables pins for labels and defines their styling. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand PointPositions (System.Collections.Generic.IList< Luciad.Drawing.RelativePosition > positions)
 Specifies the possible positions to place a Point label. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Priority (Luciad.Containers.Priority priority)
 Sets the priority that is used to determine the order in which labels are placed. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Queryable (bool queryable)
 Indicates whether or not the label should be considered when a Map::queryFeatures is requested. More...
 
void Submit ()
 Submits this draw command. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Text (Luciad.Text.TextBlock text)
 Sets the text block to use for the label. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Text (string text)
 Sets the text to use for the label. More...
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Text (System.Collections.Generic.IList< string > text, Luciad.Drawing.HorizontalAlignment alignment=Luciad.Drawing.HorizontalAlignment.Left)
 
Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand TextStyle (Luciad.Text.TextStyle textStyle)
 Sets the styling for the text. More...
 

Detailed Description

Command to draw labels for a feature.

It is mandatory to specify at least the following: The anchor geometry to which the label is attached The label content

Label content

The label content can be A single line of text: see text(std::string) Multiple lines text: see text(std::vector<std::string>,HorizontalAlignment alignment) A text block: see text(TextBlock) An icon: see icon

It is mandatory to call at least one of these methods. If not, an exception will be thrown when submitting this label draw command. If these methods are called multiple times, only the last one is used. Label positions

It is possible to explicitly specify a label position. This can be done using one of the following methods: the pointPositions method: to anchor a label to a Point geometry the onPath method: to place a label along a line the inPath method: to place a label inside an area

If these methods are called multiple times, only the last one is used. If none of these methods is called, a default label positions is chosen using the LabelDrawCommand::anchor geometry. Label decluttering

Labels that are added using this class are automatically decluttered: Multiple label locations are tried to avoid overlapping labels Labels for which no good location can be found (i.e. that would always overlap with an other label) are dropped.

See the related guide for a more extensive overview of the labeling API. 2020.2

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand.

Member Function Documentation

◆ Anchor()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Anchor ( Luciad.Geometries.Geometry  anchor)
inline

Sets the anchor of the label.

This property is mandatory.

anchor

the anchor of the label, cannot be nullptr.

this

luciad::NullArgumentException

if the anchor is nullptr.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::anchor.

◆ AnchorDraped()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.AnchorDraped ( bool  draped)
inline

Specify whether the anchor is draped or not.

If this method is not invoked, the draping status will be the same as when rendering the anchor: if all Z components equal to 0, draping is enabled and the label will be on the ground. Otherwise, the label will be placed at anchor elevation.

draped

whether the anchor is draped or not.

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::anchorDraped.

◆ Dispose()

void Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Dispose ( )
inline

◆ Icon()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Icon ( Luciad.Drawing.IIcon  icon)
inline

Sets the icon to use for the label.

This property is optional, though it is mandatory that at least one method is used to specify the label content. See the class documentation for more info.

icon

the icon to use for the label, cannot be nullptr

this

luciad::NullArgumentException

when the icon is nullptr.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::icon.

◆ InPath()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.InPath ( )
inline

Configure the LabelDrawCommand to paint the label inside the anchor.

The anchor is used as follows: The anchor must be a closed ring or a surface, or contain one. If it's not the case, an exception is thrown in the submit method. If the anchor is a multi geometry, only the biggest one is considered. If the anchor is an extruded one, the base geometry is considered. If the anchor is a Patch, the base geometry is considered. For other geometries, the label is positioned in such a way that it's inside the anchor geometry.

Calling this method is optional. See LabelDrawCommand for more information. this LabelDrawCommand

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::inPath.

◆ LabelGroup()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.LabelGroup ( Luciad.Layers.Features.LabelGroup  labelGroup)
inline

Set the LabelGroup for label decluttering.

A label declutter group is a collection of labels that are positioned independently from other label declutter groups. I.e. labels from one group will never affect labels from other groups. This also means that labels from different groups are allowed to overlap.

labelGroup

declutter group for this label. See LabelGroup for more information.

this LabelDrawCommand

2021.0

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::labelGroup.

◆ OnPath() [1/2]

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.OnPath ( Luciad.Layers.Styles.OnPathLabelStyle  onPathLabelStyle)
inline

Configure the LabelDrawCommand to position a single label along a line.

Depending on how the given OnPathLabelStyle is configured, it can be located somewhere along the line, but also within the view extent at a specific location along the line, for example exactly in the middle

When this method is called, the anchor must be a Curve. If an anchor is specified that is not supported by this labeling method, an exception will be thrown when the label command is submitted. Calling this method is optional. See LabelDrawCommand for more information.

onPathLabelStyle

specifies all parameters needed to place the label at a specific location along the line, cannot be nullptr.

this LabelDrawCommand

2021.0

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::onPath.

◆ OnPath() [2/2]

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.OnPath ( Luciad.Layers.Styles.PathLabelPosition  verticalPosition,
double  additionalVerticalOffset 
)
inline

Configure the LabelDrawCommand to position a single label along a line.

The label will also be placed within the view extent if possible. When this method is called, the anchor must be a Curve or consist of one in case of: MultiGeometry ExtrudedGeometry Patch CompositePatch

Also Bounds geometries are supported. If an anchor is specified that is not supported by this labeling method, an exception will be thrown when the label command is submitted. Calling this method is optional. See LabelDrawCommand for more information.

verticalPosition

specifies where the label is placed wrt to a position on the line.

additionalVerticalOffset

an additional perpendicular offset from the position on the line at which a label will be placed. This offset is expressed in pixels. If the value is positive, the label position is moved away from the line. If the value is negative, the label positions is moved towards the line. There is no maximum limit to the negative values, but keep in mind that large negative values will push the label to the opposite side of the line. The default offset is 0.

this LabelDrawCommand

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::onPath.

◆ PinStyle()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.PinStyle ( Luciad.Layers.Styles.PinStyle  pinStyle)
inline

This method enables pins for labels and defines their styling.

By default, there's no pin for labels. Pins are only supported when a label is attached to a point. No pin will be painted when onPath or inPath label positioning is used.

pinStyle

the styling for the pin. See PinStyle::newBuilder. This property is optional. By default, there's no pin for labels.

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::pinStyle.

◆ PointPositions()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.PointPositions ( System.Collections.Generic.IList< Luciad.Drawing.RelativePosition positions)
inline

Specifies the possible positions to place a Point label.

If the anchor is not a point geometry, an exception is thrown in the submit method. Calling this method is optional. See LabelDrawCommand for more information.

positions

the possible positions for a point label. If empty, an exception is thrown.

this LabelDrawCommand

luciad::InvalidArgumentException

if the list of positions is empty.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::pointPositions.

◆ Priority()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Priority ( Luciad.Containers.Priority  priority)
inline

Sets the priority that is used to determine the order in which labels are placed.

Using a high priority will make it more likely for a label to be placed. Using a low priority will make it more likely for the label to be omitted during label placement, because other labels with a higher priority may already occupy its space.

Label priorities work across layers. This means that it is possible to give a high priority to a label, regardless of where the layer is located in the Map's LayerList. This property is optional. The default is Priority::normal().

priority

the priority for this label

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::priority.

◆ Queryable()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Queryable ( bool  queryable)
inline

Indicates whether or not the label should be considered when a Map::queryFeatures is requested.

The default is true.

queryable

true if the label should be considered.

this TextDrawCommand.

2020.2

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::queryable.

◆ Submit()

void Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Submit ( )
inline

Submits this draw command.

Nothing will be painted if the draw command is not submitted.

LogicException

if anchor is not a luciad::Point and the pointPositions method is used.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::submit.

◆ Text() [1/3]

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Text ( Luciad.Text.TextBlock  text)
inline

Sets the text block to use for the label.

A text block is composed of multiple texts with different styling each. See TextBlock and TextBlock::Builder. This property is optional, though it is mandatory that at least one method is used to specify the label content. See the class documentation for more info.

text

the text block to use for the label.

this

2021.0

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::text.

◆ Text() [2/3]

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Text ( string  text)
inline

Sets the text to use for the label.

This property is optional, though it is mandatory that at least one method is used to specify the label content. See the class documentation for more info.

text

the text to use for the label.

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::text.

◆ Text() [3/3]

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.Text ( System.Collections.Generic.IList< string >  text,
Luciad.Drawing.HorizontalAlignment  alignment = Luciad.Drawing.HorizontalAlignment.Left 
)
inline

◆ TextStyle()

Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand Luciad.Layers.Features.FeatureCanvas.LabelDrawCommand.TextStyle ( Luciad.Text.TextStyle  textStyle)
inline

Sets the styling for the text.

This property is optional. See the text style builder for the default values.

textStyle

the styling for the text.

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureCanvas::LabelDrawCommand::textStyle.