ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core Namespace / DownloadOptions Class / OfflineMapsToProjectLocation Property
Example

In This Topic
    OfflineMapsToProjectLocation Property
    In This Topic
    Gets and sets the 'Download maps to the project's home folder' option for offline maps.
    Syntax
    public bool OfflineMapsToProjectLocation {get; set;}
    Public Property OfflineMapsToProjectLocation As Boolean
    Remarks
    Setting this property to true automatically clears out the OfflineMapsLocation property and sets the AskForOfflineMapsLocation property to false.
    This property is automatically set to false if the OfflineMapsLocation property is set or AskForOfflineMapsLocation is set to true.
    Example
    Get DownloadOptions
    {
      var staging = ApplicationOptions.DownloadOptions.StagingLocation;
    
      var ppkx_loc = ApplicationOptions.DownloadOptions.UnpackPPKXLocation;
      var ask_ppkx_loc = ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation;
    
      var other_loc = ApplicationOptions.DownloadOptions.UnpackOtherLocation;
      var ask_other_loc = ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation;
      var use_proj_folder = ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation;
    
      var offline_loc = ApplicationOptions.DownloadOptions.OfflineMapsLocation;
      var ask_offline_loc = ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation;
      var use_proj_folder_offline = ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation;
    }
    Set DownloadOptions for OfflineMaps
    {
      //OfflineMaps settings control where map content that is taken
      //offline is copied to on the local machine. Options are mutually exclusive.
    
      //Set ApplicationOptions.DownloadOptions.OfflineMapsLocation explicitly to
      //toggle ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation and
      //ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation to false
      //Note: default is typically <My Documents>\ArcGIS\OfflineMaps, _not_ null.
      //This is the same behavior as on the Pro UI.
      ApplicationOptions.DownloadOptions.OfflineMapsLocation = @"D:\data\for_offline";
    
      //or...to use a location already stored in OfflineMapsLocation as the
      //default without changing it,
      //set ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation and
      //ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation to false
      //explicitly.
      if (!string.IsNullOrEmpty(ApplicationOptions.DownloadOptions.OfflineMapsLocation))
      {
        ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation = false;
        ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation = false;
      }
    
      //Setting ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation to
      //true overrides any OfflineMapsLocation value and sets
      //ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation to false.
      //This is the same behavior as on the Pro UI.
      ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation = true;
    
      //Setting ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation to
      //true overrides any OfflineMapsLocation value and sets
      //ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation to false.
      //This is the same behavior as on the Pro UI.
      ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation = true;
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also