ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / SpatialMapSeries Class
Members Example

In This Topic
    SpatialMapSeries Class
    In This Topic
    Represents a series of pages that span a range of map extents based on features in a specified index layer.
    Object Model
    SpatialMapSeries ClassRow ClassCIMMapSeries ClassBasicFeatureLayer ClassMapFrame ClassLinearUnit Class
    Syntax
    public class SpatialMapSeries : MapSeries 
    Public Class SpatialMapSeries 
       Inherits MapSeries
    Example
    MapSeries_FindPageNumber
    //Return the page number that corresponds to the page name field for an index feature
    
    Layout layout = LayoutView.Active.Layout;
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      SpatialMapSeries SMS = layout.MapSeries as SpatialMapSeries;
      Row msRow = SMS.CurrentRow;
      System.Windows.MessageBox.Show(SMS.FindPageNumber(msRow.GetOriginalValue(msRow.FindField("NAME")).ToString()));
    });
    Modify an existing map series
    //Modify the currently active map series and changes its sort field and page number field.
    
    //Perform on the worker thread
    await 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.
    
    //Reference map frame and index layer
    MapFrame mf = layout.FindElement("Map Frame") as MapFrame;
    Map m = mf.Map;
    BasicFeatureLayer indexLyr = m.FindLayers("Countries").FirstOrDefault() as BasicFeatureLayer;
    
    //Construct map series on worker thread
    await QueuedTask.Run(() =>
    {
      //SpatialMapSeries constructor - required parameters
      SpatialMapSeries SMS = MapSeries.CreateSpatialMapSeries(layout, mf, 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

    System.Object
       ArcGIS.Desktop.Layouts.MapSeries
          ArcGIS.Desktop.Layouts.SpatialMapSeries

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also