ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping.Offline Namespace / ExportTileCacheParams Class / DestinationFolder Property
Example

In This Topic
    DestinationFolder Property (ExportTileCacheParams)
    In This Topic
    Gets and sets the folder into which the local tile cache(s) will be copied (optional).
    Syntax
    Public Property DestinationFolder As String
    public string DestinationFolder {get; set;}
    Remarks
    If left null or empty, the destination folder defaults to the Offline Maps location specified for the current project in the project properties. Typically this is the current project folder
    Example
    Export Map Raster Tile Cache Content
    {
        //Does the map have any exportable raster content?
        var canExport = GenerateOfflineMap.Instance.GetCanExportRasterTileCache(map);
        var rasterTileExtent = MapView.Active.Extent;
        if (canExport)
        {
            //Check the available LOD scale ranges
            var scales = GenerateOfflineMap.Instance.GetExportRasterTileCacheScales(map, rasterTileExtent);
            //Pick the desired LOD scale
            var max_scale = scales[scales.Count() / 2];
    
            //Configure the export parameters
            var export_params = new ExportTileCacheParams()
            {
                Extent = rasterTileExtent,//Use same extent as was used to retrieve scales
                MaximumUserDefinedScale = max_scale
                //DestinationFolder = .... (optional)
            };
            //If DestinationFolder is not set, output defaults to project
            //offline maps location set in the project properties. If that is 
            //not set, output defaults to the current project folder location.
    
            //Do the export. Depending on the MaximumUserDefinedScale and the
            //area of the extent requested, this can take minutes for tile packages
            //over 1 GB or less if your network speed is slow...
            GenerateOfflineMap.Instance.ExportRasterTileCache(map, export_params);
        }
    }
    Export Map Vector Tile Cache Content
    {
        var mapVectorTileExtent = MapView.Active.Extent;
        //Does the map have any exportable vector tile content?
        var canExport = GenerateOfflineMap.Instance.GetCanExportVectorTileCache(map);
        if (canExport)
        {
            //Check the available LOD scale ranges
            var scales = GenerateOfflineMap.Instance.GetExportVectorTileCacheScales(map, mapVectorTileExtent);
            //Pick the desired LOD scale
            var max_scale = scales[scales.Count() / 2];
    
            //Configure the export parameters
            var export_params = new ExportTileCacheParams()
            {
                Extent = mapVectorTileExtent,//Use same extent as was used to retrieve scales
                MaximumUserDefinedScale = max_scale,
                DestinationFolder = @"C:\Data\Offline"
            };
            //If DestinationFolder is not set, output defaults to project
            //offline maps location set in the project properties. If that is 
            //not set, output defaults to the current project folder location.
    
            //Do the export. Depending on the MaximumUserDefinedScale and the
            //area of the extent requested, this can take minutes for tile packages
            //over 1 GB or less if your network speed is slow...
            GenerateOfflineMap.Instance.ExportVectorTileCache(map, export_params);
        }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also