ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / DownloadOptions Class / OfflineMapsLocation Property
Example

In This Topic
    OfflineMapsLocation Property
    In This Topic
    Gets and sets the folder location for downloading map content that is taken offline.
    Syntax
    public string OfflineMapsLocation {get; set;}
    Public Property OfflineMapsLocation As String
    Remarks
    Setting an offline maps location automatically sets the AskForOfflineMapsLocation and OfflineMapsToProjectLocation properties to false.
    If the folder does not exist, the application attempts to create it when the value is assigned. Attempting to assign a folder location to which the current user does not have write permission will fail. Set to empty string to revert to the application default.
    Example
    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, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also