贡献一个sharpmap,自定义专题地图源码
来源:互联网 发布:标准差计算器软件 编辑:程序博客网 时间:2024/05/16 15:03
专题图代码主体部分
SharpMap.Layers.VectorLayer layerValve;
layerValve = new SharpMap.Layers.VectorLayer("valve", new SharpMap.Data.Providers.ShapeFile("../data/valve.shp"));
layerValve.Style.SymbolOffset = new PointF(20, -35);
map.Layers.Add(layerValve);
SharpMap.Rendering.Thematics.CustomTheme myThemeValve = new SharpMap.Rendering.Thematics.CustomTheme(GetThemeStyleValve);
layerValve.Theme = myThemeValve;
////////////////////////////////////////////////////////
专题图函数为
private static SharpMap.Styles.VectorStyle GetThemeStyleValve(SharpMap.Data.FeatureDataRow row)
{
string strThemeField = row["onoroff"].ToString();
SharpMap.Styles.VectorStyle style = new SharpMap.Styles.VectorStyle();
if (strThemeField != null)
{
if (strThemeField != "" && int.Parse(strThemeField) == 1)
{
style.SymbolScale = 0.4f;
style.Symbol = new Bitmap("../resourcefiles/pipeOn.PNG");
}
else
{
style.SymbolScale = 0.42f;
style.Symbol = new Bitmap("../resourcefiles/pipeOff.PNG");
}
style.SymbolOffset = new PointF(0, -15);
}
style.EnableOutline = true;
return style;
}
SharpMap.Layers.VectorLayer layerValve;
layerValve = new SharpMap.Layers.VectorLayer("valve", new SharpMap.Data.Providers.ShapeFile("../data/valve.shp"));
layerValve.Style.SymbolOffset = new PointF(20, -35);
map.Layers.Add(layerValve);
SharpMap.Rendering.Thematics.CustomTheme myThemeValve = new SharpMap.Rendering.Thematics.CustomTheme(GetThemeStyleValve);
layerValve.Theme = myThemeValve;
////////////////////////////////////////////////////////
专题图函数为
private static SharpMap.Styles.VectorStyle GetThemeStyleValve(SharpMap.Data.FeatureDataRow row)
{
string strThemeField = row["onoroff"].ToString();
SharpMap.Styles.VectorStyle style = new SharpMap.Styles.VectorStyle();
if (strThemeField != null)
{
if (strThemeField != "" && int.Parse(strThemeField) == 1)
{
style.SymbolScale = 0.4f;
style.Symbol = new Bitmap("../resourcefiles/pipeOn.PNG");
}
else
{
style.SymbolScale = 0.42f;
style.Symbol = new Bitmap("../resourcefiles/pipeOff.PNG");
}
style.SymbolOffset = new PointF(0, -15);
}
style.EnableOutline = true;
return style;
}
- 贡献一个sharpmap,自定义专题地图源码
- 一个简单的内存池,源码贡献
- Sharpmap自定义图层
- Sharpmap自定义数据源
- SharpMap源码学习<一>
- SharpMap
- 数据压缩软件源码贡献
- rtems源码贡献步骤
- sharpmap中添加自定义图层
- Sharpmap自定义工具,工具管理类
- 专题地图概述
- 什么是专题地图
- 年末贡献--一个表单验证
- 近百android程序源码贡献
- 近百android程序源码贡献
- 近百android程序源码贡献
- 近百android程序源码贡献
- 近百android程序源码贡献
- 一个GDAL的读写数据例子()应一个网友要求而发,离开GIS,RS行业快两年了,很多感触)
- 如何成为一个优秀的程序员
- 常用MySQL的命令集锦
- HTML(3):IE浏览器编程 - vcmute的专栏 - CSDNBlog
- java 单例模式的实现
- 贡献一个sharpmap,自定义专题地图源码
- 用GDB调试程序1
- 入手佳能24-70mm f/2.8L
- 使用mshtml为页面中的超级链接添加Click事件 - 蜡人张 - 博客园
- 如何个性化设置你的Linux操作系统环境
- 如何与IE浏览的网页内部的控件打交道
- C/C++函数调用方式内幕
- META标签的常见用法
- 告诉你MSN,QQ,网页总掉线该怎么办