地图几何对象边框类。用来为地图几何对象添加各种样式的边框。
命名空间:
SuperMap.Data程序集: SuperMap.Data (in SuperMap.Data)
版本: dll
语法
C# |
---|
public class GeoMapBorder : Geometry, IDisposable |
备注
地图几何对象的边框样式可以是无边框样式、单线边框样式以及复杂边框样式,如下四幅图简单例举了几种风格的地图几何对象的边框。有关地图几何对象的边框类型的详细信息请参见GeoMapBorderType枚举类。
无边框
单线边框
双线边框
带花纹的边框
示例
以下代码示例了如何添加地图几何对象到布局,并设置其边框。
假设打开一个工作空间 workspace对象。
CopyC#
public void GeoMapBorderExample(Workspace workspace) { //获取工作空间中的地图 Map map = new Map(workspace); map.Open(workspace.Maps[0]); //构造二维几何对象,设置中心点(500,500),宽度(1000),高度(1000) GeoRectangle geoRectangle = new GeoRectangle(new Point2D(500, 500), 1000, 1000, 0); //通过name和二维几何对象构造地图几何对象 GeoMap geoMap = new GeoMap(); geoMap.MapName = map.Name; geoMap.Shape = geoRectangle; //设置地图几何对象边框 GeoMapBorder geoMapBorder = new GeoMapBorder(); geoMapBorder.BorderType = GeoMapBorderType.Complex; //内框 geoMapBorder.InFrameColor = Color.Silver; geoMapBorder.InFrameWidth = 8; geoMapBorder.InFrameInterval = 50; GeoStyle geoStyle1 = new GeoStyle(); geoStyle1.FillSymbolID = 37; //资源库中线符号 geoMapBorder.InFrameStyle = geoStyle1; //外框 geoMapBorder.OutFrameColor = Color.Brown; geoMapBorder.OutFrameWidth = 15; geoMapBorder.OutFrameInterval = 40; //内线 geoMapBorder.InLineColor = Color.YellowGreen; geoMapBorder.InLineWidth = 8; geoMapBorder.InLineInterval = 30; //外线 geoMapBorder.OutLineColor = Color.Pink; geoMapBorder.OutLineWidth = 5; geoMapBorder.OutLineInterval = 10; //填充文本 geoMapBorder.FillType = GeoMapBorderFillType.Text; geoMapBorder.FillText = "SuperMap"; //填充转角图片 geoMapBorder.CornerFillType = GeoMapBorderFillType.Image; geoMapBorder.FillImageFile = "D:\\SampleCode\\direction.bmp"; geoMapBorder.CornerFillStartMode = CornerFillStartMode.LeftBottom; geoMapBorder.FillDirection = FillDirectionType.Inner; geoMap.MapBorder = geoMapBorder; //将地图几何对象添加到布局元素集合中 MapLayoutControl mapLayoutControl = new MapLayoutControl(); MapLayout mapLayout = mapLayoutControl.MapLayout; mapLayout.Workspace = workspace; mapLayout.Elements.AddNew(geoMap); //显示布局窗口 this.Controls.Add(mapLayoutControl); mapLayoutControl.Dock = DockStyle.Fill; }