Display draw status

View inAndroidFormsUWPWPFWinUIiOSView on GitHub

Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.

Image of display drawing status

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

  1. Create a MapView and subscribe to the DrawStatusChanged event.
  2. Inspect the draw status property in the event handler to determine draw status.

Relevant API

  • DrawStatus
  • DrawStatusChangedEvent
  • DrawStatusChangedListener
  • Map
  • MapView

Tags

draw, loading, map, render

Sample Code

DisplayDrawingStatus.xamlDisplayDrawingStatus.xamlDisplayDrawingStatus.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<UserControl x:Class="ArcGISRuntime.WinUI.Samples.DisplayDrawingStatus.DisplayDrawingStatus"
             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 Width="300"
                Margin="30"
                Padding="20"
                HorizontalAlignment="Right"
                VerticalAlignment="Top"
                Background="White"
                BorderBrush="Black"
                BorderThickness="1">
            <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
                <TextBlock x:Name="StatusDisplay" FontWeight="SemiBold" />
                <ProgressRing x:Name="ActivityIndicator"
                              Margin="10,0,0,0"
                              HorizontalAlignment="Center"
                              IsActive="True" />
            </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.