Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS Runtime SDK for Qt

OpenStreetMap layer

Sample Viewer View Sample on GitHub

Add OpenStreetMap as a basemap layer.

Use case

OpenStreetMap is a free community-edited basemap.

How to use the sample

When the sample opens, it will automatically display the map with the OpenStreetMap basemap. Pan and zoom to observe the basemap.

How it works

  1. Create a BasemapOpenStreetMap object nested as a child of the Map.
  2. Show the map in a map view.

Relevant API

  • BasemapOpenStreetMap
  • Map
  • MapView
  • OpenStreetMapLayer

Additional information

The attribution text will be set to the required OpenStreetMap attribution automatically.

Apps that expect to make many requests to OpenStreetMap should consider using an alternative tile server via the WebTiledLayer class. See layer types described in the ArcGIS Runtime SDK for .NET documentation for more information on OpenStreetMap usage restrictions and alternatives.

Esri now hosts an OpenStreetMap vector layer on ArcGIS Online that uses recent OpenStreetMap data in conjunction with a style matching the default OpenStreetMap style. This layer is not subject to the tile access restrictions that apply to tiles fetched from OpenStreetMap.org.

Tags

basemap, layers, map, open, OpenStreetMap, OSM, street

Sample Code

import QtQuick 2.6
import Esri.ArcGISRuntime 100.9

Rectangle {
    id: rootRectangle
    clip: true
    width: 800
    height: 600

    MapView {
        id: mapView
        anchors.fill: parent

        Map {
            // Declare the OpenStreetMap layer Basemap
            BasemapOpenStreetMap {}
        }
    }
}