Click or drag to resize

FillSymbolColor Property

Gets or sets the color

Namespace:  Esri.ArcGISRuntime.Symbology
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
public Color Color { get; set; }

Property Value

Type: Color


Example Name: AnalyzeViewshed

Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.

Code example screen shot.

// 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:
// 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 Esri.ArcGISRuntime.Tasks;
using Esri.ArcGISRuntime.Tasks.Geoprocessing;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows;

namespace ArcGISRuntime.WPF.Samples.AnalyzeViewshed
        name: "Analyze viewshed (geoprocessing)",
        category: "Geoprocessing",
        description: "Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.",
        instructions: "Click the map to see all areas visible from that point within a 15km radius. Clicking on an elevated area will highlight a larger part of the surrounding landscape. It may take a few seconds for the task to run and send back the results.",
        tags: new[] { "geoprocessing", "heat map", "heatmap", "viewshed" })]
    public partial class AnalyzeViewshed
        // Url for the geoprocessing service
        private const string _viewshedUrl =

        // Used to store state of the geoprocessing task
        private bool _isExecutingGeoprocessing;

        // The graphics overlay to show where the user clicked in the map
        private GraphicsOverlay _inputOverlay;

        // The graphics overlay to display the result of the viewshed analysis
        private GraphicsOverlay _resultOverlay;

        public AnalyzeViewshed()

            // Create the UI, setup the control references and execute initialization

        private void Initialize()
            // Create a map with topographic basemap and an initial location
            Map myMap = new Map(BasemapType.Topographic, 45.3790902612337, 6.84905317262762, 13);

            // Hook into the tapped event
            MyMapView.GeoViewTapped += OnMapViewTapped;

            // Create empty overlays for the user clicked location and the results of the viewshed analysis

            // Assign the map to the MapView
            MyMapView.Map = myMap;

        private async void OnMapViewTapped(object sender, GeoViewInputEventArgs e)
            // The geoprocessing task is still executing, don't do anything else (i.e. respond to
            // more user taps) until the processing is complete.
            if (_isExecutingGeoprocessing)

            // Indicate that the geoprocessing is running

            // Clear previous user click location and the viewshed geoprocessing task results

            // Get the tapped point
            MapPoint geometry = e.Location;

            // Create a marker graphic where the user clicked on the map and add it to the existing graphics overlay
            Graphic myInputGraphic = new Graphic(geometry);

            // Normalize the geometry if wrap-around is enabled
            //    This is necessary because of how wrapped-around map coordinates are handled by Runtime
            //    Without this step, the task may fail because wrapped-around coordinates are out of bounds.
            if (MyMapView.IsWrapAroundEnabled) { geometry = (MapPoint)GeometryEngine.NormalizeCentralMeridian(geometry); }

                // Execute the geoprocessing task using the user click location
                await CalculateViewshed(geometry);
            catch (Exception ex)
                MessageBox.Show(ex.ToString(), "Error");

        private async Task CalculateViewshed(MapPoint location)
            // This function will define a new geoprocessing task that performs a custom viewshed analysis based upon a
            // user click on the map and then display the results back as a polygon fill graphics overlay. If there
            // is a problem with the execution of the geoprocessing task an error message will be displayed

            // Create new geoprocessing task using the url defined in the member variables section
            GeoprocessingTask myViewshedTask = await GeoprocessingTask.CreateAsync(new Uri(_viewshedUrl));

            // Create a new feature collection table based upon point geometries using the current map view spatial reference
            FeatureCollectionTable myInputFeatures = new FeatureCollectionTable(new List<Field>(), GeometryType.Point, MyMapView.SpatialReference);

            // Create a new feature from the feature collection table. It will not have a coordinate location (x,y) yet
            Feature myInputFeature = myInputFeatures.CreateFeature();

            // Assign a physical location to the new point feature based upon where the user clicked in the map view
            myInputFeature.Geometry = location;

            // Add the new feature with (x,y) location to the feature collection table
            await myInputFeatures.AddFeatureAsync(myInputFeature);

            // Create the parameters that are passed to the used geoprocessing task
            GeoprocessingParameters myViewshedParameters =
                new GeoprocessingParameters(GeoprocessingExecutionType.SynchronousExecute)
                    // Request the output features to use the same SpatialReference as the map view
                    OutputSpatialReference = MyMapView.SpatialReference

            // Add an input location to the geoprocessing parameters
            myViewshedParameters.Inputs.Add("Input_Observation_Point", new GeoprocessingFeatures(myInputFeatures));

            // Create the job that handles the communication between the application and the geoprocessing task
            GeoprocessingJob myViewshedJob = myViewshedTask.CreateJob(myViewshedParameters);

                // Execute analysis and wait for the results
                GeoprocessingResult myAnalysisResult = await myViewshedJob.GetResultAsync();

                // Get the results from the outputs
                GeoprocessingFeatures myViewshedResultFeatures = (GeoprocessingFeatures)myAnalysisResult.Outputs["Viewshed_Result"];

                // Add all the results as a graphics to the map
                IFeatureSet myViewshedAreas = myViewshedResultFeatures.Features;
                foreach (Feature myFeature in myViewshedAreas)
                    _resultOverlay.Graphics.Add(new Graphic(myFeature.Geometry));
            catch (Exception ex)
                // Display an error message if there is a problem
                if (myViewshedJob.Status == JobStatus.Failed && myViewshedJob.Error != null)
                    MessageBox.Show("Executing geoprocessing failed. " + myViewshedJob.Error.Message, "Geoprocessing error");
                    MessageBox.Show("An error occurred. " + ex.ToString(), "Sample error");
                // Indicate that the geoprocessing is not running

        private void CreateOverlays()
            // This function will create the overlays that show the user clicked location and the results of the
            // viewshed analysis. Note: the overlays will not be populated with any graphics at this point

            // Create renderer for input graphic. Set the size and color properties for the simple renderer
            SimpleRenderer myInputRenderer = new SimpleRenderer()
                Symbol = new SimpleMarkerSymbol()
                    Size = 15,
                    Color = Color.Red

            // Create overlay to where input graphic is shown
            _inputOverlay = new GraphicsOverlay()
                Renderer = myInputRenderer

            // Create fill renderer for output of the viewshed analysis. Set the color property of the simple renderer
            SimpleRenderer myResultRenderer = new SimpleRenderer()
                Symbol = new SimpleFillSymbol()
                    Color = Color.FromArgb(100, 226, 119, 40)

            // Create overlay to where viewshed analysis graphic is shown
            _resultOverlay = new GraphicsOverlay()
                Renderer = myResultRenderer

            // Add the created overlays to the MapView

        private void SetBusy(bool isBusy = true)
            // This function toggles the visibility of the 'BusyOverlay' Grid control defined in xaml,
            // sets the 'progress' control feedback status and updates the _isExecutingGeoprocessing
            // boolean to denote if the viewshed analysis is executing as a result of the user click
            // on the map

            if (isBusy)
                // Change UI to indicate that the geoprocessing is running
                _isExecutingGeoprocessing = true;
                BusyOverlay.Visibility = Visibility.Visible;
                Progress.IsIndeterminate = true;
                // Change UI to indicate that the geoprocessing is not running
                _isExecutingGeoprocessing = false;
                BusyOverlay.Visibility = Visibility.Collapsed;
                Progress.IsIndeterminate = false;
<UserControl x:Class="ArcGISRuntime.WPF.Samples.AnalyzeViewshed.AnalyzeViewshed"
             d:DesignHeight="300" d:DesignWidth="300">
        <esri:MapView x:Name="MyMapView" />
        <Border Style="{StaticResource BorderStyle}">
            <Grid Margin="20">
                <TextBlock Text="Click map to execute viewshed analysis." 
                           HorizontalAlignment="Center" VerticalAlignment="Center" />

                <Grid x:Name="BusyOverlay" Margin="-20" Visibility="Collapsed" Background="#8C000000" Grid.RowSpan="4">
                    <Border HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10" Background="#FFC6C4C4">
                            <ProgressBar IsIndeterminate="True" x:Name="Progress" Height="20" />
                            <TextBlock Text="Executing analysis..." HorizontalAlignment="Center" Margin="5" Height="20" />
See Also
Additional Examples
Hyperlink to ExampleDescription
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.