MapXtreme+C#添加标注
2009-04-15 10:57
204 查看
public static void ShowLabelLayer(string tableName, string columnName) { MapInfo.Mapping.Map map = MapInfo.Engine.Session.Current.MapFactory[0]; //新建标注图层 LabelLayer labelLayer = new LabelLayer(); map.Layers.Add(labelLayer); //指定要标注的数据表 LabelSource labelSource = new LabelSource(MapInfo.Engine.Session.Current.Catalog.GetTable((tableName))); labelLayer.Sources.Append(labelSource); //指定要标注字段所在的列 labelSource.DefaultLabelProperties.Caption = columnName; //标注样式等属性 labelSource.DefaultLabelProperties.Visibility.Enabled = true; labelSource.DefaultLabelProperties.Visibility.VisibleRangeEnabled = true; labelSource.DefaultLabelProperties.Visibility.VisibleRange = new VisibleRange(0.01, 10, MapInfo.Geometry.DistanceUnit.Mile); labelSource.DefaultLabelProperties.Visibility.AllowDuplicates = true; labelSource.DefaultLabelProperties.Visibility.AllowOutOfView = true; labelSource.DefaultLabelProperties.Visibility.AllowOverlap = true; labelSource.Maximum = 50; labelSource.DefaultLabelProperties.Layout.UseRelativeOrientation = true; labelSource.DefaultLabelProperties.Layout.RelativeOrientation = MapInfo.Text.RelativeOrientation.FollowPath; labelSource.DefaultLabelProperties.Layout.Angle = 33.0; labelSource.DefaultLabelProperties.Priority.Major = "index"; labelSource.DefaultLabelProperties.Layout.Offset = 7;//偏移量 labelSource.DefaultLabelProperties.Style.Font.TextEffect = MapInfo.Styles.TextEffect.Box;//标注背景,BOX为方框 labelSource.DefaultLabelProperties.Layout.Alignment = MapInfo.Text.Alignment.BottomRight; Font font = new Font("黑体", 10); font.ForeColor = System.Drawing.Color.DarkBlue; labelSource.DefaultLabelProperties.Style.Font = font; }
相关文章推荐
- MapXtreme 2005学习(4):添加标注图层
- MapXtreme 图层操作 创建临时图层-添加图元-加图层标注-清除图元
- AE+C# 向AxPageLayoutControl添加自定义标注
- C# 如何给现有/新建PDF文档添加注释或标注
- supermap学习系列(七)——用户自己在地图上添加点、线、面标注
- C#添加Windows服务 定时任务
- c#把程序添加到IE工具条栏上
- 史上最全的CSS hack方式一览 jQuery 图片轮播的代码分离 JQuery中的动画 C#中Trim()、TrimStart()、TrimEnd()的用法 marquee 标签的使用详情 js鼠标事件 js添加遮罩层 页面上通过地址栏传值时出现乱码的两种解决方法 ref和out的区别在c#中 总结
- mapxtreme开发小结2(c#)
- C#拒绝添加重复信息与关闭提示
- c#asp.net添加/修改/删除Cookie值
- 比较核心的技术了 虚拟ip的一种实现方式(手工添加和C#添加)
- c#(winform)中ComboBox和ListBox添加项完全解决
- 给c#添加SetTimeout和SetInterval函数(.NET Framework 3.5 System.Action命名空间)
- C# 如何向Excel添加、删除表单控件
- C# Session添加、删除封装类
- 为notepad++添加g++编译器编译objc/c/c++/C#
- 利用OpenCV给图像添加中文标注
- C#采用OpenXml实现给word文档添加文字
- LinQ To SQL 添加、删除、更新C#