Example #1
0
 /// <summary>
 /// 遍历地图的所有图层,对图层执行操作
 /// </summary>
 /// <param name="map"></param>
 /// <param name="action">对图层执行的操作</param>
 public static void EnumLayer(this IMap map, Action <ILayer> action)
 {
     for (int i = 0; i < map.LayerCount; i++)
     {
         ILayer layer = map.get_Layer(i);
         if (layer is IGroupLayer)
         {
             layer.EnumLayerInGroupLayer(action);
         }
         else
         {
             action(layer);
         }
     }
 }