← Back to carmenta.com
Carmenta Engine SDK Documentation
×

PointVisualizer.ClipToViewArea Property

Gets or sets a value indicating if the feature should be clipped to the visible view area before the visualizer is applied.

Thread safety: This property is not thread-safe. Show

Syntax

C#
public AttributeVariable< System.Boolean > ClipToViewArea { get; set; }

Property Value

Type: An attribute variable that returns a value of type System.Boolean.
Default: false
True if the feature should be clipped to the view area; False otherwise.

Remarks

If this property is set to True, all features will be clipped to the visible area of the view before the visualizer is applied. If for instance AtCenter is also set to True, the text or symbol will always be drawn at the center of the visible part of polygon, hence it will always be visible on screen, regardless of zoom level. The same thing will happen when the visualizer is applied to a line or polygon boundary.

The same affect can be achieved by adding a RectangleClipOperator to the layer, which also clips the feature to the view area. However, that method will not work inside a TileLayer, whereas using this property will work for both tiled and non-tiled layers.

Warning

Using this property may impede rendering performance, especially inside a TileLayer, as it may require clipping operations to be performed in every view update. Use it only for labels that must always be visible.

Example

C#
// Visualize the symbol/text in the middle of the visualized part of a line 
// that has been clipped to the view area
static void VisualizeSymbolInTheMiddleOfTheOfALineClippedToViewArea(
    PointVisualizer pointVisualizer)
{
    // 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())   
    {
        // Set the
        pointVisualizer.At = 0.5;

        // Set Repeat to NO:
        // NO means, that the text/symbol is placed at a distance from the start of the 
        // line defined by the property PointVisualizer.At property where 0.0 means the 
        // start and 1.0 means the end.
        pointVisualizer.Repeat = Repeat.No;

        // Set clipped to view area
        pointVisualizer.ClipToViewArea = true;
    }
}

Platforms

Windows, Linux, Android

By accessing the information on this site you accept our terms and conditions and privacy policy.
This site uses cookies to enhance your experience and provide additional functionality.

Accept