物探论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 432|回复: 0

MapXtreme2004代码 简单专题图的显示

[复制链接]
发表于 2013-3-13 20:51:26 | 显示全部楼层 |阅读模式
MapControl1.Map.Clear();

MapGeosetLoader gl=new MapGeosetLoader(@"F:\test.gst");

MapControl1.Map.Load(gl);

//打开地图

MapControl1.Map.Load(new MapTableLoader(@"F:\test.tab"));

//打开test.tab地图文件

FeatureLayer lyrPnt=MapControl1.Map.Layers["test"] as FeatureLayer;

RangedTheme thm = new RangedTheme(lyrPnt,"PH__1999","ph",3,DistributionMethod.EqualCountPerRange);
lyrPnt.Modifiers.Insert(0,thm);



//定义一个RangedTheme


ThemeLegendFrame frame = LegendFrameFactory.CreateThemeLegendFrame("PH__1999","pp",thm);

Legend legend = MapControl1.Map.Legends.CreateLegend(new Size(5,5));

legend.Frames.Append(frame);

//定义一个Legend

//MapControl1.Map.Adornments.Append(legend);


//如果保留此句,MapControl1中将显示Legend


LegendControl1.Map = MapControl1.Map;

if (MapControl1.Map.Legends.Count > 0)

{

LegendControl1.Legend = MapControl1.Map.Legends[0];

}

//在LegendControl1控件中显示Legend

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|物探论坛 ( 鄂ICP备12002012号 微信号:iwutan )

GMT+8, 2024-5-13 09:37 , Processed in 0.118794 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表