Author and save a map

This samples demonstrates how to author and save a map as an ArcGIS portal item (web map). Saving a map to arcgis.com requires an ArcGIS Online login.

Author map (iOS)

Instructions

  1. Pan and zoom to the extent you would like for your map.
  2. Choose a basemap from the list of available basemaps.
  3. Choose one or more operational layers to include.
  4. Click 'Save ...' to apply your changes.
  5. Provide info for the new portal item, such as a Title, Description, and Tags.
  6. Click 'Save Map'.
  7. After successfully logging in to your ArcGIS Online account, the map will be saved to your default folder.
You can make additional changes, update the map, and then re-save to store changes in the portal item.

Code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntimeXamarin.Samples.AuthorMap.AuthorMap"
             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:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition/>
      <RowDefinition Height="70"/>
    </Grid.RowDefinitions>
    <esriUI:MapView x:Name="MyMapView"
                    Grid.Row="0"/>
    <ProgressBar x:Name="SaveMapProgressBar"
                  IsVisible="False"/>
    <ListView x:Name="LayersList"
              Grid.Row="0"
              IsVisible="False"
              ItemTapped="LayerSelected">
    </ListView>
    <Grid x:Name="OAuthSettingsGrid" 
          Grid.Row="0"
          HorizontalOptions="Center" VerticalOptions="Center"
          WidthRequest="300">
      <Grid.RowDefinitions>
        <RowDefinition Height="60"/>
        <RowDefinition Height="40"/>
        <RowDefinition Height="40"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="100"/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <Label Grid.Row="0" Grid.ColumnSpan="2" 
             HorizontalOptions="Center" VerticalOptions="Start"
             Text="OAuth Settings"/>
      <Label Grid.Row="1"
             HorizontalOptions="End" VerticalOptions="Center"
             Text="Client ID:"/>
      <Entry x:Name="ClientIDEntry" 
             Grid.Row="1" Grid.Column="1" 
             Placeholder="mYCl1enTiD"
             HorizontalOptions="Start" VerticalOptions="Center"
             WidthRequest="240"/>
      <Label Grid.Row="2"
             HorizontalOptions="End" VerticalOptions="Center"
             Text="Redirect URL:"/>
      <Entry x:Name="RedirectUrlEntry" 
             Grid.Row="2" Grid.Column="1" 
             Placeholder="http://my.redirect/url"
             HorizontalOptions="Start" VerticalOptions="Center"
             WidthRequest="240"/>
      <Button Grid.Row="3" Grid.Column="0"
              HorizontalOptions="End" VerticalOptions="End"
              Text="Cancel"
              Clicked="OAuthSettingsCancel"/>
      <Button Grid.Row="3" Grid.Column="1"
              HorizontalOptions="CenterAndExpand" VerticalOptions="End"
              Text="Use Settings"
              Clicked="SaveOAuthSettings"/>
    </Grid>
    <Grid Grid.Row="1"
          Margin="5,2">
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <Button Grid.Column="0"
              Text="Basemap"
              Clicked="ShowLayerList"/>
      <Button Grid.Column="1"
              Text="Layers"
              Clicked="ShowLayerList"/>
      <Button Grid.Column="2"
              Text="New"
              Clicked="NewMapButtonClick"/>
      <Button Grid.Column="3"
              Text="Save ..."
              Clicked="ShowSaveMapUI"/>
    </Grid>
  </Grid>
</ContentPage>


In this topic
  1. Instructions
  2. Code