Click or drag to resize

SimpleLineSymbol Class

A basic color and pattern used to represent polyline features on a map. Use the Color, Style, and Width Properties to modify its appearance.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Symbology
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
Syntax
public class SimpleLineSymbol : LineSymbol

The SimpleLineSymbol type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleSimpleLineSymbol
Initializes a new instance of the SimpleLineSymbol class.
Public methodSimpleLineSymbol(SimpleLineSymbolStyle, Color, Double)
Initializes a new instance of the SimpleLineSymbol class.
Top
Properties
  NameDescription
Public propertyAntiAlias
Gets or sets the anti-alias setting of the line symbol
(Inherited from LineSymbol.)
Public propertyCode exampleColor
Gets or sets the line symbol color
(Inherited from LineSymbol.)
Public propertyMarkerPlacement
Get the simple line symbol end marker placement of the simple line symbol.
Public propertyMarkerStyle
Get the simple line symbol end marker style of the simple line symbol.
Public propertyCode exampleStyle
Gets or sets the Line symbol style
Public propertyCode exampleWidth
Gets or sets the line symbol width
(Inherited from LineSymbol.)
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 SimpleLineSymbol to a MultilayerPolylineSymbol.
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Symbol.)
Top
Examples

WPF

Example Name: ChangeFeatureLayerRenderer

Change the appearance of a feature layer with a renderer.

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.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using System;
using System.Windows;
using System.Drawing;

namespace ArcGISRuntime.WPF.Samples.ChangeFeatureLayerRenderer
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Change feature layer renderer",
        category: "Layers",
        description: "Change the appearance of a feature layer with a renderer.",
        instructions: "Use the buttons to change the renderer on the feature layer. The original renderer displays orange circles, the diameters of which are proportional to carbon storage of each tree. When the blue renderer in this sample is applied, it displays the location of the trees simply as blue points.",
        tags: new[] { "feature layer", "renderer", "visualization" })]
    public partial class ChangeFeatureLayerRenderer
    {
        // Create and hold reference to the feature layer
        private FeatureLayer _featureLayer;

        public ChangeFeatureLayerRenderer()
        {
            InitializeComponent();

            // Setup the control references and execute initialization 
            Initialize();
        }

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

            // Create and set initial map area
            Envelope initialLocation = new Envelope(
                -1.30758164047166E7, 4014771.46954516, -1.30730056797177E7, 4016869.78617381,
                SpatialReferences.WebMercator);

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

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

            // Create uri to the used feature service
            Uri serviceUri = new Uri(
               "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0");

            // Initialize feature table using a url to feature server url
            ServiceFeatureTable featureTable = new ServiceFeatureTable(serviceUri);

            // Initialize a new feature layer based on the feature table
            _featureLayer = new FeatureLayer(featureTable);
            myMap.OperationalLayers.Add(_featureLayer);
        }

        private void OnOverrideButtonClicked(object sender, RoutedEventArgs e)
        {
            // Create a symbol to be used in the renderer
            SimpleLineSymbol symbol = new SimpleLineSymbol()
            {
                Color = Color.Blue,
                Width = 2,
                Style = SimpleLineSymbolStyle.Solid
            };

            // Create a new renderer using the symbol just created
            SimpleRenderer renderer = new SimpleRenderer(symbol);

            // Assign the new renderer to the feature layer
            _featureLayer.Renderer = renderer;
        }

        private void OnResetButtonClicked(object sender, RoutedEventArgs e)
        {
            // Reset the renderer to default
            _featureLayer.ResetRenderer();
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.ChangeFeatureLayerRenderer.ChangeFeatureLayerRenderer"
             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"/>
        <Border Style="{StaticResource BorderStyle}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Button Content="Reset" 
                        HorizontalAlignment="Stretch"
                        Margin="0,0,5,0" Grid.Column="0"
                        Click="OnResetButtonClicked" />
                <Button Content="Override" 
                        HorizontalAlignment="Stretch"
                        Margin="5,0,0,0" Grid.Column="1"
                        Click="OnOverrideButtonClicked"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ClosestFacilityFind a route to the closest facility from a location.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FindRouteDisplay directions for a route between two points.
FindServiceAreaFind the service area within a network from a given point.
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.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
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.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
SymbolizeShapefileDisplay a shapefile with custom symbology.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.