View in MAUI WPF WinUI UWP View 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
  • BasemapStyle.OSMStandard
  • Map
  • MapView
  • OpenStreetMapLayer

Additional information

OpenStreetMap (OSM) basemaps are in mature support and will no longer be updated. They will be removed in a future version of the ArcGIS Native Maps SDKs. For more information, see the Overture Maps Data in ArcGIS blog. We recommend that you replace your OSM with the equivalent Open Basemap styles.

Tags

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

Sample Code

OpenStreetMapLayer.xaml OpenStreetMapLayer.xaml OpenStreetMapLayer.xaml.cs
<UserControl x:Class="ArcGIS.WPF.Samples.OpenStreetMapLayer.OpenStreetMapLayer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" />
</Grid>
</UserControl>