Click or drag to resize
GraphicsLayerRenderingMode Property
Gets or sets a value indicating which rendering mode to use.

Namespace: Esri.ArcGISRuntime.Layers
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 10.2.7.0 (10.2.7.1234)
Syntax
public GraphicsRenderingMode RenderingMode { get; set; }

Property Value

Type: GraphicsRenderingMode
Remarks

To render very large amounts of features, set the rendering mode to Static. When static, graphics will not refresh during pan and zoom operations, but can better maintain a good map responsiveness. The amount of graphics the layer can handle in this mode is mainly limited by the system memory.

When the RenderingMode is set to Static the MarkerSymbols (including the inherited: PictureMarkerSymbols, SimpleMarkerSymbols, and TextSymbols) are always aligned with the MapView. This means that if the MapView rotates any MarkerSymbols on the Map will stay in the same rotation as the MapView. Hence the MarkerSymbols will appear to be static in their positioning with respect to the Map. Even though you may set the various MarkerSymbol AngleAlignment Properties, they will not be respected when the GraphicsRenderingMode is set to Static.

Conversely, when the GraphicsLayer.RenderingMode is set to Dynamic the MarkerSymbols (including inherited Types) will rotate independently of the MapView if the rotation is changed. Furthermore, setting the various MarkerSymbols AngleAlignment Properties is respected by the GraphicsRenderingMode when set to Dynamic.

Examples

Demonstrates setting the various GraphicsLayer.RenderingMode options and their effect on TextSymbols when the MapView is rotated.

Rotating a MapView and seeing various GraphicsLayerRenderMode effects.

XAML
<Window x:Class="GraphicsLayer_RenderingMode.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
    Title="MainWindow" Height="600" Width="800">

    <Grid x:Name="LayoutRoot">

        <StackPanel Orientation="Vertical">

            <!-- TextBlock to hold the instructions on how to use the sample code. -->
            <TextBlock Height="74" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="775" 
                   TextWrapping="Wrap" Margin="7,0,0,0" />

            <!-- Add buttons for the user to interact with. -->
            <StackPanel Orientation="Horizontal">
                <Button HorizontalAlignment="Left" VerticalAlignment="Top" Content="Rotate 90" Click="Rotate_Click" Margin="0,0,5,0" />
                <Button HorizontalAlignment="Left" VerticalAlignment="Top" Content="Reset" Click="Reset_Click" />
            </StackPanel>

            <!-- Add a MapView Control. -->
            <esri:MapView x:Name="MapView1" Background="White" HorizontalAlignment="Left" Height="464" Width="792">

                <!-- Add a Map. -->
                <esri:Map x:Name="Map1">

                    <!-- Add an ArcGISTiledMapServiceLayer. -->
                    <esri:ArcGISTiledMapServiceLayer ID="Basemap" ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>

                </esri:Map>
            </esri:MapView>

        </StackPanel>

    </Grid>

</Window>

SPECIAL NOTE: The XAML displayed above comes from a C# project. If you are a VB.NET developer, you will need to modify the text for the x:Class namespace from "GraphicsLayer_RenderingMode.MainWindow" to be just "MainWindow".

namespace GraphicsLayer_RenderingMode
{
    public partial class MainWindow : System.Windows.Window
    {
        // Declare two GraphicsLayers; one using the RenderingMode of Dynamic and the other using the RenderingMode of Static.
        private Esri.ArcGISRuntime.Layers.GraphicsLayer _GraphicsLayer_Dynamic;
        private Esri.ArcGISRuntime.Layers.GraphicsLayer _GraphicsLayer_Static;

        public MainWindow()
        {
            InitializeComponent();

            // Add instructions on how to use the sample. 
            TextBlock1.Text = "When the application loads a background ArcGISTiledMapServiceLayer and two GraphicsLayers will be added " + 
                "to the Map. One GraphicsLayer will have it's RenderingMode set to Dynamic, the other GraphicsLayer will have it's " + 
                "RenderingMode set to Static. A TextSymbol will be added to each GraphicsLayer. Click the 'Rotate 90' button to have the " + 
                "MapView rotate 90 degrees. Observe how the TextSymbols behave differently based on the GraphicsLayers.RenderingMode.";

            // Create the GraphicsLayer and set it's RenderingMode to be Dynamic. 
            _GraphicsLayer_Dynamic = new Esri.ArcGISRuntime.Layers.GraphicsLayer();
            _GraphicsLayer_Dynamic.RenderingMode = Esri.ArcGISRuntime.Layers.GraphicsRenderingMode.Dynamic;

            // Create a new Graphic.
            Esri.ArcGISRuntime.Layers.Graphic myGraphic1 = new Esri.ArcGISRuntime.Layers.Graphic();

            // Create a new MapPoint and set the Graphic's Geometry to be the MapPoint.
            Esri.ArcGISRuntime.Geometry.MapPoint myMapPoint = new Esri.ArcGISRuntime.Geometry.MapPoint(-5000000, -1000000);
            myGraphic1.Geometry = myMapPoint;

            // Create a new TextSymbol and set the Graphic's Symbol to be the TextSymbol.
            Esri.ArcGISRuntime.Symbology.TextSymbol myTextSymbol = new Esri.ArcGISRuntime.Symbology.TextSymbol();
            myTextSymbol.Text = "DYNAMIC - rotates independent of Map.";
            myTextSymbol.Color = System.Windows.Media.Colors.Red;
            myTextSymbol.AngleAlignment = Esri.ArcGISRuntime.Symbology.MarkerAngleAlignment.Screen;
            myTextSymbol.Font = new Esri.ArcGISRuntime.Symbology.SymbolFont("Arial", 18);
            myGraphic1.Symbol = myTextSymbol;

            // Add the Graphic to the GraphicsLayer's GraphicCollection.
            _GraphicsLayer_Dynamic.Graphics.Add(myGraphic1);

            // Add the GraphicsLayer to the Map's LayerCollection. 
            MapView1.Map.Layers.Add(_GraphicsLayer_Dynamic);

            // ------------------------------------------------------------------------------------------------------

            // Create the GraphicsLayer and set it's RenderingMode to be Static. 
            _GraphicsLayer_Static = new Esri.ArcGISRuntime.Layers.GraphicsLayer();
            _GraphicsLayer_Static.RenderingMode = Esri.ArcGISRuntime.Layers.GraphicsRenderingMode.Static;

            // Create a new Graphic.
            Esri.ArcGISRuntime.Layers.Graphic myGraphic2 = new Esri.ArcGISRuntime.Layers.Graphic();

            // Create a new MapPoint and set the Graphic's Geometry to be the MapPoint.
            Esri.ArcGISRuntime.Geometry.MapPoint myMapPoint2 = new Esri.ArcGISRuntime.Geometry.MapPoint(-5000000, -0);
            myGraphic2.Geometry = myMapPoint2;

            // Create a new TextSymbol and set the Graphic's Symbol to be the TextSymbol.
            Esri.ArcGISRuntime.Symbology.TextSymbol myTextSymbol2 = new Esri.ArcGISRuntime.Symbology.TextSymbol();
            myTextSymbol2.Text = "STATIC - stays same orientation as Map.";
            myTextSymbol2.Color = System.Windows.Media.Colors.Blue;
            myTextSymbol2.AngleAlignment = Esri.ArcGISRuntime.Symbology.MarkerAngleAlignment.Screen;
            myTextSymbol2.Font = new Esri.ArcGISRuntime.Symbology.SymbolFont("Arial", 18);
            myGraphic2.Symbol = myTextSymbol2;

            // Add the Graphic to the GraphicsLayer's GraphicCollection.
            _GraphicsLayer_Static.Graphics.Add(myGraphic2);

            // Add the GraphicsLayer to the Map's LayerCollection. 
            MapView1.Map.Layers.Add(_GraphicsLayer_Static);
        }

        private void Reset_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // Reset the MapView's rotation back to it's default setting.
            MapView1.SetRotationAsync(0);
        }

        private void Rotate_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // Rotate the MapView by +90 degrees.
            MapView1.SetRotationAsync(MapView1.Rotation + 90);
        }

    }
}
See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
Camera_SetMethodsDemonstrates navigating/animating between MapPoint Graphics with a Camera. Simultaneous changes of X, Y, Z, Pitch, and Heading during the animation is shown.
GraphicsLayer_RenderingModeDemonstrates setting the various GraphicsLayer.RenderingMode options and their effect on TextSymbols when the MapView is rotated.
GraphicsLayerWindowDemonstrates various Graphics and GraphicsLayer related actions.