Click or drag to resize

SimpleRenderer Class

A custom symbology renderer where the features of a Layer are displayed as a single symbol.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Symbology
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
Syntax
[ContentPropertyAttribute("Symbol")]
public class SimpleRenderer : Renderer

The SimpleRenderer type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleSimpleRenderer
Initializes a new instance of the SimpleRenderer class.
Public methodCode exampleSimpleRenderer(Symbol)
Initializes a new instance of the SimpleRenderer class with the given symbol.
Top
Properties
  NameDescription
Public propertyDescription
Gets or sets the renderer description.
Public propertyLabel
Gets or sets the renderer label.
Public propertyCode exampleRotationExpression
Gets/sets the expression describing how a Graphic's attributes are translated into a rotation to be applied to the Graphic.
(Inherited from Renderer.)
Public propertyRotationType
Gets/sets whether the rotation calculated from the RotationExpression is screen- or map-relative.
(Inherited from Renderer.)
Public propertyCode exampleSceneProperties
Gets or sets the scene properties for the renderer.
(Inherited from Renderer.)
Public propertyCode exampleSymbol
Gets or sets the symbol this renderer will use.
Public propertyUnknownJson
Gets unknown data from the source JSON.
(Inherited from Renderer.)
Public propertyUnsupportedJson
Gets unsupported data from the source JSON.
(Inherited from Renderer.)
Top
Methods
  NameDescription
Public methodCode exampleClone
Returns a clone of the Renderer.
(Inherited from Renderer.)
Public methodGetSymbol(GeoElement)
Returns the symbol the renderer uses to represent the supplied GeoElement.
(Inherited from Renderer.)
Public methodGetSymbol(GeoElement, Boolean)
Returns the symbol that should be used to visualize the given GeoElement with override attributes from renderer.
(Inherited from Renderer.)
Public methodToJson
Returns the json representation of the renderer
(Inherited from Renderer.)
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Renderer.)
Top
Examples

WPF

Example Name: SimpleRenderers

Display common symbols for all graphics in a graphics overlay with a renderer.

Code example screen shot.

C#
// Copyright 2017 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using System.Drawing;

namespace ArcGISRuntime.WPF.Samples.SimpleRenderers
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Simple renderer",
        category: "Symbology",
        description: "Display common symbols for all graphics in a graphics overlay with a renderer.",
        instructions: "The sample loads with a predefined simple renderer, which displays a red cross simple marker symbol for the graphics in the graphics overlay.",
        tags: new[] { "graphics", "marker", "renderer", "symbol", "symbolize", "symbology" })]
    public partial class SimpleRenderers
    {
        public SimpleRenderers()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization.
            Initialize();
        }

        private void Initialize()
        {
            // Create new map with basemap layer.
            Map myMap = new Map(BasemapStyle.ArcGISImagery);

            // Create several map points using the WGS84 coordinates (latitude and longitude).
            MapPoint oldFaithfulPoint = new MapPoint(-110.828140, 44.460458, SpatialReferences.Wgs84);
            MapPoint cascadeGeyserPoint = new MapPoint(-110.829004, 44.462438, SpatialReferences.Wgs84);
            MapPoint plumeGeyserPoint = new MapPoint(-110.829381, 44.462735, SpatialReferences.Wgs84);

            // Use the two points farthest apart to create an envelope.
            Envelope initialEnvelope = new Envelope(oldFaithfulPoint, plumeGeyserPoint);

            // Set the map initial viewpoint
            myMap.InitialViewpoint = new Viewpoint(initialEnvelope);

            // Add the map to the map view
            MyMapView.Map = myMap;

            // Set the viewpoint to the envelope with padding.
            MyMapView.SetViewpointGeometryAsync(initialEnvelope, 50);

            // Create a graphics overlay.
            GraphicsOverlay myGraphicOverlay = new GraphicsOverlay();

            // Create graphics based upon the map points.
            Graphic oldFaithfulGraphic = new Graphic(oldFaithfulPoint);
            Graphic cascadeGeyserGraphic = new Graphic(cascadeGeyserPoint);
            Graphic plumeGeyserGraphic = new Graphic(plumeGeyserPoint);

            // Add the graphics to the graphics overlay.
            myGraphicOverlay.Graphics.Add(oldFaithfulGraphic);
            myGraphicOverlay.Graphics.Add(cascadeGeyserGraphic);
            myGraphicOverlay.Graphics.Add(plumeGeyserGraphic);

            // Create a simple marker symbol - red, cross, size 12.
            SimpleMarkerSymbol mySymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Cross, Color.Red, 12);

            // Create a simple renderer based on the simple marker symbol.
            SimpleRenderer myRenderer = new SimpleRenderer(mySymbol);

            // Apply the renderer to the graphics overlay (all graphics use the same symbol).
            myGraphicOverlay.Renderer = myRenderer;

            // Add the graphics overlay to the map view.
            MyMapView.GraphicsOverlays.Add(myGraphicOverlay);
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.SimpleRenderers.SimpleRenderers"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
    </Grid>
</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddGraphicsRendererA renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style.
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
BrowseWfsLayersBrowse a WFS service for layers and add them to the map.
BufferCreate a buffer around a map point and display the results as a `Graphic`
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
DisplaySubtypeFeatureLayerDisplays a composite layer of all the subtype values in a feature class.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerTimeOffsetDisplay a time-enabled feature layer with a time offset.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapTake a web map offline.
GenerateOfflineMapWithOverridesTake a web map offline with additional options for each layer.
MobileMapSearchAndRouteDisplay maps and use locators to enable search and routing offline using a Mobile Map Package.
OfflineBasemapByReferenceUse the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
OfflineRoutingSolve a route on-the-fly using offline data.
ProjectProject a point from one spatial reference to another.
ScenePropertiesExpressionsUpdate the orientation of a graphic using expressions based on its attributes.
ShowLocationHistoryDisplay your location history on the map.
SimpleRenderersDisplay common symbols for all graphics in a graphics overlay with a renderer.
SymbolizeShapefileDisplay a shapefile with custom symbology.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.