Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.
Use case
You may want to display a loading indicator while layers are loading, which could then be removed on DrawStatus.Completed
.
How to use the sample
Pan and zoom around the map. Observe how the status changes from a loading animation to solid, indicating that drawing has completed.
How it works
- Create a
MapView
and subscribe to theDrawStatusChanged
event. - Inspect the draw status property in the event handler to determine draw status.
Relevant API
- Map
- DrawStatus
- DrawStatusChangedEvent
- DrawStatusChangedListener
- MapView
Tags
draw, loading, map, render
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.DisplayDrawingStatus.DisplayDrawingStatus"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
<Border BorderBrush="Black" BorderThickness="1" Background="White"
VerticalAlignment="Top" HorizontalAlignment="Right"
Margin="30" Padding="20" Width="300">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock x:Name="StatusDisplay"
FontWeight="SemiBold" />
<ProgressRing x:Name="ActivityIndicator"
HorizontalAlignment="Center"
Margin="10,0,0,0"
IsActive="True" />
</StackPanel>
</Border>
</Grid>
</UserControl>