supermap iobect .net 7.1.2 图例的拆分
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 图例的拆分的更多相关文章
- supermap布局设定地图网格及布局网格
地图网格设定 LayoutElements elements = m_mapLayoutControl.MapLayout.Elements; //构造GeoMap GeoMap geoMap = n ...
- ArcGIS与SuperMap的使用比较(1)
用了超过6年的超图产品了,因此对超图的很多特性比较熟悉,去年开始接触ARCGIS,并用来研发了一些新产品,因此对于两个GIS平台有些感受,记录如下: 比较版本:ARCGIS10.1与SuperMap ...
- SuperMap空间数据处理与制图操作短视频汇总
转自:http://blog.csdn.net/supermapsupport/article/details/70227669 空间数据处理与制图是GIS系统建设最基础的部分,这里利用超图桌面软件- ...
- SuperMap iClient for JavaScript 新手入门
地理信息系统(英语:Geographic Information System,缩写:GIS)是一门综合性学科,结合地理学与地图学,已经广泛的应用在不同的领域,是用于输入.存储.查询.分析和显示地理数 ...
- Supermap iCloudManager -负载均衡
Supermap icm负载均衡理解: 应用场景:地图出图 子节点1和子节点2中的服务保持一致,一般情况下设置的是匿名用户通过nginx访问服务信息,所以不需要登录. 1.通过nginx分发请求,(轮 ...
- (十九)WebGIS中I查询的原理及设计(包含AGS、GeoServer、Supermap)
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 我们在使用arcmap时,经常会用到被称为I查询的工具.具体 ...
- SuperMap iServer 扩展服务及扩展服务提供者范例
一.扩展服务实例 1.将iserver-extend1下的listener.java打成jar包2.复制到D:\SuperMap-iServer\webapps\iserver\WEB-INF\lib ...
- supermap iclient for js 标签专题图(服务端)
<!DOCTYPE><html> <head> <meta http-equiv="Content-Type" content=" ...
- SuperMap iClient 7C——网络客户端GIS开发平台 产品新特性
SuperMap iClient 7C是空间信息和服务的可视化交互开发平台,是SuperMap服务器系列产品的统一客户端.产品基于统一的架构体系,面向Web端和移动端提供了多种类型的SDK开发包,帮助 ...
随机推荐
- Atitit mac os 版本 新特性 attilax大总结
Atitit mac os 版本 新特性 attilax大总结 1. Macos概述1 2. 早期2 2.1. Macintosh OS (系统 1.0) 1984年2 2.2. Mac OS 7. ...
- 苹果的MDM简介
MDM(Mobile Device Management)移动设备管理,一般会用于企业管理其移动设备,鉴于iOS是比较封闭的系统很多的功能都难以实现,所以利用苹果的MDM可以达到远程控制设备,像远程定 ...
- HotApp小程序统计,第一个专业的微信第三方小程序统计工具
1.什么是HotApp小程序统计 HotApp小程序统计是第一个微信第三方小程序统计工具,就像做android 和 ios开发的人知道友盟统计一样,小程序也需要有个统计工具. 通过这个工具,可以知道小 ...
- 学习sql中的排列组合,在园子里搜着看于是。。。
学习sql中的排列组合,在园子里搜着看,看到篇文章,于是自己(新手)用了最最原始的sql去写出来: --需求----B, C, F, M and S住在一座房子的不同楼层.--B 不住顶层.C 不住底 ...
- Python学习实践-----打印日历
使用python语言实现在控制台打印日历 输入年.月.日 输出对应日历,指定的日数输出为'--' 程序没有做严格的输入验证,故输入整数即可. 以下为没有优化的源码: print_calendar.py ...
- 深入分析JS原型链以及为什么不能在原型链上使用对象
在刚刚接触JS原型链的时候都会接触到一个熟悉的名词:prototype:如果你曾经深入过prototype,你会接触到另一个名词:__proto__(注意:两边各有两条下划线,不是一条).以下将会围绕 ...
- UNITY自带的PACKAGE的UTILITY 里面有一个自带的FPS COUNTER
UNITY自带的PACKAGE的UTILITY 里面有一个自带的FPS COUNTER 可用,但是脚本是保密的?
- 安装ArcGIS Desktop 9.3
本文仅用于学习交流,商业用途请支持正版!转载请注明: http://www.cnblogs.com/mxbs/p/6216865.html 准备: ArcGIS Desktop 9.3.crack_f ...
- heredoc技术
Heredoc技术,在正规的PHP文档中和技术书籍中一般没有详细讲述,只是提到了这是一种Perl风格的字符串输出技术.但是现在的一些论坛程序,和部分文章系统,都巧妙的使用heredoc技术,来部分的实 ...
- mybatis常见易出错
在学习mybatis的过程中,发现了很多错误,这里记录一下,以供后来使用 1,config.xml文件中配置项的顺序: org.apache.ibatis.exceptions.Persistence ...