Click or drag to resize

MapView Class

The MapView is a container that holds a Map. It is the mapping component of the ArcGIS Runtime .NET SDK. It can contain mapping layers and responds to user interaction (touch, mouse, keyboard) and provides behavior for map navigation. It has multiple properties such as its extent, scale, zoom factor, rotation, etc.
Inheritance Hierarchy
SystemObject
  Xamarin.Forms.BindableObject
    Xamarin.Forms.Element
      Xamarin.Forms.VisualElement
        Xamarin.Forms.View
          Esri.ArcGISRuntime.Xamarin.FormsGeoView
            Esri.ArcGISRuntime.Xamarin.FormsMapView

Namespace:  Esri.ArcGISRuntime.Xamarin.Forms
Assembly:  Esri.ArcGISRuntime.Xamarin.Forms (in Esri.ArcGISRuntime.Xamarin.Forms.dll) Version: 100.6.0.0
Syntax
C#
public class MapView : GeoView

The MapView type exposes the following members.

Constructors
  NameDescription
Public methodMapView
Initializes a new instance of the MapView class.
Top
Properties
  NameDescription
Public propertyAttributionText
Gets the full attribution text for all active layers, concatenated into a single string.
(Inherited from GeoView.)
Public propertyBackgroundGrid
Gets or sets the background grid rendered behind the map data.
Public propertyDrawStatus
Returns the current draw status
(Inherited from GeoView.)
Public propertyGraphicsOverlays
Gets or sets the GraphicsOverlays collection.
(Inherited from GeoView.)
Public propertyGrid
Gets or sets the grid that is available to the map for display.
Public propertyInteractionOptions
Gets or sets the grid that is available to the map for display.
Public propertyIsAttributionTextVisible
Gets or sets a value indicating whether the Esri attribution text is visible.
(Inherited from GeoView.)
Public propertyIsCalloutVisible
Gets a value indicating whether a callout is currently open
(Inherited from GeoView.)
Public propertyIsNavigating
Gets a value indicating whether the map is currently navigating. when navigation has finished the NavigationCompleted event will be raised.
(Inherited from GeoView.)
Public propertyIsWrapAroundEnabled
Indicates whether the wrap around feature is currently active. For wrap around to be active the WrapAroundMode property must be set to true and the SpatialReference of the MapView control must be a SpatialReference that supports wrapping.
(Inherited from GeoView.)
Public propertyLabeling
Gets or sets the ViewLabelProperties.
Public propertyLocationDisplay
Gets or sets the LocationDisplay.
Public propertyMap
Gets or sets the map the view is rendering.
Public propertyMapRotation
Gets the current rotational heading of the map
Public propertyMapScale
Gets the current scale of the map
Public propertySelectionProperties
Gets or sets the selection properties that is applied to graphic overlays and layers within the view.
(Inherited from GeoView.)
Public propertySketchEditor
Gets or sets the sketch editor used for drawing and editing on the map.
Public propertySpatialReference
Gets the current spatial reference of the map
(Inherited from GeoView.)
Public propertyTimeExtent
Gets or sets the time extent that is applied to layers within the view
(Inherited from GeoView.)
Public propertyUnitsPerPixel
Gets the current size of each device independent pixel in map units.
Public propertyViewInsets
Gets or sets the viewport inset.
(Inherited from GeoView.)
Public propertyVisibleArea
Gets the view's visible area.
Public propertyWrapAroundMode
Gets or sets a whether the map will do continuous pan across the antimeridian
Top
Methods
  NameDescription
Public methodCancelSetViewpointOperations
Cancels any pending or currently running SetViewpointAsync operations.
(Inherited from GeoView.)
Public methodDismissCallout
Dismisses a callout if it's open.
(Inherited from GeoView.)
Public methodExportImageAsync
Creates an image snapshot of the current map view
(Inherited from GeoView.)
Public methodGetCurrentViewpoint
Gets the current Viewpoint of the view.
(Inherited from GeoView.)
Public methodGetLayerViewState
Gets the LayerViewState for the given layer.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlayAsync(GraphicsOverlay, Point, Double, Boolean)
Initiates an identify operation on the specified graphics overlay which will return the visible topmost graphic.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlayAsync(GraphicsOverlay, Point, Double, Boolean, Int64)
Initiates an identify operation on the specified graphics overlay which will return the single visible topmost graphic per overlay only.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlaysAsync(Point, Double, Boolean)
Initiate an identify operation on all graphics overlays.
(Inherited from GeoView.)
Public methodIdentifyGraphicsOverlaysAsync(Point, Double, Boolean, Int64)
Initiate an identify operation on all graphics overlays.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, Point, Double, Boolean)
Initiates an identify operation on the specified layer which will return the single visible topmost geolement only.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, Point, Double, Boolean, Int64)
Initiates an identify operation on the specified layer.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, Point, Double, Boolean, CancellationToken)
Initiates an identify operation on the specified layer which will return the single visible topmost geolement only.
(Inherited from GeoView.)
Public methodIdentifyLayerAsync(Layer, Point, Double, Boolean, Int64, CancellationToken)
Initiates an identify operation on the specified layer.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(Point, Double, Boolean)
Initiates an identify operation on all layers in the view which will return the single visible topmost geoelement per layer only.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(Point, Double, Boolean, Int64)
Initiates an identify operation on all layers in the view.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(Point, Double, Boolean, CancellationToken)
Initiates an identify operation on all layers in the view which will return the single visible topmost geoelement per layer only.
(Inherited from GeoView.)
Public methodIdentifyLayersAsync(Point, Double, Boolean, Int64, CancellationToken)
Initiates an identify operation on all layers in the view.
(Inherited from GeoView.)
Public methodLocationToScreen
Converts a location in map coordinates to a screen coordinate relative to the upper-left corner of the map.
Public methodScreenToLocation
Converts a screen point relative to the upper left of the map into a location on the map.
Public methodSetBookmarkAsync
Sets the GeoView's viewpoint with the bookmark's value.
(Inherited from GeoView.)
Public methodSetViewpoint
Sets the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodSetViewpointAsync(Viewpoint)
Animates the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodSetViewpointAsync(Viewpoint, TimeSpan)
Animates the view to the given Viewpoint location
(Inherited from GeoView.)
Public methodSetViewpointAsync(Viewpoint, TimeSpan, AnimationCurve)
Animates the view to the given Viewpoint location using the provided animation curve
Public methodSetViewpointCenterAsync(MapPoint)
Centers the view on the provided point in the provided duration.
Public methodSetViewpointCenterAsync(Double, Double)
Centers the view on the provided point.
Public methodSetViewpointCenterAsync(MapPoint, Double)
Centers the view on the provided point in the provided duration and zooms to the provided scale.
Public methodSetViewpointCenterAsync(Double, Double, Double)
Centers the view on the provided point and zooms to the provided scale.
Public methodSetViewpointGeometryAsync(Geometry)
Zooms to the provided geometry.
Public methodSetViewpointGeometryAsync(Geometry, Double)
Zooms to the provided geometry and leaves some padding around the geometry.
Public methodSetViewpointRotationAsync
Sets the rotation angle of the map
Public methodSetViewpointScaleAsync
Zooms to the given scale.
Public methodShowCalloutAt
Shows a callout based on a CalloutDefinition at the given location.
(Inherited from GeoView.)
Public methodShowCalloutForGeoElement
Shows a callout for the given geoelement at an appropriate location for the tap location by snapping to the geometry of the element.
(Inherited from GeoView.)
Top
Events
  NameDescription
Public eventDrawStatusChanged
Occurs when the DrawStatus property of this instance changes.
(Inherited from GeoView.)
Public eventGeoViewDoubleTapped
Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventGeoViewHolding
Occurs when an otherwise unhandled holding interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventGeoViewTapped
Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of the view.
(Inherited from GeoView.)
Public eventLayerViewStateChanged
Occurs when the LayerViewState of a contained layer changes.
(Inherited from GeoView.)
Public eventNavigationCompleted
When navigation on the map has completed this event will be raised.
(Inherited from GeoView.)
Public eventSpatialReferenceChanged
Occurs when spatial reference of the view changes.
(Inherited from GeoView.)
Public eventViewpointChanged
Occurs when the current viewpoint changes.
(Inherited from GeoView.)
Top
Fields
  NameDescription
Public fieldStatic memberBackgroundGridProperty
Identifies the BackgroundGrid bindable property.
Public fieldStatic memberGridProperty
Identifies the Grid bindable property.
Public fieldStatic memberInteractionOptionsProperty
Identifies the InteractionOptions bindable property.
Public fieldStatic memberLabelingProperty
Identifies the Labeling bindable property.
Public fieldStatic memberLocationDisplayProperty
Identifies the LocationDisplay bindable property.
Public fieldStatic memberMapProperty
Identifies the Map bindable property.
Public fieldStatic memberSketchEditorProperty
Identifies the SketchEditor bindable property.
Public fieldStatic memberWrapAroundModeProperty
Identifies the WrapAroundMode bindable property.
Top
Remarks

The MapView is a container that holds a Map. A Map holds a collection of operational layers and Basemap. Layers are visual representations of geographic information and come in many forms. The types of layers that are displayed in a MapView are two dimensional in nature; meaning they are displayed in X/Y (a.k.a. Latitude/Longitude) coordinate space.

There is only one Map per MapView and it is set by the MapView.Map Property. Multiple Map objects can be created and swapped out dynamically as the application is running in the MapView.

See Also
Additional Examples
Hyperlink to ExampleDescription
AccessLoadStatusDetermine the map's load status which can be: `NotLoaded`, `FailedToLoad`, `Loading`, `Loaded`.
AddEncExchangeSetDisplay nautical charts per the ENC specification.
AddFeaturesAdd features to a feature layer.
AddGraphicsRendererChange the style of all graphics in a graphics overlay by referencing a single symbol style.
AddGraphicsWithSymbolsUse a symbol style to display a graphic on a graphics overlay.
AnalyzeHotspotsUse a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
ArcGISMapImageLayerUrlAdd an ArcGIS Map Image Layer from a URL to a map.
ArcGISTiledLayerUrlLoad an ArcGIS tiled layer from a URL.
ArcGISVectorTiledLayerUrlLoad an ArcGIS Vector Tiled Layer from a URL.
AuthorMapCreate and save a map as an ArcGIS `PortalItem` (i.e. web map).
BrowseWfsLayersBrowse a WFS service for layers.
BufferCreate a buffer around a map point and display the results as a `Graphic`
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChangeBasemapChange a map's basemap. A basemap is beneath all layers on an `Map` and is used to provide visual reference for the operational layers.
ChangeBlendRendererBlend a hillshade with a raster by specifying the elevation data. The resulting raster looks similar to the original raster, but with some terrain shading, giving it a textured look.
ChangeEncDisplaySettingsConfigure the display of ENC content.
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ChangeStretchRendererUse a stretch renderer to enhance the visual contrast of raster data for analysis.
ChangeSublayerRendererApply a renderer to a sublayer.
ChangeSublayerVisibilityChange the visibility of sublayers.
ChangeTimeExtentThis sample demonstrates how to filter data in layers by applying a time extent to a MapView.
ChangeViewpointSet the map view to a new viewpoint.
ClipGeometryClip a geometry with another geometry.
ClosestFacilityFind a route to the closest facility from a location.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
ConvexHullCreate a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails.
ConvexHullListThis sample demonstrates how to use the GeometryEngine.ConvexHull to generate convex hull polygon(s) from multiple input geometries.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
CreateGeometriesCreate simple geometry types.
CutGeometryCut a geometry along a polyline.
DeleteFeaturesDelete features from an online feature service.
DensifyAndGeneralizeA multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals.
DisplayDeviceLocationDisplay your current position on the map, as well as switch between different types of auto pan Modes.
DisplayDrawingStatusGet the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.
DisplayGridDisplay coordinate system grids including Latitude/Longitude, MGRS, UTM and USNG on a map view. Also, toggle label visibility and change the color of grid lines and grid labels.
DisplayLayerViewStateView the status of the layers on the map.
DisplayMapDisplay a map with an imagery basemap.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
DownloadPreplannedMapTake a map offline using an available preplanned map area.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
EditFeatureAttachmentsAdd, delete, and download attachments for features from a service.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FeatureCollectionLayerFromPortalThis sample demonstrates opening a feature collection saved as a portal item.
FeatureCollectionLayerFromQueryCreate a feature collection layer to show a query result from a service feature table. The feature collection is then displayed on a map with a feature collection layer.
FeatureLayerDefinitionExpressionLimit the features to display on the map using a definition expression.
FeatureLayerGeodatabaseDisplay features from a local geodatabase.
FeatureLayerGeoPackageDisplay features from a local GeoPackage.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerRenderingModeMapRender features statically or dynamically by setting the feature layer rendering mode.
FeatureLayerSelectionSelect features in a feature layer.
FeatureLayerShapefileOpen a shapefile stored on the device and display it as a feature layer with default symbology.
FeatureLayerTimeOffsetShow data from the same service side-by-side with a time offset. This allows for the comparison of data over time.
FeatureLayerUrlShow a feature layer on a map using the URL to the service.
FindAddressFind the location for an address.
FindPlaceFind places of interest near a location or within a specific area.
FindRouteDisplay directions for a route between two points.
FindServiceAreaFind the service area within a network from a given point.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
FormatCoordinatesFormat coordinates in a variety of common notations.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapTake a web map offline.
GenerateOfflineMapWithOverridesUse the `OfflineMapTask` with overrides to take a webmap offline. The overrides workflow allows you to adjust the settings used for taking each layer in the map offline. For a simple example of how you take a map offline, please consult the "Generate Offline Map" sample.
GeodatabaseTransactionsThis sample demonstrates how to manage edits to a local geodatabase inside of transactions.
GeodesicOperationsThis sample demonstrates how to perform geodesic operations on geometries using the GeometryEngine. Geodesic calculations take into account the curvature of the Earth, while planar calculations are based on a 2D Cartesian plane.
GeoViewSyncKeep the view points of two views (a MapView and a SceneView in this case) synchronized with each other.
IdentifyGraphicsDisplay an alert message when a graphic is clicked.
IdentifyKmlFeaturesThis sample demonstrates how to identify features in a KML layer. Identified feature attributes are displayed in a callout to simulate a popup.
IdentifyLayersIdentify features in all layers in a map. MapView supports identifying features across multiple layers. Because some layer types have sublayers, the sample recursively counts results for sublayers within each layer.
IntegratedWindowsAuthUse Windows credentials to access services hosted on a portal secured with Integrated Windows Authentication (IWA).
ListRelatedFeaturesList features related to the selected feature.
ListTransformationsGet a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
LoadWebTiledLayerDisplay a tiled web layer.
ManageBookmarksAccess and create bookmarks on a map.
ManageOperationalLayersAdd, remove, and reorder operational layers in a map.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
MapReferenceScaleSet a map's reference scale and control which feature layers should honor that scale.
MapRotationRotate a map.
MobileMapSearchAndRouteDisplay maps and use locators to enable search and routing offline using a Mobile Map Package.
NearestVertexShows how to find the nearest vertex on a geometry to a given point.
OAuthThis sample demonstrates how to authenticate with ArcGIS Online (or your own portal) using OAuth2 to access secured resources (such as private web maps or layers). Accessing secured items requires a login on the portal that hosts them (an ArcGIS Online account, for example).
OfflineBasemapByReferenceUse the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
OpenMapURLDisplay a web map.
OpenMobileMapDisplay a map from a mobile map package.
OpenStreetMapLayerAdd OpenStreetMap as a basemap layer.
ProjectProject a point from one spatial reference to another.
QueryFeatureCountAndExtentZoom to features matching a query and count the features in the current visible extent.
RasterColormapRendererApply a colormap renderer to a raster.
RasterHillshadeUse a hillshade renderer on a raster.
RasterLayerFileCreate and use a raster layer made from a local raster file.
RasterLayerGeoPackageOpen a `GeoPackage`, obtain a raster from the package, and display the table as a `RasterLayer`.
RasterLayerImageServiceRasterCreate a raster layer from a raster image service.
RasterLayerRasterFunctionShow a raster layer from an image service with a raster function applied.
RasterRenderingRuleDisplay a raster on a map and apply different rendering rules to that raster.
RasterRgbRendererUse an `RGBRenderer` on a `RasterLayer`. An `RGBRenderer` is used to adjust the color bands of a multispectral image.
ReadGeoPackageAdd rasters and feature tables from GeoPackages to a map.
ReadShapefileMetadataRead a shapefile and display its metadata.
RenderPictureMarkersUse pictures for markers.
RenderSimpleMarkersShow a simple marker symbol on a map.
RenderUniqueValuesRender features in a layer using a distinct symbol for each unique attribute value.
ReverseGeocodeUse an online service to find the address for a tapped point.
RouteAroundBarriersFind a route that reaches all stops without crossing any barriers.
SearchPortalMapsFind webmap portal items by using a search term.
SelectEncFeaturesSelect features in an ENC layer.
ServiceFeatureTableCacheDisplay a feature layer from a service using the **on interaction cache** feature request mode.
ServiceFeatureTableManualCacheDisplay a feature layer from a service using the **manual cache** feature request mode.
ServiceFeatureTableNoCacheDisplay a feature layer from a service using the **no cache** feature request mode.
SetInitialMapAreaDisplay the map at an initial viewpoint representing a bounding geometry.
SetInitialMapLocationDisplay a map centered on an initial point with a specified level of detail (zoom level).
SetMapSpatialReferenceSpecify a map's spatial reference.
SetMinMaxScaleRestrict zooming between specific scale ranges.
ShowCalloutShow a callout with the latitude and longitude of user-tapped points.
ShowLabelsOnLayerDisplay custom labels on a feature layer.
ShowLocationHistoryDisplay your location history on the map.
ShowMagnifierTap and hold on a map to show a magnifier.
SimpleRenderersDisplay common symbols for all graphics in a graphics overlay with a renderer.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
SpatialOperationsFind the union, intersection, or difference of two geometries.
SpatialRelationshipsDetermine spatial relationships between two geometries.
StatisticalQueryQuery a table to get aggregated statistics back for a specific field.
StyleWmsLayerDiscover available styles and apply them to WMS sublayers.
SymbolizeShapefileDisplay a shapefile with custom symbology.
SymbolsFromMobileStyleOpen a mobile style (.stylx) and read its contents. Combine several symbols from the style into a single multilayer point symbol, then use it to display graphics in the map view.
TakeScreenshotTake a screenshot of the map.
TimeBasedQueryThis sample demonstrates how to query data using a time extent. This workflow can be used to return records that are between a specified start and end date. For example, you could specify to only show records that are before September 16, 2000.
TokenSecuredChallengeThis sample demonstrates how to prompt the user for a username and password to authenticate with ArcGIS Server to access an ArcGIS token-secured service. Accessing secured services requires a login that's been defined on the server.
UpdateAttributesUpdate feature attributes in an online feature service.
UpdateGeometriesUpdate a feature's location in an online feature service.
WfsXmlQueryLoad a WFS feature table using an XML query.
WmsIdentifyIdentify features in a WMS layer and display the associated popup content.
WMSLayerUrlDisplay a WMS layer using a WMS service URL.
WmsServiceCatalogConnect to a WMS service and show the available layers and sublayers. Layers are shown in a hierarchy. Selecting a group layer will recursively select all sublayers for display.
WMTSLayerDisplay a layer from a Web Map Tile Service.