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
- Create a basemap wwith a
BasemapStyle.OSMStandard
basemap style. - Create a map with that basemap.
- 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
<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>