Skip To Content ArcGIS for Developers Sign In Dashboard

Generate offline map with local basemap

Prompt to use a local basemap for offline use

Loading

<ContentPage 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"
             x:Class="ArcGISRuntimeXamarin.Samples.OfflineBasemapByReference.OfflineBasemapByReference">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" />
        <Frame x:Name="TakeOfflineArea"
               BackgroundColor="White" BorderColor="Black"
               HorizontalOptions="End" VerticalOptions="Start"
               Margin="30" Padding="20" WidthRequest="375">
            <StackLayout HorizontalOptions="Center" VerticalOptions="Center">
                <Button Text="Take map offline"
                        WidthRequest="250"
                        Clicked="TakeMapOfflineButton_Click"
                        IsEnabled="True" />
            </StackLayout>
        </Frame>
        <Frame x:Name="MessageArea"
               IsVisible="False"
               BackgroundColor="White" BorderColor="Black"
               HorizontalOptions="End" VerticalOptions="Start"
               Margin="30" Padding="5" WidthRequest="450">
            <StackLayout>
                <Label HorizontalOptions="Center" VerticalOptions="Center" Margin="10"
                       Text="Map is offline!" />
            </StackLayout>
        </Frame>
        <Grid x:Name="BusyIndicator" BackgroundColor="#807f7f7f" IsVisible="False">
            <Grid HorizontalOptions="Center" VerticalOptions="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Label HorizontalOptions="Center" VerticalOptions="Center" Margin="10"
                       TextColor="White" FontSize="18">
                    <Label.FormattedText>
                        <FormattedString>
                            <Span Text="Generating offline map... " />
                            <Span x:Name="Percentage" Text="" />
                        </FormattedString>
                    </Label.FormattedText>
                </Label>
                <ProgressBar x:Name="ProgressBar"
                             Grid.Row="1"
                             IsEnabled="True"
                             HorizontalOptions="Center" VerticalOptions="Center"
                             WidthRequest="100" HeightRequest="10" Margin="0,0,0,10" />
                <Button Text="Cancel"
                        Grid.Row="2"
                        Clicked="CancelJobButton_Click"
                        HorizontalOptions="Center"
                        WidthRequest="100" />
            </Grid>
        </Grid>
        <Grid x:Name="LoadingIndicator"
              BackgroundColor="#807f7f7f"
              IsVisible="True">
            <Grid HorizontalOptions="Center" VerticalOptions="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Label Text="Loading online map..."
                       TextColor="White" FontSize="18"
                       Margin="10" />
                <ProgressBar Grid.Row="1"
                             IsEnabled="True"
                             WidthRequest="100" HeightRequest="10"
                             HorizontalOptions="Center" VerticalOptions="Center" />
            </Grid>
        </Grid>
    </Grid>
</ContentPage>

In this topic
  1. Code