Determine the map's load status which can be: NotLoaded
, FailedToLoad
, Loading
, Loaded
.
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
- Create a
Map
and add it to aMapView
. - 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
- Map
- ILoadable
- MapView
Tags
LoadStatus, Loadable pattern, Map
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.AccessLoadStatus.AccessLoadStatus"
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}">
<TextBlock x:Name="LoadStatusTextBlock"
Text="Map's load status : "
TextAlignment="Center" FontWeight="SemiBold" />
</Border>
</Grid>
</UserControl>