Skip To Content ArcGIS for Developers Sign In Dashboard

Display a map

Maps specify how geographic data is organized and how it should be communicated to your app users. Each instance of a map (Map) represents an individual map you can display for your users. To display a map you must assign it to a map view (MapView). In an MVC architecture, the map represents the model tier and the map view represents the view tier. The map and map view work together to visualize the geographic data on a screen.

Users can interact with the map and its layers using the map view's built-in navigation tools.

Open a map

You can open a map by creating it from a web map or from a mobile map package.

Create the map object from a web map

Web maps can be accessed using either their URL or directly from a portal using their portal item ID. Both methods are described here along with the authentication process required to access the map if it or its data is not public.

Using a web map URL

You can construct the map object from one of the map’s URL strings as follows:

Map {
    id: map1
    initUrl: Globals.url_DynamicWebMap

The map constructor supports these three URL formats:

  • The map viewer URL—For example, The URL is provided in the browser's address bar when a web map is created or viewed using the map viewer.
  • The item details URL—For example, This URL is found in the address bar when you're viewing the details page for an item presented in My Content in
  • The item data URL—For example, This is the address of the JSON string that represents the information to display the map.

If the map is not public, the API’s authentication challenge handler automatically requests that the user provides his credentials.

Using a web map portal item

You can construct the map object using a URL that includes the map's portal item ID. For example, here is a map that's identified by the item ID of 69fdcd8e40734712aaec34194d4b988c.

Example of a web map details page, Hurricanes and Tropical Cyclones.

Map {
    id: map2
    item: PortalItem {
        url: Utils.url("")

Upon completion of this code, neither the portal, portal item, nor the map are loaded. These objects will be loaded when you pass the map to the map view or if you load them explicitly. See the loadable pattern topic for more information. You can override any of the map's properties by setting their value before the map is loaded.


If the map or its layers are not public, you need to provide credentials to access them. Use the Authentication Manager to access these secured resources.

Create a map object from a mobile map package

A mobile map package can be created with ArcGIS Pro or taken offline with the ArcGIS Runtime SDK (on-demand or preplanned). It is a transport mechanism for maps, their layers, data, networks, and locators that can be can be easily copied onto a device.


StreetMap Premium also provides ready-to-use and regularly updated mobile map packages that include a street map, locator, and network dataset for areas throughout the globe. For details, see Add StreetMap Premium data.

Each mobile map package can contain one or more maps that can be displayed in a map view. For more information, see Create mobile map package.

  1. Obtain the file path to the mobile map package.
  2. Construct the mobile map package object using the file path.
  3. The mobile map package must be loaded into the app before the maps themselves can be accessed. Once the mobile map package is loaded, any of its maps can be assigned to the map view to be displayed.
// Load the mobile map package from file on local storage
  var mobileMapPackage = ArcGISRuntimeEnvironment.createObject("MobileMapPackage");
  mobileMapPackage.path = System.userHomePath + "/ArcGIS/Runtime/mydata/mmpks/mypackage.mmpk";

  // ...
  // Later after mobile map package loads, use the first map it contains to create   // map instance.
  var map = mobileMapPackage.maps[0];

Upon completion of this code the map is not loaded. You can override any of the map's properties by setting their value before the map is loaded. See the loadable pattern topic for more information.

Display the map in a map view

To display a map, you assign it to a map view. Each map view can display a different visible area of the map, can be configured in different ways, and can be designed to respond differently to user gestures. Assign a map to a map view as follows: = myMap;

Assigning a map to a map view initiates the map’s load cycle. When that cycle completes, the map view initiates the load cycle on the map’s layers in order to draw them. For more information loading resources (load cycles), see Loadable pattern of asynchronous resources. You can monitor the loading of the individual layers using the map view's layerViewstateChanged signal .

You can load the map into your app before assigning it to a map view. This is useful if you want to validate the content of the map or you want to access any content or properties in the map without displaying it.

Monitor layer loading

Assigning a map to a map view or explicitly loading a map triggers loading of the map's basemap and operational layers. Each time the state of a layer changes, the map view's LayerViewStateChangedEvent is triggered. Examine the layer's view status to determine whether a layer is active, loading, not visible, out of scale, or whether an error has occurred with the layer's loading process.

Share data between maps and map views

Sharing the same map instance simultaneously among two or more map views, or a layer instance simultaneously between maps, is not supported and is likely to cause stability or performance issues. Working with graphics overlays, or distinct feature layer instances that share the same data source (feature table, for example), can cause the same issues and is also not supported in multiple map views at the same time.

If you need to reuse a map in another map view, you should ensure that it is first removed from the previous map view. The same technique can be used for reusing a layer instance between maps.

Monitor map drawing

If your users pan or zoom the map or the business logic in your app changes the visible area of the map, then new map content will need to be drawn. There will be a short time delay before this map drawing phase is completed. Your app may need to know that the drawing is complete. For example, you may want your app to take a snapshot, or screenshot, of the map only when the drawing has finished.

Use the map view's drawStatusChanged signal to detect whether the map drawing is in progress or has completed. For example, this code displays if the drawing is still in progress.

For example, this code sets the drawing status display as the status changes.

MapView {
  id: view
  // ... Set additional properties and nested objects
  onDrawStatusChanged: {
    // drawStatus is a property of a MapView
    if (drawStatus === Enums.DrawStatusCompleted) {
      statusBar.currentStatus = "draw status complete";
    } else if (drawStatus === Enums.DrawStatusInProgress) {
      statusBar.currentStatus = "draw status in progress"
  // ...

Navigate the map

When a map is first loaded into a map view, it's displayed at a geographical location defined by the map's initial view point. Users can then pan or zoom the map with a range of gestures that are built into the map view. You can access the visible area of the map as a polygon returned by the map view's visibleArea property . The visible area is returned as a polygon, and not an envelope, because the map may be rotated and each corner of the map may contain unique x-y coordinates.

As a developer you can programmatically set the map's visible area in your app by calling one of the map view's many setViewpoint methods. Many options are available to choose from to allow you to:

  • Rotate the map to a specified angle.
  • Zoom the map to the specified scale.
  • Zoom or pan the map so that a given geometry fits the visible area of the map view.
  • Zoom or pan the map to a specified location.
  • Zoom or pan the map to a specific view point. You can define a view point using a:
    • Center and scale
    • Center, scale, and rotation
    • Latitude, longitude, and scale
    • Target extent
    • Target extent and rotation

Set the viewpoint to a geocode task result's spatial extent.


Configure the map view

You can enhance your user's map experience by changing the background color, showing the device's location, rotating the map display, or making the world map seamless by enabling wrap-around.

Change the map background color

You can set a background color to display behind the map. This color will be displayed in transparent areas of the map as well as areas where there is no basemap or operational data. Before a map is added to a map view, a default background grid is displayed. If a map is added that does not have a background color defined, the map view background grid will continue to display behind areas of the map without data. If a background color is applied to the map, it is used as the background display and any subsequent changes to the map view's background grid will have no effect.

Default map view background grid (left) and a map with a background color (right)

Show the device's location (display the user's current location)

Many devices provide information about their location through Wi-Fi, cellular networks, or GPS. The device's operating system passes its location to the map view so you can display and track the device on a map. The map view always tries to get the most accurate location available but the reported location could be a best approximation based on signal strength, satellite positions, and other factors. By default, the map view displays the location with a blue, round symbol and a semi-transparent blue circle around this symbol to indicate the range of accuracy.

The display of the location on a map, the symbol used, the animation, and the auto pan behavior are managed by an instance of LocationDisplay. Each MapView has its own instance of a location display.

Here is the essential QML code to display the device's location in a map view.

MapView {
    id: mapView

    Map {
        BasemapLightGrayCanvas {}

    locationDisplay {
        positionSource: PositionSource {
            id: positionSource
        compass: Compass {
            id: compass

For details and additional options for displaying a user's location, such as displaying tracks or changing the symbol, see Show device location in this guide. Also see LocationDisplay in the API Reference.

Enable wrap around

Most flat representations of the earth extend up to 180 degrees east and west longitude and make it difficult to visualize areas that span across the 180th meridian. Enabling wrap around in the map view displays a 2D map extending seamlessly across the 180th meridian. For more information, see the wrap around maps topic.


If your map has wrap around enabled and you're working with map locations, map extents, or are editing or sketching geometries with a map, you must normalize the geometries.

Some maps do not support wrap around; maps that do support wrap around will automatically be displayed in wrap around

Rotate the map

You may not want your map to display in a North-South direction in your device. You can reorient your map in the map view by setting the viewpoint rotation. A positive rotation value rotates the map in a counterclockwise and a negative rotation value rotates the map in a clockwise direction.

// Set the viewpoint rotation with every button click
Button {
    width: 200 * scaleFactor
    height: 40 * scaleFactor
    text: "set viewpoint\nrotation"
    visible: !is3d
    property int rotation: 90
    onClicked: {
        rotation += 90;
        if (rotation > 360)
            rotation = 90;