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. 十种MYSQL显错注入原理讲解(二)

    上一篇讲过,三种MYSQL显错注入原理.下面我继续讲解. 1.geometrycollection() and geometrycollection((select * from(select * f ...

  2. 前端开发--评论区抓bug

    1. 工程地址:https://github.com/digitalClass/web_page 网站发布地址: http://115.28.30.25:8029/ ppt展示页面: http://1 ...

  3. 0036 Java学习笔记-多线程-创建线程的三种方式

    创建线程 创建线程的三种方式: 继承java.lang.Thread 实现java.lang.Runnable接口 实现java.util.concurrent.Callable接口 所有的线程对象都 ...

  4. java设计模式之建造者模式

    学习了设计模式,一直感觉有进步又没有进步,与同学.同事探讨了一下.变化不可能一会就可以的,需要努力坚持.不管进步大小,也不管是否进步,做到勿忘初心,做自己喜欢的事情就好.还有几个设计模式一直没有写,原 ...

  5. canvas贝塞尔曲线 - 1

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvEAAAIcCAIAAADwgGbqAAAgAElEQVR4nOy9a4wb55nn20kOZhq7o8

  6. chrome快捷键

    常用的为: Ctrl + ]   下一个面板 Ctrl + [   上一个面板 Ctrl + Alt + [ 去上一个历史记录的面板Ctrl + Alt + ]      去下一个历史记录的面板 Ct ...

  7. [LeetCode] Contains Duplicate III 包含重复值之三

    Given an array of integers, find out whether there are two distinct indices i and j in the array suc ...

  8. [LeetCode] Gray Code 格雷码

    The gray code is a binary numeral system where two successive values differ in only one bit. Given a ...

  9. JavaScript中实现extend()方法

    var male = { sex: "male" }; var xiaoming = { name: "xiaoming", school: "xin ...

  10. Bootstap datetimepicker报错TypeError: intermediate value

    Bootstrap datetimepicker有多个版本,官方的链接中,只是datepicker,没有时间的选择,原版的datetimepicker也不再更新,不能用新版的jquery.现在http ...