MapXtreme2004代码 简单专题图的显示
2005-01-20 12:13
676 查看
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
说明:这只是个简单的例子,对于不同的地图文件,具体代码有所不同,要修改一些地方。
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
说明:这只是个简单的例子,对于不同的地图文件,具体代码有所不同,要修改一些地方。
相关文章推荐
- MapXtreme2004代码 MapControl控件中显示地图文件
- MapXtreme2004代码 搜索特定图元并将其显示到地图上
- MapXtreme2004代码 搜索特定图元并将其显示到地图上
- MapXtreme2004代码 读取TAB表中的元素
- 简单几步在eclipse集成环境中代码显示行号
- mapxtreme2004经典代码之一:添加几何对象
- MapXtreme2004代码 在地图上新增加点图元
- MapXtreme2004代码 读取TAB表中的元素
- jQuery判断元素是否显示 是否隐藏的简单实现代码
- Java Web 简单的分页显示实例代码
- vueJS简单的点击显示与隐藏的效果【实现代码】
- 简单asp分页显示代码
- 详细介绍附代码:使用jquery,和php文件构建一个简单的在线聊天室,通过ip显示googlemap
- 从MapX到MapXtreme2004[10]-根据zoom值修改显示范围
- 显示服务器时间的在线时钟代码简单
- jQuery判断元素是否显示 是否隐藏的简单实现代码
- JavaScript实时时间显示的最简单代码
- Java Web 简单的分页显示实例代码
- 最简单的全日制时间显示,代码非常简单-时间日期特效
- MapXtreme2004代码 几个地图工具的使用(C#)