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
- DrawStatus
- DrawStatusChangedEvent
- DrawStatusChangedListener
- Map
- MapView
Tags
draw, loading, map, render
Sample Code
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.DisplayDrawingStatus.DisplayDrawingStatus"
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:sampleViewer="clr-namespace:Forms.Resources">
<RelativeLayout>
<esriUI:MapView x:Name="myMapView"
Style="{StaticResource MapWithFormStyle}"
ViewInsets="0" />
<sampleViewer:ResponsiveFormContainer x:Name="FormContainer">
<StackLayout>
<Label Style="{StaticResource LabelStyle}" Text="Pan and zoom to see drawing status changes." />
<ActivityIndicator x:Name="activityIndicator" Color="Black" />
</StackLayout>
</sampleViewer:ResponsiveFormContainer>
</RelativeLayout>
</ContentPage>