Map load status

View inAndroidFormsUWPWPFWinUIiOSView on GitHub

Determine the map's load status which can be: NotLoaded, FailedToLoad, Loading, Loaded.

screenshot

Use case

Knowing the map's load state may be required before subsequent actions can be executed.

How to use the sample

The load status of the map will be displayed as the sample loads.

How it works

  1. Create a Map and add it to a MapView.
  2. Use the Map.LoadStatusChanged event to listen for changes in the map's load status.

The LoadStatus is Loaded when any of the following criteria are met:

  • The map has a valid spatial reference.
  • The map has an an initial viewpoint.
  • One of the map's predefined layers has been created.

Relevant API

  • ILoadable
  • Map
  • MapView

Tags

load status, loadable pattern, map

Sample Code

AccessLoadStatus.xamlAccessLoadStatus.xamlAccessLoadStatus.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.AccessLoadStatus.AccessLoadStatus"
             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">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackLayout Orientation="Horizontal">
            <Label x:Name="loadStatusLabel" Text="Map's load status : " />
        </StackLayout>
        <esriUI:MapView x:Name="myMapView" Grid.Row="1" />
    </Grid>
</ContentPage>

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