园区网站建设,网站月流量,网业浏览设置在哪,建设大型网站的公司在ArcGIS Pro中#xff0c;有一个地图系列#xff0c;可以在一个布局中导出多个地图。 在SDK中为ArcGIS.Desktop.layout.MapSeries类和映射系列导出选项#xff0c;可以以支持多页导出。
MapSeries类提供了一个静态CreateSpatialMapSeries方法#xff0c;该方法使用指定的…在ArcGIS Pro中有一个地图系列可以在一个布局中导出多个地图。 在SDK中为ArcGIS.Desktop.layout.MapSeries类和映射系列导出选项可以以支持多页导出。
MapSeries类提供了一个静态CreateSpatialMapSeries方法该方法使用指定的索引层作为参数传递为给定布局生成空间地图系列。
使用返回的SpatialMapSeries类实例可以细化地图系列格式选项范围选项、边距设置等。
与布局关联的地图系列如果有可以从其【layout.MapSeries】属性中访问。 1、创建地图系列 await QueuedTask.Run(() {// 地图系列构造函数【布局地图视图图层名称】var SMS MapSeries.CreateSpatialMapSeries(layout, mapFrame, countiesLayer, 新地图系列);// SMC参数SMS.CategoryField State;SMS.SortField Population;SMS.ExtentOptions ExtentFitType.BestFit;SMS.MarginType ArcGIS.Core.CIM.UnitType.PageUnits;SMS.MarginUnits ArcGIS.Core.Geometry.LinearUnit.Centimeters;SMS.Margin 1;// 创建地图系列layout.SetMapSeries(SMS);});
2、导出地图系列
要导出地图系列可以将MapSeriesExportOptions类与ExportFormat结合使用以创建多页导出。对于PDF和TIFF可以将地图系列导出为单个文件每个地图页导出一个也可以导出为包含所有指定地图页的单个多页或多图像文件。对于所有其他导出格式单独的页面将作为单独的文件导出。
下面以导出多页PDF为例
// 将具有多个页面的地图系列从活动布局导出为单个PDF
var layout LayoutView.Active.Layout;
if (layout null) return;// 设置输出路径
var pdf C:\Users\Administrator\Desktop\States.pdf;
if (File.Exists(pdf)) { File.Delete(pdf); }// 设置导出的PDF图片格式
var exportFormat new PDFFormat()
{OutputFileName pdf,Resolution 300,DoCompressVectorGraphics true,DoEmbedFonts true,HasGeoRefInfo true,ImageCompression ImageCompression.Adaptive,ImageQuality ImageQuality.Better,LayersAndAttributes LayersAndAttributes.LayersAndAttributes
};// // 设置地图系列的导出方式
var mapSeriesExportOptions new MapSeriesExportOptions()
{// 导出内容包括【All, Current, SelectedIndexFeatures】ExportPages ExportPages.Custom,CustomPages 1-3,// 导出单个PDF也可以按名称导出多个PDFExportFileOptions ExportFileOptions.ExportAsSinglePDF,
};// 检查路径是否有效导出PDF
if (exportFormat.ValidateOutputFilePath())
{layout.Export(exportFormat, mapSeriesExportOptions);
}