Click or drag to resize

ArcGISFeatureTable Class

Represents a table from a database.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Data
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public class ArcGISFeatureTable : FeatureTable

The ArcGISFeatureTable type exposes the following members.

Properties
  NameDescription
Public propertyDefaultSubtypeCode
Gets the table's default subtype code.
Public propertyDisplayName
Gets or sets the table's display name.
(Inherited from FeatureTable.)
Public propertyEditableAttributeFields
Gets the editable fields of this feature table.
Public propertyCode exampleExtent
Gets the geographic extent of features within the table.
(Inherited from FeatureTable.)
Public propertyFeatureLayer
Gets the FeatureLayer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyFeatureSubtypes
Gets a list of FeatureSubtype of this feature table.
Public propertyFeatureTemplates
Gets a list of FeatureTemplate of this feature table.
Public propertyFeatureTypes
Gets a list of FeatureType of this feature table.
Public propertyCode exampleFields
Gets the fields of the feature table.
(Inherited from FeatureTable.)
Public propertyCode exampleGeometryType
Gets the GeometryType of features in this table.
(Inherited from FeatureTable.)
Public propertyGlobalIdField
Gets the name of the global ID field.
Public propertyHasAttachments
Gets a value indicating whether table supports attachments.
Public propertyHasGeometry
Gets a value indicating whether this table has geometry data.
(Inherited from FeatureTable.)
Public propertyHasM
Gets a value indicating whether the shapefile geometries have M values.
(Inherited from FeatureTable.)
Public propertyHasZ
Gets a value indicating whether the shapefile geometries have Z values.
(Inherited from FeatureTable.)
Public propertyIsEditable
Gets a value indicating whether this table is editable.
(Inherited from FeatureTable.)
Public propertyIsPopupEnabled
Gets or sets a value indicating whether the PopupDefinition defined is enabled.
(Inherited from FeatureTable.)
Public propertyLayer
Gets the layer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyCode exampleLayerInfo
Gets the ArcGISFeatureLayerInfo of this feature table.
Public propertyLoadError
Gets the exception associated with a failed load. This property remains null if load is successful.
(Inherited from FeatureTable.)
Public propertyCode exampleLoadStatus
Gets the current load status.
(Inherited from FeatureTable.)
Public propertyNumberOfFeatures
Gets the number of features in this table.
(Inherited from FeatureTable.)
Public propertyObjectIdField
Gets the name of the object ID field.
Public propertyPopupDefinition
Gets or sets the pop-up definition for the table.
(Inherited from FeatureTable.)
Public propertyCode exampleServiceLayerId
Returns the layer ID in the feature service that this table was created from.
Public propertySpatialReference
Gets the SpatialReference of this table.
(Inherited from FeatureTable.)
Public propertySubtypeField
Gets the table's subtype field.
Public propertyCode exampleTableName
Gets the name of the table.
(Inherited from FeatureTable.)
Public propertyTypeIdField
Gets the name of the type ID field.
Public propertyUseAdvancedSymbology
Gets or sets a value indicating whether advanced symbology is used.
Top
Methods
  NameDescription
Public methodCode exampleAddFeatureAsync
Asynchronously adds new Feature to the table.
(Inherited from FeatureTable.)
Public methodAddFeaturesAsync
Asynchronously adds the set of Features to the table.
(Inherited from FeatureTable.)
Public methodCanAdd
Determines if a feature can be added to the table.
(Inherited from FeatureTable.)
Public methodCancelLoad
Cancel the previous load operation,
(Inherited from FeatureTable.)
Public methodCanDelete
Determines if the specified Feature can be deleted from the table.
(Inherited from FeatureTable.)
Public methodCanEditGeometry
Determines if the table allows for the geometry field to be modified.
(Inherited from FeatureTable.)
Public methodCanUpdate
Determines if the specified Feature can be updated on the table.
(Inherited from FeatureTable.)
Public methodCode exampleCreateFeature
Creates a new feature.
(Inherited from FeatureTable.)
Public methodCreateFeature(FeatureSubtype)
Creates and returns a new ArcGISFeature based on the specified FeatureSubtype.
Public methodCreateFeature(FeatureTemplate)
Creates and returns a new ArcGISFeature based on the specified FeatureTemplate.
Public methodCreateFeature(FeatureType)
Creates and returns a new ArcGISFeature based on the specified FeatureType.
Public methodCreateFeature(IEnumerableKeyValuePairString, Object, Geometry)
Creates a new feature with specified attributes and geometry.
(Inherited from FeatureTable.)
Public methodCreateFeature(FeatureSubtype, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureSubtype and Geometry.
Public methodCreateFeature(FeatureTemplate, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureTemplate and Geometry.
Public methodCreateFeature(FeatureType, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureType and Geometry.
Public methodCode exampleDeleteFeatureAsync
Asynchronously deletes new Feature from the table.
(Inherited from FeatureTable.)
Public methodDeleteFeaturesAsync
Asynchronously deletes the set of Features from the table.
(Inherited from FeatureTable.)
Public methodGetAddedFeaturesAsync
Retrieves the features added since the last sync.
Public methodGetAddedFeaturesCountAsync
Retrieves the number of features added since the last sync.
Public methodGetDeletedFeaturesAsync
Retrieves the features deleted since the last sync.
Public methodGetDeletedFeaturesCountAsync
Retrieves the number of features deleted since the last sync.
Public methodGetFeatureTemplate
Retrieves the FeatureTemplate associated with the specified feature template name.
Public methodGetFeatureType
Retrieves the FeatureType associated with the specified feature type name.
Public methodGetField
Gets the associated Field with specified field name.
(Inherited from FeatureTable.)
Public methodGetRelatedTables
Returns a list of all related tables that have been added to the map.
Public methodGetRelatedTables(RelationshipInfo)
Returns list of tables related by the given relationship info.
Public methodGetUpdatedFeaturesAsync
Retrieves the features updated since the last sync. This set of features exists on server but were updated locally and have not yet been submitted to server.
Public methodGetUpdatedFeaturesCountAsync
Retrieves the number of features updated since the last sync.
Public methodCode exampleLoadAsync
Asynchronously initiates loading of this table.
(Inherited from FeatureTable.)
Public methodCode exampleQueryExtentAsync
Asynchronously queries the extent of all features that satisfy the provided parameters.
(Inherited from FeatureTable.)
Public methodCode exampleQueryFeatureCountAsync
Asynchronously queries the count of all features that satisfy the provided parameters.
(Inherited from FeatureTable.)
Public methodCode exampleQueryFeaturesAsync(QueryParameters)
Asynchronously performs query against the table.
(Inherited from FeatureTable.)
Public methodQueryFeaturesAsync(QueryParameters, CancellationToken)
Asynchronously performs query against the table.
(Inherited from FeatureTable.)
Public methodQueryRelatedFeatureCountAsync(ArcGISFeature)
Asynchronously queries for the number of related features to the supplied feature.
Public methodQueryRelatedFeatureCountAsync(ArcGISFeature, RelatedQueryParameters)
Asynchronously queries for the number of related features to the supplied feature based on the parameters.
Public methodCode exampleQueryRelatedFeaturesAsync(ArcGISFeature)
Asynchronously queries for related features of a given feature in all relationships.
Public methodCode exampleQueryRelatedFeaturesAsync(ArcGISFeature, RelatedQueryParameters)
Asynchronously queries for related features of a given feature in a specific relationship.
Public methodCode exampleQueryStatisticsAsync
Calculates values for the requested statistics.
(Inherited from FeatureTable.)
Public methodRetryLoadAsync
Asynchronously retries loading of this table table.
(Inherited from FeatureTable.)
Public methodCode exampleUpdateFeatureAsync
Asynchronously updates new Feature on the table.
(Inherited from FeatureTable.)
Public methodUpdateFeaturesAsync
Asynchronously updates the set of Features on the table.
(Inherited from FeatureTable.)
Public methodValidateRelationshipConstraintsAsync
Asynchronously validates constraints for a given feature participating in a relationship. In a composite relationship, adding an orphan feature to the destination table without relating it to an origin feature. Cardinality Violations: In 1:1 relationships, if an origin feature is already related to a destination feature, relating another feature to either of them. In 1:n relationships, relating a destination feature to more than one origin feature. To recover from an orphaned destination feature violation, simply relate it to a valid origin feature. You can usually recover from a cardinality violation by unrelating the appropriate features. Also, see UnrelateFeature(ArcGISFeature) Note that edit operations do not error when there are constraint violations. This allows you to recover from violations in a back office operation after applying edits or syncing, if you choose to do so. See ArcGIS Desktop Validate Features process here. Note: This method makes network calls to query for the related features if they are not present locally.
Top
Events
  NameDescription
Public eventCode exampleLoaded
Occurs when the table is loaded.
(Inherited from FeatureTable.)
Public eventCode exampleLoadStatusChanged
Occurs when the table LoadStatus is changed.
(Inherited from FeatureTable.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from FeatureTable.)
Top
Examples

Android

Example Name: FindServiceAreasForMultipleFacilities

Find the service areas of several facilities from a feature service.

Code example screen shot.

C#
// Copyright 2019 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 Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.Tasks.NetworkAnalysis;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ArcGISRuntimeXamarin.Samples.FindServiceAreasForMultipleFacilities
{
    [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Find service areas for multiple facilities",
        "Network Analysis",
        "Find the service areas of several facilities from a feature service.",
        "")]
    [ArcGISRuntime.Samples.Shared.Attributes.OfflineData()]
    public class FindServiceAreasForMultipleFacilities : Activity
    {
        // Hold references to the UI controls.
        private MapView _myMapView;
        private ProgressBar _activityIndicator;
        private Button _findServiceAreasButton;

        // URLs to resources used by the sample.
        private const string NetworkAnalysisUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/ServiceArea";
        private const string FacilitiesFeatureUrl = "https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/San_Diego_Facilities/FeatureServer/0";
        private const string IconUrl = "https://static.arcgis.com/images/Symbols/SafetyHealth/Hospital.png";

        // The table that contains the facilities.
        private ServiceFeatureTable _facilitiesTable;

        // The task for performing the service area analysis.
        private ServiceAreaTask _serviceAreaTask;

        // The graphics overlay for displaying the resulting polygons.
        private GraphicsOverlay _resultOverlay;

        // Symbology for the resulting service areas.
        private List<SimpleFillSymbol> _fillSymbols;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "Find service areas for multiple facilities";

            CreateLayout();
            Initialize();
        }

        private async void Initialize()
        {
            try
            {
                // Create the map and show it in the view.
                Map newMap = new Map(Basemap.CreateLightGrayCanvas());
                _myMapView.Map = newMap;

                // Create the table containing the facilities.
                _facilitiesTable = new ServiceFeatureTable(new Uri(FacilitiesFeatureUrl));

                // Create the layer for rendering the facilities table.
                FeatureLayer facilitiesLayer = new FeatureLayer(_facilitiesTable);

                // Create a simple renderer that will display an image for each facility.
                facilitiesLayer.Renderer = new SimpleRenderer(new PictureMarkerSymbol(new Uri(IconUrl)));

                // Add the layer to the map.
                newMap.OperationalLayers.Add(facilitiesLayer);

                // Create the graphics overlay for displaying the result polygons.
                _resultOverlay = new GraphicsOverlay();

                // Add the result overlay to the view.
                _myMapView.GraphicsOverlays.Add(_resultOverlay);

                // Create a list of fill symbols for rendering the results.
                _fillSymbols = new List<SimpleFillSymbol>();
                _fillSymbols.Add(new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.FromArgb(0x66, 0xFF, 0xA5, 0x00), null));
                _fillSymbols.Add(new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.FromArgb(0x66, 0xFF, 0x00, 0x00), null));

                // Wait for the table to load and zoom to its extent.
                await _facilitiesTable.LoadAsync();
                await _myMapView.SetViewpointGeometryAsync(_facilitiesTable.Extent, 50);

                // Enable the button now that the sample is ready.
                _findServiceAreasButton.Enabled = true;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                ShowMessage("Error", "Error starting the sample.");
            }
        }

        private async Task FindServiceAreas()
        {
            try
            {
                // Create the service area task.
                _serviceAreaTask = await ServiceAreaTask.CreateAsync(new Uri(NetworkAnalysisUrl));

                // Create the default parameters for the service.
                ServiceAreaParameters serviceAreaParameters = await _serviceAreaTask.CreateDefaultParametersAsync();

                // Configure the service area parameters.
                serviceAreaParameters.PolygonDetail = ServiceAreaPolygonDetail.High;
                serviceAreaParameters.ReturnPolygons = true;
                serviceAreaParameters.DefaultImpedanceCutoffs.Clear();
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(0);
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(3);
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(5);

                // A query that finds all of the relevant facilities from the facilities feature service.
                QueryParameters facilityQueryParameters = new QueryParameters();
                facilityQueryParameters.WhereClause = "1=1";

                // Provide the feature service and the query as parameters to the service area task.
                serviceAreaParameters.SetFacilities(_facilitiesTable, facilityQueryParameters);

                // Perform the service area analysis.
                ServiceAreaResult result = await _serviceAreaTask.SolveServiceAreaAsync(serviceAreaParameters);

                // Count the features in the facilities layer. 
                long facilityCount = await _facilitiesTable.QueryFeatureCountAsync(facilityQueryParameters);

                // Get the service area for each facility.
                for (int facilityIndex = 0; facilityIndex < facilityCount; facilityIndex++)
                {
                    // Get each area polygon from the result for that facility.
                    List<ServiceAreaPolygon> areaPolygons = result.GetResultPolygons(facilityIndex).ToList();

                    // Add each service area polygon to the graphics overlay.
                    for (int polygonIndex = 0; polygonIndex < areaPolygons.Count; polygonIndex++)
                    {
                        // Get the polygon from the result.
                        Polygon resultingPolygon = areaPolygons[polygonIndex].Geometry;

                        // Choose a symbol for the polygon.
                        SimpleFillSymbol selectedSymbol = _fillSymbols[polygonIndex % _fillSymbols.Count];

                        // Create and add the graphic.
                        _resultOverlay.Graphics.Add(new Graphic(resultingPolygon, selectedSymbol));
                    }
                }

                // Zoom to the extent of the results.
                await _myMapView.SetViewpointGeometryAsync(_resultOverlay.Extent, 50);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                ShowMessage("Error", "Couldn't complete service area analysis.");
            }
        }

        private async void FindServiceArea_Clicked(object sender, EventArgs e)
        {
            try
            {
                // Clear the old results.
                _resultOverlay?.Graphics.Clear();

                // Update the UI.
                _findServiceAreasButton.Enabled = false;
                _activityIndicator.Visibility = ViewStates.Visible;

                // Do the service area work.
                await FindServiceAreas();

                // Update the UI.
                _activityIndicator.Visibility = ViewStates.Gone;
                _findServiceAreasButton.Enabled = true;
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.WriteLine(exception);
                ShowMessage("Error", "Couldn't complete the service area analysis.");
            }
        }

        private void ShowMessage(string title, string detail) => new AlertDialog.Builder(this).SetTitle(title).SetMessage(detail).Show();

        private void CreateLayout()
        {
            // Create a new vertical layout for the app.
            var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};

            // Create the activity spinner.
            _activityIndicator = new ProgressBar(this);
            _activityIndicator.Indeterminate = true;
            _activityIndicator.Visibility = ViewStates.Gone;

            // Create the service areas button.
            _findServiceAreasButton = new Button(this);
            _findServiceAreasButton.Text = "Find service areas";
            _findServiceAreasButton.Enabled = false;
            _findServiceAreasButton.Click += FindServiceArea_Clicked;

            // Add the button and the spinner.
            layout.AddView(_findServiceAreasButton);
            layout.AddView(_activityIndicator);

            // Add the map view to the layout.
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Show the layout in the app.
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: FindServiceAreasForMultipleFacilities

Find the service areas of several facilities from a feature service.

Code example screen shot.

C#
// Copyright 2019 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 System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.Tasks.NetworkAnalysis;
using Xamarin.Forms;

namespace ArcGISRuntimeXamarin.Samples.FindServiceAreasForMultipleFacilities
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Find service areas for multiple facilities",
        "Network Analysis",
        "Find the service areas of several facilities from a feature service.",
        "")]
    [ArcGISRuntime.Samples.Shared.Attributes.OfflineData()]
    public partial class FindServiceAreasForMultipleFacilities : ContentPage
    {
        // URLs to resources used by the sample.
        private const string NetworkAnalysisUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/ServiceArea";
        private const string FacilitiesFeatureUrl = "https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/San_Diego_Facilities/FeatureServer/0";
        private const string IconUrl = "https://static.arcgis.com/images/Symbols/SafetyHealth/Hospital.png";

        // The table that contains the facilities.
        private ServiceFeatureTable _facilitiesTable;

        // The task for performing the service area analysis.
        private ServiceAreaTask _serviceAreaTask;

        // The graphics overlay for displaying the resulting polygons.
        private GraphicsOverlay _resultOverlay;

        // Symbology for the resulting service areas.
        private List<SimpleFillSymbol> _fillSymbols;

        public FindServiceAreasForMultipleFacilities()
        {
            InitializeComponent();
            Initialize();
        }

        private async void Initialize()
        {
            try
            {
                // Create the map and show it in the view.
                Map newMap = new Map(Basemap.CreateLightGrayCanvas());
                MyMapView.Map = newMap;

                // Create the table containing the facilities.
                _facilitiesTable = new ServiceFeatureTable(new Uri(FacilitiesFeatureUrl));

                // Create the layer for rendering the facilities table.
                FeatureLayer facilitiesLayer = new FeatureLayer(_facilitiesTable);

                // Create a simple renderer that will display an image for each facility.
                facilitiesLayer.Renderer = new SimpleRenderer(new PictureMarkerSymbol(new Uri(IconUrl)));

                // Add the layer to the map.
                newMap.OperationalLayers.Add(facilitiesLayer);

                // Create the graphics overlay for displaying the result polygons.
                _resultOverlay = new GraphicsOverlay();

                // Add the result overlay to the view.
                MyMapView.GraphicsOverlays.Add(_resultOverlay);

                // Create a list of fill symbols for rendering the results.
                _fillSymbols = new List<SimpleFillSymbol>();
                _fillSymbols.Add(new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.FromArgb(0x66, 0xFF, 0xA5, 0x00), null));
                _fillSymbols.Add(new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.FromArgb(0x66, 0xFF, 0x00, 0x00), null));

                // Wait for the table to load and zoom to its extent.
                await _facilitiesTable.LoadAsync();
                await MyMapView.SetViewpointGeometryAsync(_facilitiesTable.Extent, 50);

                // Enable the button now that the sample is ready.
                ServiceAreaButton.IsEnabled = true;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                ShowMessage("Error", "Error starting the sample.");
            }
        }

        private async Task FindServiceAreas()
        {
            try
            {
                // Create the service area task.
                _serviceAreaTask = await ServiceAreaTask.CreateAsync(new Uri(NetworkAnalysisUrl));

                // Create the default parameters for the service.
                ServiceAreaParameters serviceAreaParameters = await _serviceAreaTask.CreateDefaultParametersAsync();

                // Configure the service area parameters.
                serviceAreaParameters.PolygonDetail = ServiceAreaPolygonDetail.High;
                serviceAreaParameters.ReturnPolygons = true;
                serviceAreaParameters.DefaultImpedanceCutoffs.Clear();
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(0);
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(3);
                serviceAreaParameters.DefaultImpedanceCutoffs.Add(5);

                // A query that finds all of the relevant facilities from the facilities feature service.
                QueryParameters facilityQueryParameters = new QueryParameters();
                facilityQueryParameters.WhereClause = "1=1";

                // Provide the feature service and the query as parameters to the service area task.
                serviceAreaParameters.SetFacilities(_facilitiesTable, facilityQueryParameters);

                // Perform the service area analysis.
                ServiceAreaResult result = await _serviceAreaTask.SolveServiceAreaAsync(serviceAreaParameters);

                // Count the features in the facilities layer. 
                long facilityCount = await _facilitiesTable.QueryFeatureCountAsync(facilityQueryParameters);

                // Get the service area for each facility.
                for (int facilityIndex = 0; facilityIndex < facilityCount; facilityIndex++)
                {
                    // Get each area polygon from the result for that facility.
                    List<ServiceAreaPolygon> areaPolygons = result.GetResultPolygons(facilityIndex).ToList();

                    // Add each service area polygon to the graphics overlay.
                    for (int polygonIndex = 0; polygonIndex < areaPolygons.Count; polygonIndex++)
                    {
                        // Get the polygon from the result.
                        Polygon resultingPolygon = areaPolygons[polygonIndex].Geometry;

                        // Choose a symbol for the polygon.
                        SimpleFillSymbol selectedSymbol = _fillSymbols[polygonIndex % _fillSymbols.Count];

                        // Create and add the graphic.
                        _resultOverlay.Graphics.Add(new Graphic(resultingPolygon, selectedSymbol));
                    }
                }

                // Zoom to the extent of the results.
                await MyMapView.SetViewpointGeometryAsync(_resultOverlay.Extent, 50);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                ShowMessage("Error", "Couldn't complete service area analysis.");
            }
        }

        private async void FindServiceArea_Clicked(object sender, EventArgs e)
        {
            try
            {
                // Clear the old results.
                _resultOverlay?.Graphics.Clear();

                // Update the UI.
                ServiceAreaButton.IsEnabled = false;
                ProgressView.IsVisible = true;

                // Do the service area work.
                await FindServiceAreas();

                // Update the UI.
                ProgressView.IsVisible = false;
                ServiceAreaButton.IsEnabled = true;
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.WriteLine(exception);
                ShowMessage("Error", "Couldn't complete the service area analysis.");
            }
        }

        private async void ShowMessage(string title, string detail)
        {
            await Application.Current.MainPage.DisplayAlert(title, detail, "OK");
        }
    }
}
XAML
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             x:Class="ArcGISRuntimeXamarin.Samples.FindServiceAreasForMultipleFacilities.FindServiceAreasForMultipleFacilities">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button x:Name="ServiceAreaButton"
                Grid.Row="0"
                IsEnabled="False"
                Text="Find service area"
                Clicked="FindServiceArea_Clicked" />
        <ActivityIndicator x:Name="ProgressView"
                           Grid.Row="1"
                           IsRunning="True"
                           IsVisible="False" />
        <esriUI:MapView x:Name="MyMapView"
                        Grid.Row="2" />
    </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
ListRelatedFeaturesList features related to the selected feature.