gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
阅读:997回复:0

MapXtreme2004代码(简单专题图的显示)

楼主#
更多 发布于:2005-06-29 13:54
MapControl1.Map.Clear();<br>MapGeosetLoader gl=new MapGeosetLoader(@"F:\test.gst");<br>MapControl1.Map.Load(gl);<br>//打开地图<br><br>MapControl1.Map.Load(new MapTableLoader(@"F:\test.tab"));<br>//打开test.tab地图文件<br><br>FeatureLayer lyrPnt=MapControl1.Map.Layers["test"] as FeatureLayer;<br>RangedTheme thm = new RangedTheme(lyrPnt,"PH__1999","ph",3,DistributionMethod.EqualCountPerRange);<br>lyrPnt.Modifiers.Insert(0,thm);<br>//定义一个RangedTheme<br><br>ThemeLegendFrame frame = LegendFrameFactory.CreateThemeLegendFrame("PH__1999","pp",thm);<br><br>Legend legend = MapControl1.Map.Legends.CreateLegend(new Size(5,5));<br>legend.Frames.Append(frame);<br>//定义一个Legend<br><br>//MapControl1.Map.Adornments.Append(legend);<br>//如果保留此句,MapControl1中将显示Legend<br><br>LegendControl1.Map = MapControl1.Map;<br>if (MapControl1.Map.Legends.Count > 0) <br>{<br>LegendControl1.Legend = MapControl1.Map.Legends[0];<br>}<br>//在LegendControl1控件中显示Legend<br><br>说明:这只是个简单的例子,对于不同的地图文件,具体代码有所不同,要修改一些地方。<br><br>
[此贴子已经被作者于2005-6-29 13:56:11编辑过]
喜欢0 评分0
GIS麦田守望者,期待与您交流。
游客

返回顶部