ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / SpatialMapSeries Class / ExtentOptions Property
Example

In This Topic
    ExtentOptions Property (SpatialMapSeries)
    In This Topic
    Gets or sets the extent fitting options.
    Syntax
    Public Property ExtentOptions As ExtentFitType
    public ExtentFitType ExtentOptions {get; set;}

    Property Value

    Type: ExtentFitType
    Remarks
    Optional. If not set, BestFit is the default.
    Example
    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.
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also