OpenStreetMap layer

View inMAUIUWPWPFWinUIView on GitHub

Add OpenStreetMap as a basemap layer.

Image of OpenStreetMap 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 basemap wwith a BasemapStyle.OSMStandard basemap style.
  2. Create a map with that basemap.
  3. Show the map in a map view.

Relevant API

  • Basemap
  • Basemap.CreateOpenStreetMap
  • 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.

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

OpenStreetMapLayer.xamlOpenStreetMapLayer.xamlOpenStreetMapLayer.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
<UserControl
    x:Class="ArcGIS.UWP.Samples.OpenStreetMapLayer.OpenStreetMapLayer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" />
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.