Display overview map

View inFormsWPFView on GitHub

Include an overview or inset map as an additional map view to show the wider context of the primary view.

Image of display overview map

Use case

An overview map provides a useful, smaller-scale overview of the current map view's location. For example, when you need to inspect a layer with many features while remaining aware of the wider context of the view, use an overview map to help show the extent of the main map view.

How to use the sample

Pan or zoom across the map view to browse through the tourist attractions feature layer and notice the viewpoint and scale of the linked overview map update automatically. When running the sample on a desktop, you can also navigate by panning and zooming on the overview map. However, interactivity of the overview map is disabled on mobile devices.

How it works

  1. Create a Map with the ArcGISTopographic basemap style and add it to the MapView.
  2. Instantiate a FeatureLayer from a ServiceFeatureTable and append it to the Map's operational layers.
  3. In the user-interface, declare an OverviewMap object from the ArcGIS Runtime Toolkit.
  4. Assign the MapView to the MyOverviewMap.GeoView property of the OverviewMap to connect the MapView with the OverviewMap.
  5. Set the scale factor of the OverviewMap with the MyOverviewMap.ScaleFactor.

Relevant API

  • MapView
  • OverviewMap

About the data

The data used in this sample is the OpenStreetMap Tourist Attractions for North America feature layer, which is scale-dependent and displays at scales larger than 1:160,000.

Additional information

This sample uses the overview map toolkit component which can be accessed using the Esri.ArcGISRuntime.Toolkit nuget package. The toolkit can also be cloned and set up locally. For information about setting up the toolkit, visit the repository.

Tags

context, inset, map, minimap, overview, preview, small scale, toolkit, view

Sample Code

DisplayOverviewMap.xamlDisplayOverviewMap.xamlDisplayOverviewMap.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<ContentPage x:Class="ArcGISRuntimeXamarin.Samples.DisplayOverviewMap.DisplayOverviewMap"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             xmlns:toolkit="clr-namespace:Esri.ArcGISRuntime.Toolkit.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Toolkit.Xamarin.Forms">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" />
        <toolkit:OverviewMap Margin="5,5"
                             Padding="1"
                             BackgroundColor="Black"
                             GeoView="{Binding Source={x:Reference MyMapView}}"
                             HeightRequest="180"
                             ScaleFactor="10"
                             WidthRequest="180" />
    </Grid>
</ContentPage>

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