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. scrollToItemAtIndexPath: atScrollPosition: animated:

    oh my god 今天死在scrollToItemAtIndexPath: atScrollPosition: animated:方法上面,scrollPosition这个参数控制cell具体停留在 ...

  2. Google C++单元测试框架GoogleTest---AdvancedGuide(译文)下

    因为AdvancedGuide文档太长,分上下两部分,本文档接googletest--AdvancedGuide(译文)上:Google C++单元测试框架GoogleTest---AdvancedG ...

  3. Android多媒体框架图

    Android多媒体整体架构图 MediaPlayer框架图 Camera框架图 SoundRecorder框架图 VideoCamera框架图 OpenCore与Skia ALSA Audio框架图 ...

  4. OuNews 简单的新闻客户端应用源码

    一直想练习MVP模式开发应用,把学习的RxJava.Retrofit等热门的开源库结合起来,于是写了这么一款新闻阅读软件, 有新闻.图片.视频三大模块,使用Retrofit和Okhttp实现无网读缓存 ...

  5. the request resource is not available

    form表单递交数据的问题 我的解决方法 将要访问的servlet地址写入form的action中 例如:访问地址为http://localhost:8080/Webprojectselfservic ...

  6. Spark核心——RDD

    Spark中最核心的概念为RDD(Resilient Distributed DataSets)中文为:弹性分布式数据集,RDD为对分布式内存对象的 抽象它表示一个被分区不可变且能并行操作的数据集:R ...

  7. [OFC]Mellanox发布首个200Gb/s硅光子设备

    [OFC]Mellanox发布首个200Gb/s硅光子设备 讯石光通讯网   发布时间:2016/4/6 8:18:20   编者:iccsz   点击143次     摘要:Mellanox日前在O ...

  8. SCNU 2015ACM新生赛初赛【1006. 3D打印】解题报告

            题目链接详见SCNU 2015新生网络赛 1006. 3D打印 .出题思路来自codevs 3288. 积木大赛,属于模拟题.         首先我们把“选择从第L部分到第R部分”理 ...

  9. 【GSM】GTM900C的应用——短信

    虽说GSM已经很老旧,但其低廉的价格,非常适合一些需要小数据上网传输和短信等功能的应用场合. 不知道GSM能否像51单片机一样,在低端应用中长久不衰.GTM900C发送短信,支持两种模式,TXT和PD ...

  10. BZOJ 2705: [SDOI2012]Longge的问题 [欧拉函数]

    2705: [SDOI2012]Longge的问题 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 2553  Solved: 1565[Submit][ ...