IMap.AddLayers Method

本文介绍了AddLayers方法的使用,此方法将IEnumLayer枚举中的所有图层添加到地图中,并通过autoArrange参数控制图层的顺序。若为TRUE,则根据ILayerPosition::LayerWeight指定的权重自动排序图层,默认情况下按图层类型排序:标注层位于顶部,依次为点层、线层和面层。此外,还介绍了该方法如何设置地图的空间参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[C#]
public void AddLayers (
     IEnumLayer Layers,
     bool autoArrange
);
The AddLayers method adds all of the layers in the IEnumLayer enumeration to the Map. Use the LayerCount property to get the total number of layers in the map. The autoArrange parameter controls the ordering of the layers.  If autoArrange is set to TRUE, the layers are added in the proper position as by their weight specified via ILayerPosition::LayerWeight.  By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.  If autoArrange is true for this method, the position passed in is ignored as the position is determined by the auto arrange logic.
AddLayers automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are additionally set.  AddLayers also sets the spatial reference for each layer ( ILayer::SpatialReference). 
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
The full extent is recalculated each time a layer added.

 

autoArrange参数控制着图层的顺序.如果参数是TRUE,则图层按照 ILayerPosition::LayerWeight指定的weight把图层添加倒适当的位置.

默认情况下,图层是按照图层类型来排序的.标注层在嘴上,下面是点层,线层,最下面是面层

 

Provides access to members that control a layer's default position in the map interface

The LayerWeight property defines the weight of the layer in the auto arrange order.   During auto arrange, the higher weight layers are added to the map first, which means they draw lower in the draw order.

higher weight layers先被添加到地图中,这意味着它们后画.


Default weights for layers are these values:
Annotation layers = 97
Points layers = 98
Polyline layers = 99
Polygon Layers = 100

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值