LayoutSelection objLytSelect = m_MapLayoutControl.MapLayout.Selection;//.Selection;
//LayoutSelection objLytSelect = m_MapLayoutControl.MapLayout.HitTest(;
int num =objLytSelect.Count;
if (objLytSelect.Count == )
{
int getID = objLytSelect[];//获取选择集的id
LayoutElements layElemetn = m_MapLayoutControl.MapLayout.Elements; //获取布局所有元素
layElemetn.SeekID(getID);//查找选择的id对应的对象
Geometry objGeometry = layElemetn.GetGeometry(); //对象的基类。该类是一个抽象类。提供一些基本的几何类型的属性与方法
if (objGeometry.Type == GeometryType.GeoLegend) //判断选择是否是图例对象
{
GeoLegend objGeoLegend = objGeometry as GeoLegend;
GeoCompound objGeoCompound = objGeoLegend.InnerGeometry;//InnerGeometry 获取图例包含的复合几何对象(GeoCompound)。
Geometry [] sq= objGeoCompound.Divide(false);//分解复合几何对象,复合几何对象的结构类似于树状结构, 如果分解时只分解顶层对象, 则返回的几何对象仍然可能存在复合几何对象,否则将不含有复合几何对象。
m_MapLayoutControl.MapLayout.Elements.Delete(new int[] { getID }); //删除选择的图例对象 为以后单独添加去重
for (int i = ; i < sq.Length; i++)
{
m_MapLayoutControl.MapLayout.Elements.AddNew(sq[i]); //把拆分的对象重新添加到布局中
}
m_MapLayoutControl.MapLayout.Refresh(); //刷新
objGeoLegend.Dispose();
objGeoCompound.Dispose();
}
else
{
MessageBox.Show("请选择图例对象!", "提示");
objLytSelect.Dispose();// = null;
return;
} }
else
{
MessageBox.Show("请单独选择图例对象!", "提示");
objLytSelect.Dispose();
return;
}

图例拆分

  try
{
LayoutElements layoutElements = m_MapLayoutControl.MapLayout.Elements;
if (GetMapID() < ) return;
layoutElements.SeekID(GetMapID()); //根据图例中地图的id进行查找获取地图对象
GeoMap geoMap = (GeoMap)layoutElements.GetGeometry();
string geoMapName = geoMap.MapName; GeoLegend geoLegend = new GeoLegend(geoMapName, m_workspace); geoLegend.Height = ;
geoLegend.Width = ;
geoLegend.Center = new Point2D(, ); GeoStyle geoLegendStyle = new GeoStyle();
geoLegendStyle.FillForeColor = Color.FromArgb(, , );
geoLegendStyle.FillOpaqueRate = ;
geoLegendStyle.LineWidth = 0.5;
geoLegendStyle.LineColor = Color.FromArgb(, , );
geoLegend.BackGroundStyle = geoLegendStyle;
geoLegend.ColumnCount = ; //设置图例项和图例子项的说明文本的风格
TextStyle geoLegendtextStyle = new TextStyle();
geoLegendtextStyle.BackColor = Color.Yellow;
geoLegendtextStyle.ForeColor = Color.Blue;
geoLegendtextStyle.FontName = "宋体";
geoLegendtextStyle.FontHeight = 20.0;
geoLegendtextStyle.FontWidth = 12.0;
geoLegendtextStyle.IsSizeFixed = false;
geoLegend.ItemTextStyle = geoLegendtextStyle;
geoLegend.SubItemTextStyle = geoLegendtextStyle; //设置图例标题风格
TextStyle titleTextStyle = new TextStyle();
titleTextStyle.BackColor = Color.Yellow;
titleTextStyle.ForeColor = Color.Blue;
titleTextStyle.FontName = "宋体";
titleTextStyle.FontHeight = 40.0;
titleTextStyle.FontWidth = 25.0;
titleTextStyle.Italic = true;
titleTextStyle.Bold = true;
titleTextStyle.IsSizeFixed = false;
titleTextStyle.Weight = ;
geoLegend.Title = "图例";
geoLegend.TitleStyle = titleTextStyle; //将图例添加到布局图层,而非屏幕图层。
geoLegend.Load(false);
m_MapLayoutControl.MapLayout.Elements.AddNew(geoLegend);
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}

添加图例

supermap iobect .net 7.1.2 图例的拆分的更多相关文章

  1. supermap布局设定地图网格及布局网格

    地图网格设定 LayoutElements elements = m_mapLayoutControl.MapLayout.Elements; //构造GeoMap GeoMap geoMap = n ...

  2. ArcGIS与SuperMap的使用比较(1)

    用了超过6年的超图产品了,因此对超图的很多特性比较熟悉,去年开始接触ARCGIS,并用来研发了一些新产品,因此对于两个GIS平台有些感受,记录如下: 比较版本:ARCGIS10.1与SuperMap ...

  3. SuperMap空间数据处理与制图操作短视频汇总

    转自:http://blog.csdn.net/supermapsupport/article/details/70227669 空间数据处理与制图是GIS系统建设最基础的部分,这里利用超图桌面软件- ...

  4. SuperMap iClient for JavaScript 新手入门

    地理信息系统(英语:Geographic Information System,缩写:GIS)是一门综合性学科,结合地理学与地图学,已经广泛的应用在不同的领域,是用于输入.存储.查询.分析和显示地理数 ...

  5. Supermap iCloudManager -负载均衡

    Supermap icm负载均衡理解: 应用场景:地图出图 子节点1和子节点2中的服务保持一致,一般情况下设置的是匿名用户通过nginx访问服务信息,所以不需要登录. 1.通过nginx分发请求,(轮 ...

  6. (十九)WebGIS中I查询的原理及设计(包含AGS、GeoServer、Supermap)

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 我们在使用arcmap时,经常会用到被称为I查询的工具.具体 ...

  7. SuperMap iServer 扩展服务及扩展服务提供者范例

    一.扩展服务实例 1.将iserver-extend1下的listener.java打成jar包2.复制到D:\SuperMap-iServer\webapps\iserver\WEB-INF\lib ...

  8. supermap iclient for js 标签专题图(服务端)

    <!DOCTYPE><html> <head> <meta http-equiv="Content-Type" content=" ...

  9. SuperMap iClient 7C——网络客户端GIS开发平台 产品新特性

    SuperMap iClient 7C是空间信息和服务的可视化交互开发平台,是SuperMap服务器系列产品的统一客户端.产品基于统一的架构体系,面向Web端和移动端提供了多种类型的SDK开发包,帮助 ...

随机推荐

  1. 时间戳TimeStamp处理

     我获得这个时间戳是得想除以1000再处理的,看看你们的需要先除多少再处理 //时间戳处理 NSInteger time = timeStamp / 1000; NSNumber *timer = [ ...

  2. React Native FlexBox

    FlexBox 是React Native布局的一种算法,目的是为了适配不同尺寸的屏幕而设计的. 使用时最关键的就是flex关键字的用法. flex用于修饰当前View在父视图中的占比. 占比如何计算 ...

  3. android清除本应用里的各种数据的方法

    public class DataCleanManager { /** * * 清除本应用内部缓存(/data/data/com.xxx.xxx/cache) * * * * @param conte ...

  4. IOS开发基础知识碎片-导航

    1:IOS开发基础知识--碎片1 a:NSString与NSInteger的互换 b:Objective-c中集合里面不能存放基础类型,比如int string float等,只能把它们转化成对象才可 ...

  5. IOS 杂笔-11(实现在外部无法改变UIView的size)

    我想题目说的或许不是很清楚,那么现在我详细介绍一下这篇随笔内容. 在外部无法改变UIVIew控件的size. 这里说是UIView,但是事实上,是大多数控件而绝非仅UIView. 想要实现在外部无法改 ...

  6. Linux系统sar命令解析

    安装 如果系统没有该命令请安装: apt-get install sysstat yum install sysstat 安装完毕: vi /etc/default/sysstat ENABLED=& ...

  7. C#初步应用

    首先,此次编程是第一次尝试结对编程,我的结对对象博客园地址:http://www.cnblogs.com/cbb111/ 他的源代码链接:https://coding.net/u/cao1417146 ...

  8. 常见的高可用MySQL解决方案

    MySQL数据库作为最基础的数据存储服务之一,在整个系统中有着非常重要的地位,因此要求其具备高可用性是无可厚非的.有很多解决方案能实现不同的SLA(服务水平协定),这些方案可以保证数据库服务器在硬件或 ...

  9. heredoc技术

    Heredoc技术,在正规的PHP文档中和技术书籍中一般没有详细讲述,只是提到了这是一种Perl风格的字符串输出技术.但是现在的一些论坛程序,和部分文章系统,都巧妙的使用heredoc技术,来部分的实 ...

  10. 如何给SVG填充和描边应用线性渐变

    给SVG元素应用填充和描边有三种方法(戳这里学习SVG填充和描边的相关内容).你可以使用纯色.图案或渐变.前面两种方法我们之前已经讲过了,现在我们来讨论第三种方法——渐变. SVG提供了两种渐变——线 ...