ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping.Offline Namespace / GenerateOfflineMap Class / GetCanExportVectorTileCache Method
The map to check for vector tile cache content
Example

In This Topic
    GetCanExportVectorTileCache Method
    In This Topic
    Gets whether the map contains one or more vector tile caches that can be exported. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool GetCanExportVectorTileCache( 
       Map map
    )
    Public Function GetCanExportVectorTileCache( _
       ByVal map As Map _
    ) As Boolean

    Parameters

    map
    The map to check for vector tile cache content

    Return Value

    True if the map contains any vector tile services
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    The value of the map parameter cannot be null
    Example
    Export Map Vector Tile Cache Content
    //namespace ArcGIS.Desktop.Mapping.Offline
    var extent = MapView.Active.Extent;
    var map = MapView.Active.Map;
    
    //await if needed...
    QueuedTask.Run(() =>
    {
      //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, extent);
        //Pick the desired LOD scale
        var max_scale = scales[scales.Count() / 2];
    
        //Configure the export parameters
        var export_params = new ExportTileCacheParams()
        {
          Extent = extent,//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, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also