Change a map's basemap. A basemap is beneath all layers on a Map
and is used to provide visual reference for the operational layers.
Use case
Basemaps should be selected contextually. For example, in maritime applications, it would be more appropriate to use a basemap of the world's oceans as opposed to a basemap of the world's streets.
How to use the sample
Use the drop down menu to select the active basemap from the list of available basemaps.
How it works
- Create an
Map
object. - Set the map to the
MapView
object. - Choose a new basemap type and set it on the map.
Relevant API
- Basemap
- Map
- MapView
Tags
basemap, map
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.ChangeBasemap.ChangeBasemap"
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" />
<Border Style="{StaticResource BorderStyle}">
<StackPanel>
<TextBlock Text="Select a basemap"
FontWeight="SemiBold"
HorizontalAlignment="Center"
Margin="0,0,0,5"
TextWrapping="Wrap" />
<ComboBox x:Name="BasemapChooser"
HorizontalAlignment="Stretch"
SelectionChanged="OnBasemapListSelectionChanged" />
</StackPanel>
</Border>
</Grid>
</UserControl>