Click or drag to resize

Basemap Class

Represents the base map part of a Map. The basemap contains layers which are base or reference layers.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingBasemap

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.5.0.0
Syntax
C#
public class Basemap : ILoadable

The Basemap type exposes the following members.

Constructors
  NameDescription
Public methodBasemap
Initializes a new instance of the Basemap class.
Public methodBasemap(Uri)
Initializes a new instance of the Basemap class with a Uri to a portal item which is a web base map.
Public methodBasemap(Item)
Initializes a new instance of the Basemap class with an ArcGIS Item.
Public methodCode exampleBasemap(Layer)
Initializes a new instance of the Basemap class with the specified layer.
Public methodBasemap(IEnumerableLayer, IEnumerableLayer)
Initializes a new instance of the Basemap class with a set of predefined layers.
Top
Properties
  NameDescription
Public propertyCode exampleBaseLayers
Gets or sets the base layers of the base map.
Public propertyItem
Gets the ArcGIS Item
Public propertyLoadError
Gets the load error for this instance - if any.
Public propertyLoadStatus
Gets the load status of the instance.
Public propertyName
Gets or sets the name of the base map.
Public propertyReferenceLayers
Gets or sets the reference layers displayed on top of the OperationalLayers.
Public propertyUri
Gets the basemap's uri origin.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
Public methodClone
Clones this instance of Basemap and its members.
Public methodStatic memberCode exampleCreateDarkGrayCanvasVector
Creates a dark gray canvas vector basemap.
Public methodStatic memberCode exampleCreateImagery
Creates an imagery basemap.
Public methodStatic memberCode exampleCreateImageryWithLabels
Creates an imagery basemap with labels on top.
Public methodStatic memberCode exampleCreateImageryWithLabelsVector
Creates a hybrid imagery basemap with vector labels on top.
Public methodStatic memberCode exampleCreateLightGrayCanvas
Creates a light gray canvas basemap.
Public methodStatic memberCode exampleCreateLightGrayCanvasVector
Creates a light gray canvas vector basemap.
Public methodStatic memberCode exampleCreateNationalGeographic
Creates a National Geographic basemap.
Public methodStatic memberCode exampleCreateNavigationVector
Creates a vector basemap optimized for navigation.
Public methodStatic memberCode exampleCreateOceans
Creates an oceans basemap.
Public methodStatic memberCode exampleCreateOpenStreetMap
Creates a basemap with an Open Street Map layer.
Public methodStatic memberCode exampleCreateStreets
Creates a streets basemap.
Public methodStatic memberCode exampleCreateStreetsNightVector
Creates a streets vector basemap optimized for night usage.
Public methodStatic memberCode exampleCreateStreetsVector
Creates a streets vector basemap.
Public methodStatic memberCreateStreetsWithReliefVector
Creates a hybrid streets vector basemap with a relief background.
Public methodStatic memberCode exampleCreateTerrainWithLabels
Creates a labeled terrain basemap.
Public methodStatic memberCreateTerrainWithLabelsVector
Creates a labeled terrain vector basemap.
Public methodStatic memberCode exampleCreateTopographic
Creates a topographic basemap.
Public methodStatic memberCreateTopographicVector
Creates a topographic vector basemap.
Public methodStatic memberFromJson
Creates a base map from the json.
Public methodLoadAsync
Initiates loading of a basemap
Public methodStatic memberLoadFromUriAsync
Load a base map from a uri resource
Protected methodOnPropertyChanged
Raises the PropertyChanged event with the provided arguments.
Public methodRetryLoadAsync
Retry loading metadata for the instance in case of a load error.
Public methodToJson
Serializes the base map to json.
Top
Events
  NameDescription
Public eventLoaded
Occurs when this instance is loaded.
Public eventLoadStatusChanged
Occurs when the instance's LoadStatus has changed.
Public eventPropertyChanged
Occurs when a property value changes.
Top
Examples

iOS

Example Name: ChangeBasemap

This sample demonstrates how to dynamically change the basemap displayed in a Map.

Code example screen shot.

C#
// Copyright 2018 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 Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using Foundation;
using UIKit;

namespace ArcGISRuntime.Samples.ChangeBasemap
{
    [Register("ChangeBasemap")]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Change basemap",
        "Map",
        "This sample demonstrates how to dynamically change the basemap displayed in a Map.",
        "")]
    public class ChangeBasemap : UIViewController
    {
        // Hold a reference to the MapView.
        private MapView _myMapView;

        // Dictionary that associates names with basemaps.
        private readonly Dictionary<string, Basemap> _basemapOptions = new Dictionary<string, Basemap>
        {
            {"Streets (Raster)", Basemap.CreateStreets()},
            {"Streets (Vector)", Basemap.CreateStreetsVector()},
            {"Streets - Night (Vector)", Basemap.CreateStreetsNightVector()},
            {"Imagery (Raster)", Basemap.CreateImagery()},
            {"Imagery with Labels (Raster)", Basemap.CreateImageryWithLabels()},
            {"Imagery with Labels (Vector)", Basemap.CreateImageryWithLabelsVector()},
            {"Dark Gray Canvas (Vector)", Basemap.CreateDarkGrayCanvasVector()},
            {"Light Gray Canvas (Raster)", Basemap.CreateLightGrayCanvas()},
            {"Light Gray Canvas (Vector)", Basemap.CreateLightGrayCanvasVector()},
            {"Navigation (Vector)", Basemap.CreateNavigationVector()},
            {"OpenStreetMap (Raster)", Basemap.CreateOpenStreetMap()}
        };

        public ChangeBasemap()
        {
            Title = "Change basemap";
        }

        private void BasemapSelectionButtonClick(object sender, EventArgs e)
        {
            // Create the view controller that will present the list of basemaps.
            UIAlertController basemapSelectionAlert = UIAlertController.Create("Select a basemap", "", UIAlertControllerStyle.ActionSheet);

            // Add an option for each basemap.
            foreach (string item in _basemapOptions.Keys)
            {
                // Selecting a basemap will call the lambda method, which will apply the chosen basemap.
                basemapSelectionAlert.AddAction(UIAlertAction.Create(item, UIAlertActionStyle.Default, action => _myMapView.Map.Basemap = _basemapOptions[item]));
            }

            // Fix to prevent crash on iPad.
            var popoverPresentationController = basemapSelectionAlert.PopoverPresentationController;
            if (popoverPresentationController != null)
            {
                popoverPresentationController.BarButtonItem = (UIBarButtonItem)sender;
            }

            // Show the alert.
            PresentViewController(basemapSelectionAlert, true, null);
        }

        private void Initialize()
        {
            // Create and use a new map.
            _myMapView.Map = new Map(_basemapOptions.Values.First());
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Initialize();
        }

        public override void LoadView()
        {
            // Create the views.
            View = new UIView {BackgroundColor = UIColor.White};

            _myMapView = new MapView();
            _myMapView.TranslatesAutoresizingMaskIntoConstraints = false;

            UIToolbar toolbar = new UIToolbar();
            toolbar.TranslatesAutoresizingMaskIntoConstraints = false;
            toolbar.Items = new[]
            {
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                new UIBarButtonItem("Change basemap", UIBarButtonItemStyle.Plain, BasemapSelectionButtonClick),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace)
            };

            // Add the views.
            View.AddSubviews(_myMapView, toolbar);

            // Lay out the views.
            NSLayoutConstraint.ActivateConstraints(new[]
            {
                _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                _myMapView.BottomAnchor.ConstraintEqualTo(toolbar.TopAnchor),

                toolbar.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor),
                toolbar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                toolbar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor)
            });
        }
    }
}
Examples

Xamarin Forms iOS

Example Name: ChangeTimeExtent

This sample demonstrates how to filter data in layers by applying a time extent to a MapView.

Code example screen shot.

C#
// Copyright 2018 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;
using Esri.ArcGISRuntime.Mapping;
using System;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.ChangeTimeExtent
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Change time extent",
        "MapView",
        "This sample demonstrates how to filter data in layers by applying a time extent to a MapView.",
        "Switch between the available options and observe how the data is filtered.")]
    public partial class ChangeTimeExtent : ContentPage
    {
        // Hold two map service URIs, one for use with an ArcGISMapImageLayer, the other for use with a FeatureLayer.
        private readonly Uri _mapServerUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer");
        private readonly Uri _featureLayerUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0");

        public ChangeTimeExtent()
        {
            InitializeComponent();

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

        private void Initialize()
        {
            // Create new Map with basemap and initial location.
            Map map = new Map(Basemap.CreateTopographic());

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

            // Load the layers from the corresponding URIs.
            ArcGISMapImageLayer imageryLayer = new ArcGISMapImageLayer(_mapServerUri);
            FeatureLayer pointLayer = new FeatureLayer(_featureLayerUri);

            // Add the layers to the map.
            MyMapView.Map.OperationalLayers.Add(imageryLayer);
            MyMapView.Map.OperationalLayers.Add(pointLayer);
        }

        private void twoThousand_Clicked(object sender, EventArgs e)
        {
            // Hard-coded start value: January 1st, 2000.
            DateTime start = new DateTime(2000, 1, 1);

            // Hard-coded end value: December 31st, 2000.
            DateTime end = new DateTime(2000, 12, 31);

            // Set the time extent on the map with the hard-coded values.
            MyMapView.TimeExtent = new TimeExtent(start, end);
        }

        private void twoThousandFive_Clicked(object sender, EventArgs e)
        {
            // Hard-coded start value: January 1st, 2005.
            DateTime start = new DateTime(2005, 1, 1);

            // Hard-coded end value: December 31st, 2005.
            DateTime end = new DateTime(2005, 12, 31);

            // Set the time extent on the map with the hard-coded values.
            MyMapView.TimeExtent = new TimeExtent(start, end);
        }
    }
}
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"
             x:Class="ArcGISRuntime.Samples.ChangeTimeExtent.ChangeTimeExtent">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Label Grid.Row="0"
               Text="Tap a year to filter the data." 
               HorizontalTextAlignment="Center" />
        <Button Grid.Row="1" 
                Text="2000" 
                Clicked="twoThousand_Clicked" />
        <Button Grid.Row="2" 
                Text="2005" 
                Clicked="twoThousandFive_Clicked" />
        <esriUI:MapView x:Name="MyMapView" 
                        Grid.Row="3" />
    </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
AccessLoadStatusThis sample demonstrates how to access the Maps' LoadStatus. The LoadStatus will be considered loaded when the following are true: The Map has a valid SpatialReference and the Map has an been set to the MapView.
AddAnIntegratedMeshLayerView an integrated mesh layer from a scene service.
AddEncExchangeSetThis sample demonstrates how to load an ENC Exchange Set, including its component cells.
AddFeaturesAdd new features to an online feature service.
AddPointSceneLayerView a point scene layer from a scene service.
AnalyzeHotspotsThis sample demonstrates how to execute the GeoprocessingTask asynchronously to calculate a hotspot analysis based on the frequency of 911 calls. It calculates the frequency of these calls within a given study area during a specified constrained time period set between 1/1/1998 and 5/31/1998.
Animate3DGraphicThis sample demonstrates how to animate a graphic's position and follow it using a camera controller.
ArcGISMapImageLayerUrlThis sample demonstrates how to add an ArcGISMapImageLayer as a base layer in a map. The ArcGISMapImageLayer comes from an ArcGIS Server sample web service.
ArcGISTiledLayerUrlThis sample demonstrates how to add an ArcGISTiledLayer as a base layer in a map. The ArcGISTiledLayer comes from an ArcGIS Server sample web service.
ArcGISVectorTiledLayerUrlThis sample demonstrates how to add an ArcVectorGISTiledLayer as a base layer in a map.
AuthorMapThis sample demonstrates how to author and save a map as an ArcGIS portal item (web map). Saving a map to arcgis.com requires an ArcGIS Online login.
BrowseWfsLayersBrowse for layers in a WFS service.
BufferThis sample demonstrates how to use `GeometryEngine.Buffer` to create polygons from a map location and linear distance (radius). For each input location, the sample creates two buffer polygons (using the same distance) and displays them on the map using different symbols. One polygon is calculated using the `planar` (flat) coordinate space of the map's spatial reference. The other is created using a `geodesic` technique that considers the curved shape of the Earth's surface (which is generally a more accurate representation). Distortion in the map increases as you move away from the standard parallels of the spatial reference's projection. This map is in Web Mercator so areas near the equator are the most accurate. As you move the buffer location north or south from that line, you'll see a greater difference in the polygon size and shape. Planar operations are generally faster, but performance improvement may only be noticeable for large operations (buffering a great number or complex geometry). Creating buffers is a core concept in GIS proximity analysis, allowing you to visualize and locate geographic features contained within a polygon. For example, suppose you wanted to visualize areas of your city where alcohol sales are prohibited because they are within 500 meters of a school. The first step in this proximity analysis would be to generate 500 meter buffer polygons around all schools in the city. Any such businesses you find inside one of the resulting polygons are violating the law. If you are using planar buffers, make sure that the input locations and distance are suited to the spatial reference you're using. Remember that you can also create your buffers using geodesic and then project them to the spatial reference you need for display or analysis. For more information about using buffer analysis, see [How buffer analysis works](https://pro.arcgis.com/en/pro-app/tool-reference/analysis/how-buffer-analysis-works.htm) in the ArcGIS Pro documentation.
BufferListThis sample demonstrates how to use a planar (Euclidean) buffer operation by calling `GeometryEngine.Buffer` to generate one or more polygons from a collection of input geometries and a corresponding collection of buffer distances. The result polygons can be returned as individual geometries or unioned into a single polygon output.
ChangeAtmosphereEffectChange the appearance of the atmosphere in a scene.
ChangeBasemapThis sample demonstrates how to dynamically change the basemap displayed in a Map.
ChangeBlendRendererThis sample demonstrates how to use blend renderer on a raster layer. You can get a hillshade blended with either a colored raster or color ramp.
ChangeEncDisplaySettingsThis sample demonstrates how to control ENC environment settings. These settings apply to the display of all ENC content in your app.
ChangeFeatureLayerRendererThis sample demonstrates how to change renderer for a feature layer. It also shows how to reset the renderer back to the default.
ChangeStretchRendererThis sample demonstrates how to use stretch renderer on a raster layer.
ChangeSublayerRendererThis sample demonstrates how to change the sub-layer renderer of an ArcGIS map image layer. A unique value renderer is applied to see different population ranges in the counties sub-layer data.
ChangeSublayerVisibilityThis sample demonstrates how to show or hide sublayers of a map image layer.
ChangeTimeExtentThis sample demonstrates how to filter data in layers by applying a time extent to a MapView.
ChangeViewpointThis sample demonstrates different ways in which you can change the viewpoint of the MapView.
ClipGeometryThis sample demonstrates how to clip a geometry with an envelope using the GeometryEngine
ClosestFacilityDemonstrates how to solve a Closest Facility Task to find the closest route between a facility (hospital) and a incident (black cross).
ClosestFacilityStaticDemonstrates how to solve a Closest Facility Task to find the closest route between facilities and incidents.
ConvexHullThis sample demonstrates how to use the GeometryEngine.ConvexHull operation to generate a polygon that encloses a series of user-tapped map points.
ConvexHullListThis sample demonstrates how to use the GeometryEngine.ConvexHull to generate convex hull polygon(s) from multiple input geometries.
CreateFeatureCollectionLayerThis sample demonstrates how to create a new feature collection with several feature collection tables. The collection is displayed in the map as a feature collection layer.
CreateGeometriesThis sample demonstrates simple ways to create different types of Geometry. The geometries are added as Graphics to a GraphicsOverlay and displayed in a MapView. An Envelope is used to set the Viewpoint of the MapView.
CreateTerrainSurfaceFromRasterUse a terrain surface with elevation described by a local raster file.
CreateTerrainSurfaceFromTilePackageUse a terrain surface with elevation described by a local tile package.
CutGeometryThis sample demonstrates how to cut a geometry with a polyline using the GeometryEngine.
DeleteFeaturesDelete features from a feature service.
DensifyAndGeneralizeThis sample demonstrates how to densify or generalize a polyline geometry. In this example, points representing a ship's location are shown at irregular intervals. You can densify the polyline to interpolate points along the line at regular intervals. Generalizing the polyline can also simplify the geometry while preserving its general shape.
DictionaryRendererGraphicsOverlayRender graphics with mil2525d symbols.
DisplayDeviceLocationThis sample demonstrates how you can enable location services and switch between different types of auto pan modes.
DisplayGridThis sample demonstrates how to display and work with coordinate grid systems such as Latitude/Longitude, MGRS, UTM and USNG on a map view. This includes toggling labels visibility, changing the color of the grid lines, and changing the color of the grid labels.
DisplayKmlDisplay a KML file from URL, a local file, or a portal item.
DisplayKmlNetworkLinksDisplay a KML file that loads content from a network resource.
DisplayMapThis sample demonstrates how to display a map with a basemap.
DisplaySceneDemonstrates how to display a scene with an elevation data source. An elevation data source allows objects to be viewed in 3D, like this picture of Mt. Everest.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
DistanceMeasurementThis sample demonstrates measuring 3D distances between two points in a scene. The distance measurement analysis allows you to add the same measuring experience found in ArcGIS Pro, City Engine, and the ArcGIS API for JavaScript to your app. You can set the unit system of measurement (metric or imperial) and have the units automatically switch to one appropriate for the current scale. The rendering is handled internally so they do not interfere with other analyses like viewsheds.
EditAndSyncFeaturesThis sample demonstrates how to synchronize offline edits with a feature service.
EditFeatureAttachmentsAdd, delete, and download attachments for features from a service.
ExportTilesThis sample demonstrates how to export tiles from a map server.
FeatureCollectionLayerFromPortalThis sample demonstrates opening a feature collection saved as a portal item.
FeatureCollectionLayerFromQueryThis sample demonstrates how to create a feature collection layer to show a query result from a service feature table.
FeatureLayerDefinitionExpressionThis sample demonstrates how to apply definition expression to a feature layer for filtering features. It also shows how to reset the definition expression.
FeatureLayerDictionaryRendererDemonstrates how to apply a dictionary renderer to a feature layer and display mil2525d graphics. The dictionary renderer creates these graphics using a mil2525d style file and the attributes attached to each feature within the geodatabase.
FeatureLayerGeodatabaseThis sample demonstrates how to consume an Esri .geodatabase file (aka. mobile geodatabase) by using a FeatureLayer and a GeodatabaseFeatureTable.
FeatureLayerQueryQuery a feature layer via a feature table.
FeatureLayerSelectionSelect features by tapping a MapView.
FeatureLayerShapefileThis sample demonstrates how to open a shapefile stored on the device and display it as a feature layer with default symbology.
FeatureLayerTimeOffsetThis sample demonstrates how to show data from the same service side-by-side with a time offset. This allows for the comparison of data over time.
FeatureLayerUrlThis sample demonstrates how to show a feature layer on a map using the URL to the service.
FindAddressThis sample demonstrates how you can use the LocatorTask API to geocode an address and display it with a pin on the map. Tapping the pin displays the reverse-geocoded address in a callout.
FindPlaceThis sample demonstrates how to use geocode functionality to search for points of interest, around a location or within an extent.
FindRouteThis sample demonstrates how to solve for the best route between two locations on the map and display driving directions between them.
FindServiceAreaDemonstrates how to find services areas around a point using the ServiceAreaTask. A service area shows locations that can be reached from a facility based off a certain impedance [travel time in this case]. Service areas for a two and five minute travel time are used. Barriers can also be added which can effect the service area by not letting traffic through and adding to the time to get to locations.
FormatCoordinatesThis sample demonstrates how to convert between `MapPoint` and string representations of a point using various coordinate systems.
GenerateGeodatabaseThis sample demonstrates how to take a feature service offline by generating a geodatabase.
GeodatabaseTransactionsThis sample demonstrates how to manage edits to a local geodatabase inside of transactions.
GeodesicOperationsThis sample demonstrates how to use the Geometry engine to calculate a geodesic path between two points and measure its distance.
GeoViewSyncThis sample demonstrates how to keep two geo views (MapView/SceneView) in sync with each other.
GroupLayersGroup a collection of layers together and toggle their visibility as a group.
IdentifyGraphicsThis sample demonstrates how to identify graphics in a graphics overlay. When you tap on a graphic on the map, you will see an alert message displayed.
IdentifyKmlFeaturesIdentify KML features and show popups.
IdentifyLayersThis sample demonstrates how to identify features from multiple layers in a map.
IntegratedWindowsAuthThis sample demonstrates how to use a Windows login to authenticate with a portal that is secured with IWA.
LineOfSightGeoElementThis sample demonstrates how to perform a dynamic line of sight analysis between two moving GeoElements.
LineOfSightLocationThis sample demonstrates a `LocationLineOfSight` analysis that shows segments that are visible or obstructed along a line drawn from observer to target.
ListKmlContentsList the contents of a KML file.
ListTransformationsThis sample demonstrates how to use the TransformationCatalog to get a list of available DatumTransformations that can be used to project a Geometry between two different SpatialReferences, and how to use one of the transformations to perform the GeometryEngine.project operation. The TransformationCatalog is also used to set the location of files upon which grid-based transformations depend, and to find the default transformation used for the two SpatialReferences.
LoadWebTiledLayerThis sample demonstrates how to load a web tiled layer from a non-ArcGIS service, including how to include proper attribution.
ManageBookmarksThis sample demonstrates how to access and add bookmarks to a map.
ManageOperationalLayersAdd, remove, and reorder operational layers in a map.
MapImageLayerTablesThis sample demonstrates how to get a non-spatial table from an ArcGIS map image layer. It shows how to query such a table, as well as how to find related features in another table. The non-spatial tables contained by a map service may contain additional information about sublayer features. Such information can be accessed by traversing table relationships defined in the service.
MapImageSublayerQueryThis sample demonstrates how to execute an attribute and spatial query on the sublayers of an ArcGIS map image layer. Sublayers of an ArcGISMapImageLayer may expose a ServiceFeatureTable through a Table property.This allows you to perform the same queries available when working with a table from a FeatureLayer: attribute query, spatial query, statistics query, query for related features, and so on.
MapRotationThis sample illustrates how to rotate a map.
NearestVertexThis sample demonstrates how to use the Geometry engine find the nearest vertex and nearest coordinate of a polygon to a point. The distance for each is shown.
OfflineGeocodeGeocode with offline data.
OpenStreetMapLayerDisplay an OpenStreetMap layer as a basemap.
PlayKmlToursPlay tours in KML files.
ProjectProject a point to another spatial reference.
QueryFeatureCountAndExtentZoom to features matching a query and count features in the visible extent.
RasterHillshadeThis sample demonstrates how to use a hillshade renderer on a raster layer. Hillshade renderers can adjust a grayscale raster (usually of terrain) according to a hypothetical sun position (azimuth and altitude).
RasterLayerFileThis sample demonstrates how to use a raster layer created from a local raster file.
RasterLayerGeoPackageThis sample demonstrates how to open a GeoPackage and show a GeoPackage raster in a raster layer.
RasterLayerImageServiceRasterAdd a raster layer from an image service to a map.
RasterLayerRasterFunctionThis sample demonstrates how to show a raster layer on a map based on an image service layer that has a raster function applied.
RasterRenderingRuleThis sample demonstrates how to create an `ImageServiceRaster`, fetch the `RenderingRule`s from the service info, and use a `RenderingRule` to create an `ImageServiceRaster` and add it to a raster layer.
RasterRgbRendererThis sample demonstrates how to use an RGB renderer on a raster layer. An RGB renderer is used to adjust the color bands of a multi-spectral image.
ReadShapefileMetadataThis sample demonstrates how to open a shapefile stored on the device, read metadata that describes the dataset, and display it as a feature layer with default symbology.
RenderPictureMarkersThis sample demonstrates how to create picture marker symbols from a URL and embedded resources.
RenderSimpleMarkersThis sample adds a point graphic to a graphics overlay symbolized with a red circle specified via a SimpleMarkerSymbol.
RenderUniqueValuesThis sample demonstrate how to use a unique value renderer to style different features in a feature layer with different symbols. Features do not have a symbol property for you to set, renderers should be used to define the symbol for features in feature layers. The unique value renderer allows for separate symbols to be used for features that have specific attribute values in a defined field.
ReverseGeocodeUse an online geocoding service to find the address for a point.
SceneLayerSelectionIdentify GeoElements in a scene layer.
SceneLayerUrlDisplay an ArcGIS Scene layer from a service.
ScenePropertiesExpressionsUpdate the orientation of a graphic using scene property rotation expressions.
SceneSymbolsShow various kinds of 3D symbols in a scene.
SearchPortalMapsThis sample demonstrates searching a portal for web maps and loading them in the map view. You can search ArcGIS Online public web maps using tag values or browse the web maps in your account. OAuth is used to authenticate with ArcGIS Online to access items in your account.
SelectEncFeaturesThis sample demonstrates how to select an ENC feature.
ServiceFeatureTableCacheThis sample demonstrates how to use a feature service in on interaction cache mode.
ServiceFeatureTableManualCacheThis sample demonstrates how to use a feature service in manual cache mode.
ServiceFeatureTableNoCacheThis sample demonstrates how to use a feature service in on interaction no cache mode.
SetInitialMapAreaThis sample demonstrates how to set the initial viewpoint from envelope defined by minimum (x,y) and maximum (x,y) values. The map's InitialViewpoint is set to this viewpoint before the map is loaded into the MapView. Upon loading the map zoom to this initial area.
SetMinMaxScaleThis sample demonstrates how to set the minimum and maximum scale of a Map. Setting the minimum and maximum scale for the Map can be useful in keeping the user focused at a certain level of detail.
ShowCalloutThis sample illustrates how to show callouts on a map in response to user interaction.
ShowLabelsOnLayerShow labels on a feature layer using a JSON label definition.
SimpleRenderersThis sample demonstrates how to create a simple renderer and add it to a graphics overlay. Renderers define the symbology for all graphics in a graphics overlay (unless they are overridden by setting the symbol directly on the graphic). Simple renderers can also be defined on feature layers using the same code.
SketchOnMapThis sample demonstrates how to interactively sketch and edit graphics in the map view and display them in a graphics overlay. You can sketch a variety of geometry types and undo or redo operations.
SpatialRelationshipsThis sample demonstrates how to use the GeometryEngine to evaluate the spatial relationships (for example, polygon a contains line b) between geometries.
StatisticalQueryThis sample demonstrates how to query a feature table to get statistics for a specified field.
SurfacePlacementsThis sample demonstrates how to position graphics using different Surface Placements.
SymbolizeShapefileThis sample demonstrates how to apply a custom renderer to a shapefile displayed by a feature layer.
TakeScreenshotThis sample demonstrates how you can take screenshot of a map. Click 'capture' button to take a screenshot of the visible area of the map. Created image is shown in the sample after creation.
TerrainExaggerationConfigure the vertical exaggeration of terrain (the ground surface) in a scene.
TimeBasedQueryThis sample demonstrates how to apply a time-based parameter to a feature layer query.
UpdateAttributesUpdate feature attributes in an online feature service.
UpdateGeometriesUpdate a feature's location in an online feature service.
UseDistanceCompositeSymThis sample demonstrates how to create a `DistanceCompositeSceneSymbol` with unique marker symbols to display at various distances from the camera.
ViewPointCloudDataOfflineDisplay local 3D point cloud data.
ViewshedCameraThis sample demonstrates how to create a `LocationViewshed` to display interactive viewshed results in the scene view. The viewshed observer is defined by the scene view camera to evaluate visible and obstructed areas of the scene from that location.
ViewshedGeoElementDisplay a live viewshed analysis for a moving GeoElement.
ViewshedLocationThis sample demonstrates the configurable properties of viewshed analysis, including frustum color, heading, pitch, distances, angles, and location.
WfsXmlQueryLoad a WFS feature table using an XML query.
WmsIdentifyThis sample demonstrates how to identify WMS features and display the associated content for an identified WMS feature.
WMSLayerUrlAdd a layer from a WMS service to a map.
WmsServiceCatalogThis sample demonstrates how to enable and disable the display of layers discovered from a WMS service.
WMTSLayerThis sample demonstrates how to display a WMTS layer on a map via a Uri and WmtsLayerInfo.