Change basemap

View inMAUIUWPWPFWinUIView on GitHub

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.xamlChangeBasemap.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<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>

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close