ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / MapSeries Class
Members Example

In This Topic
    MapSeries Class
    In This Topic
    Represents a map series that may be associated with a layout.
    Object Model
    MapSeries ClassBookmarkMapSeries ClassSpatialMapSeries ClassThematicMapSeries ClassCIMMapSeries ClassMapFrame Class
    Syntax
    Public MustInherit Class MapSeries 
    public abstract class MapSeries 
    Remarks

    You can create multiple map series but a layout can only have one associated map series at a time. There are two basic ways you can work with a map series.

    First, you can reference the layout's currently active map series using the MapSeries property on the Layout. This returns a map series CIM definition. Changes can be made and then pushed back to the Layout using the SetMapSeries() method.

    Second, you can create a new map series using a constructor like CreateSpatialMapSeries. This will also return a CIM definition that can be modified and pushed back to the Layout using the SetMapSeries() method.

    To export a map series you need to contruct an ExportFormat and a MapSeriesExportOptions.

    Example
    Modify an existing map series
    {
      //Modify the currently active map series and changes its sort field and page number field.
      //Note: Must be on QueuedTask.Run
      SpatialMapSeries SMS = layout.MapSeries as SpatialMapSeries; //cast as spatial map series for additional members
      SMS.SortField = "State_Name";
      SMS.SortAscending = true;
      SMS.PageNumberField = "PageNum";
    
      //Overwrite the current map series with these new settings
      layout.SetMapSeries(SMS);
    }
    Create a new spatial map series
    {
      // This example create a new spatial map series and then applies it to the active layout. This will automatically 
      // overwrite an existing map series if one is already present.
      //Note: Must be on QueuedTask.Run;
      //SpatialMapSeries constructor - required parameters
      BasicFeatureLayer indexLyr = map.FindLayers("Countries").FirstOrDefault() as BasicFeatureLayer;
      SpatialMapSeries SMS = MapSeries.CreateSpatialMapSeries(layout, mapFrame, indexLyr, "Name");
    
      //Set optional, non-default values
      SMS.CategoryField = "Continent";
      SMS.SortField = "Population";
      SMS.ExtentOptions = ExtentFitType.BestFit;
      SMS.MarginType = ArcGIS.Core.CIM.UnitType.PageUnits;
      SMS.MarginUnits = ArcGIS.Core.Geometry.LinearUnit.Centimeters;
      SMS.Margin = 1;
      SMS.ScaleRounding = 1000;
      layout.SetMapSeries(SMS);  //Overwrite existing map series.
    }
    Inheritance Hierarchy
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also