Click or drag to resize

SimpleMarkerSymbol Class

A basic color and marker shape used to represent point features on a map. At a minimum use the Color, Outline, Size, and Style Properties to modify its default appearance. Other Properties are also available for more generate more complex visualizations.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Symbology
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0
Syntax
public class SimpleMarkerSymbol : MarkerSymbol

The SimpleMarkerSymbol type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleSimpleMarkerSymbol
Initializes a new instance of the SimpleMarkerSymbol class.
Public methodSimpleMarkerSymbol(SimpleMarkerSymbolStyle, Color, Double)
Initializes a new instance of the SimpleMarkerSymbol class.
Top
Properties
  NameDescription
Public propertyAngle
Gets or sets the rotation angle.
(Inherited from MarkerSymbol.)
Public propertyAngleAlignment
Gets or sets the rotation angle alignment. Default value is Screen
(Inherited from MarkerSymbol.)
Public propertyCode exampleColor
Gets or sets the color
Public propertyCode exampleLeaderOffsetX
Gets or sets the leader offset X of the marker symbol.
(Inherited from MarkerSymbol.)
Public propertyLeaderOffsetY
Gets or sets the leader offset Y of the marker symbol.
(Inherited from MarkerSymbol.)
Public propertyCode exampleOffsetX
Gets or sets the X offset.
(Inherited from MarkerSymbol.)
Public propertyCode exampleOffsetY
Gets or sets the Y offset.
(Inherited from MarkerSymbol.)
Public propertyOutline
Gets or sets the outline line symbol
Public propertyRotationType Obsolete.
Gets or sets the rotation type of the marker symbol.
(Inherited from MarkerSymbol.)
Public propertyCode exampleSize
Gets or sets the symbol size
Public propertyCode exampleStyle
Gets or sets the marker symbol style
Top
Methods
  NameDescription
Public methodClone
Clones this instance of Symbol and its members.
(Inherited from Symbol.)
Public methodCode exampleCreateSwatchAsync(Double)
Creates a swatch image of this symbol using the default size and a transparent background.
(Inherited from Symbol.)
Public methodCreateSwatchAsync(Color, Double)
Creates a swatch image of this symbol, using the default sizing and a transparent background.
(Inherited from Symbol.)
Public methodCreateSwatchAsync(Int32, Int32, Double, Color)
Creates a swatch image of this symbol, scaled to fit the specified dimensions.
(Inherited from Symbol.)
Public methodCreateSwatchAsync(Int32, Int32, Single, Color, Geometry)
Creates a swatch image of this symbol, with the specified image size, dpi, background color, and geometry.
(Inherited from Symbol.)
Public methodToJson
Returns the json representation of the symbol
(Inherited from Symbol.)
Public methodToMultilayerSymbol
Converts a SimpleMarkerSymbol to a MultilayerPointSymbol.
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Symbol.)
Top
Examples

WPF

Example Name: RenderSimpleMarkers

Show a simple marker symbol on a map.

Code example screen shot.

C#
// Copyright 2016 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;

namespace ArcGISRuntime.WPF.Samples.RenderSimpleMarkers
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Simple marker symbol",
        category: "Symbology",
        description: "Show a simple marker symbol on a map.",
        instructions: "The sample loads with a predefined simple marker symbol, set as a red circle.",
        tags: new[] { "SimpleMarkerSymbol", "symbol" })]

    public partial class RenderSimpleMarkers
    {
        public RenderSimpleMarkers()
        {
            InitializeComponent();

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

        private void Initialize()
        {
            // Create new Map with basemap
            Map myMap = new Map(Basemap.CreateImagery());

            // Create initial map location and reuse the location for graphic
            MapPoint centralLocation = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);
            Viewpoint initialViewpoint = new Viewpoint(centralLocation, 7500);

            // Set initial viewpoint
            myMap.InitialViewpoint = initialViewpoint;

            // Provide used Map to the MapView
            MyMapView.Map = myMap;

            // Create overlay to where graphics are shown
            GraphicsOverlay overlay = new GraphicsOverlay();

            // Add created overlay to the MapView
            MyMapView.GraphicsOverlays.Add(overlay);

            // Create a simple marker symbol
            SimpleMarkerSymbol simpleSymbol = new SimpleMarkerSymbol()
            {
                Color = System.Drawing.Color.Red,
                Size = 10,
                Style = SimpleMarkerSymbolStyle.Circle
            };

            // Add a new graphic with a central point that was created earlier
            Graphic graphicWithSymbol = new Graphic(centralLocation, simpleSymbol);
            overlay.Graphics.Add(graphicWithSymbol);
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.RenderSimpleMarkers.RenderSimpleMarkers"
             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.
ClosestFacilityFind a route to the closest facility from a location.
DisplaySubtypeFeatureLayerDisplays a composite layer of all the subtype values in a feature class.
FeatureLayerTimeOffsetDisplay a time-enabled feature layer with a time offset.
ListTransformationsGet a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
NavigateRouteUse a routing service to navigate between points.
NavigateRouteReroutingNavigate between two points and dynamically recalculate an alternate route when the original route is unavailable.
ProjectProject a point from one spatial reference to another.
RenderSimpleMarkersShow a simple marker symbol on a map.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
UseDistanceCompositeSymChange a graphic's symbol based on the camera's proximity to it.