Change basemap

View inWPFUWPFormsiOSAndroid
View on GitHub
Sample viewer app

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.

Image of change basemap

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

  1. Create an Map object.
  2. Set the map to the MapView object.
  3. Choose a new basemap type and set it on the map.

Relevant API

  • Basemap
  • Map
  • MapView

Tags

basemap, map

Sample Code

ChangeBasemap.xamlChangeBasemap.xaml.cs
                   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<UserControl x:Class="ArcGISRuntime.WPF.Samples.ChangeBasemap.ChangeBasemap"
             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" />
        <Border Style="{StaticResource BorderStyle}">
            <StackPanel>
                <TextBlock Text="Select basemap"
                           FontWeight="SemiBold"
                           HorizontalAlignment="Center"
                           Margin="0,0,0,5"
                           TextWrapping="Wrap" />
                <ComboBox x:Name="BasemapChooser"
                          SelectionChanged="OnBasemapChooserSelectionChanged" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>

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