Click or drag to resize

BasemapType Enumeration

The list of predefined basemap types for easy creation of a basemap.

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0.0
Syntax
C#
public enum BasemapType
Members
  Member nameValueDescription
Imagery0Imagery.
ImageryWithLabels1Imagery with labels.
Streets2Streets.
Topographic3Topographic.
TerrainWithLabels4Terrain with labels.
LightGrayCanvas5Light gray canvas.
NationalGeographic6National geographic.
Oceans7Oceans.
OpenStreetMap8 Open Street Map
ImageryWithLabelsVector9Imagery with labels hybrid basemap.
StreetsVector10Streets vector basemap.
TopographicVector11Topographic hybrid basemap.
TerrainWithLabelsVector12Terrain with labels hybrid basemap.
LightGrayCanvasVector13Light gray canvas vector basemap.
NavigationVector14Navigation vector basemap.
StreetsNightVector15Streets night vector basemap.
StreetsWithReliefVector16Streets with relief hybrid basemap.
DarkGrayCanvasVector17Dark gray canvas vector basemap.
Examples

Android

Example Name: DisplayDrawingStatus

Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.

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 Android.App;
using Android.OS;
using Android.Widget;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using Android.Views;

namespace ArcGISRuntime.Samples.DisplayDrawingStatus
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Display draw status",
        category: "MapView",
        description: "Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.",
        instructions: "Pan and zoom around the map. Observe how the status changes from a loading animation to solid, indicating that drawing has completed.",
        tags: new[] { "draw", "loading", "map", "render" })]
    public class DisplayDrawingStatus : Activity
    {
        // Hold a reference to the map view
        private MapView _myMapView;

        // Waiting popup
        private AlertDialog _progressDialog;

        // Status label
        private TextView _statusLabel;

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

            Title = "Display drawing status";

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

        private void Initialize()
        {
            // Hook up the DrawStatusChanged event
            _myMapView.DrawStatusChanged += OnDrawStatusChanged;

            // Create new Map with basemap
            Map myMap = new Map(BasemapType.Topographic, 34.056, -117.196, 4);

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

            // Initialize a new feature layer
            ServiceFeatureTable myFeatureTable = new ServiceFeatureTable(serviceUri);
            FeatureLayer myFeatureLayer = new FeatureLayer(myFeatureTable);

            // Add the feature layer to the Map
            myMap.OperationalLayers.Add(myFeatureLayer);

            // Provide used Map to the MapView
            _myMapView.Map = myMap;
        }

        private void OnDrawStatusChanged(object sender, DrawStatusChangedEventArgs e)
        {
            // Make sure that the UI changes are done in the UI thread
            RunOnUiThread(() =>
            {
                // Show the activity indicator if the map is drawing
                if (e.Status == DrawStatus.InProgress)
                {
                    _progressDialog.Show();
                    _statusLabel.Text = "Drawing status: In progress";
                }
                else
                {
                    _progressDialog.Hide();
                    _statusLabel.Text = "Drawing status: Complete";
                }
            });
        }

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

            _statusLabel = new TextView(this);
            _statusLabel.Text = "Drawing status: unknown";

            // Add the views to the layout
            layout.AddView(_statusLabel);
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Create an activity indicator
            // Show the waiting dialog.
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.SetView(new ProgressBar(this)
            {
                Indeterminate = true
            });
            builder.SetMessage("Drawing in progress.");
            _progressDialog = builder.Create();

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

Xamarin Forms Android

Example Name: FeatureLayerGeoPackage

Display features from a local GeoPackage.

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 System;
using ArcGISRuntime.Samples.Managers;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Mapping;
using System.Linq;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.FeatureLayerGeoPackage
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Feature layer (GeoPackage)",
        category: "Data",
        description: "Display features from a local GeoPackage.",
        instructions: "Pan and zoom around the map. View the data loaded from the geopackage.",
        tags: new[] { "OGC", "feature table", "geopackage", "gpkg", "package", "standards" })]
    [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("68ec42517cdd439e81b036210483e8e7")]
    public partial class FeatureLayerGeoPackage : ContentPage
    {
        public FeatureLayerGeoPackage()
        {
            InitializeComponent();

            // Read data from the GeoPackage
            Initialize();
        }

        private async void Initialize()
        {
            // Create a new map centered on Aurora Colorado
            MyMapView.Map = new Map(BasemapType.LightGrayCanvas, 39.7294, -104.8319, 9);

            // Get the full path
            string geoPackagePath = GetGeoPackagePath();

            try
            {
                // Open the GeoPackage
                GeoPackage myGeoPackage = await GeoPackage.OpenAsync(geoPackagePath);

                // Read the feature tables and get the first one
                FeatureTable geoPackageTable = myGeoPackage.GeoPackageFeatureTables.FirstOrDefault();

                // Make sure a feature table was found in the package
                if (geoPackageTable == null) { return; }

                // Create a layer to show the feature table
                FeatureLayer newLayer = new FeatureLayer(geoPackageTable);
                await newLayer.LoadAsync();

                // Add the feature table as a layer to the map (with default symbology)
                MyMapView.Map.OperationalLayers.Add(newLayer);
            }
            catch (Exception e)
            {
                await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
            }
        }

        private static string GetGeoPackagePath()
        {
            return DataManager.GetDataFolder("68ec42517cdd439e81b036210483e8e7", "AuroraCO.gpkg");
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8" ?>
<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"
             xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" 
             x:Class="ArcGISRuntime.Samples.FeatureLayerGeoPackage.FeatureLayerGeoPackage">
    <esriUI:MapView x:Name="MyMapView"/>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddGraphicsWithSymbolsUse a symbol style to display a graphic on a graphics overlay.
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
DisplayAnnotationDisplay annotation from a feature service URL.
DisplayDrawingStatusGet the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerGeoPackageDisplay features from a local GeoPackage.
IdentifyRasterCellGet the cell value of a local raster at the tapped location and display the result in a callout.
ReadGeoPackageAdd rasters and feature tables from a GeoPackage to a map.
SetInitialMapLocationDisplay a basemap centered at an initial location and scale.
ShowMagnifierTap and hold on a map to show a magnifier.
SpatialOperationsFind the union, intersection, or difference of two geometries.