如何给等值线做标注Arcgis for sl
2013-08-15 17:30
495 查看
这里只给出标注部分的代码:
foreach (ShapeFileRecord record in shapeFileReader.Records)
{
Graphic graphic = record.ToGraphic();
if (graphic != null)
{
int index = 0;
for (int i = 0; i < Config.level.Split(',').Length; i++)
{
if (graphic.Attributes["mark"].ToString() == Config.level.Split(',')[i])
{
index = i;
break;
}
}
graphic.Symbol = new SimpleLineSymbol()
{
Color = new SolidColorBrush(colors[0]),
Style = SimpleLineSymbol.LineStyle.Solid,
Width = 2
};
#region 等值线添加标注
ESRI.ArcGIS.Client.Geometry.Polyline pLine = graphic.Geometry as ESRI.ArcGIS.Client.Geometry.Polyline;
ESRI.ArcGIS.Client.Geometry.PointCollection pCollection = pLine.Paths[0];
//添加文字信息
TextSymbol textSymbol = new TextSymbol()
{
FontFamily = new System.Windows.Media.FontFamily("Microsoft YaHei"),
Foreground = new System.Windows.Media.SolidColorBrush(Color.FromArgb(255, 0, 0, 255)),
FontSize = 12,
Text = Config.level.Split(',')[index]
};
ESRI.ArcGIS.Client.Geometry.MapPoint mpStart = pCollection[0];
Graphic graphicTextStart = new Graphic()
{
Geometry = mpStart,
Symbol = textSymbol
};
DZXMBiaoZhuLayer.Graphics.Add(graphicTextStart);
ESRI.ArcGIS.Client.Geometry.MapPoint mpEnd = pCollection[pCollection.Count - 1];
Graphic graphicTextEnd = new Graphic()
{
Geometry = mpEnd,
Symbol = textSymbol
};
DZXMBiaoZhuLayer.Graphics.Add(graphicTextEnd);
#endregion
}
DZXMLayer.Graphics.Add(graphic);
}
foreach (ShapeFileRecord record in shapeFileReader.Records)
{
Graphic graphic = record.ToGraphic();
if (graphic != null)
{
int index = 0;
for (int i = 0; i < Config.level.Split(',').Length; i++)
{
if (graphic.Attributes["mark"].ToString() == Config.level.Split(',')[i])
{
index = i;
break;
}
}
graphic.Symbol = new SimpleLineSymbol()
{
Color = new SolidColorBrush(colors[0]),
Style = SimpleLineSymbol.LineStyle.Solid,
Width = 2
};
#region 等值线添加标注
ESRI.ArcGIS.Client.Geometry.Polyline pLine = graphic.Geometry as ESRI.ArcGIS.Client.Geometry.Polyline;
ESRI.ArcGIS.Client.Geometry.PointCollection pCollection = pLine.Paths[0];
//添加文字信息
TextSymbol textSymbol = new TextSymbol()
{
FontFamily = new System.Windows.Media.FontFamily("Microsoft YaHei"),
Foreground = new System.Windows.Media.SolidColorBrush(Color.FromArgb(255, 0, 0, 255)),
FontSize = 12,
Text = Config.level.Split(',')[index]
};
ESRI.ArcGIS.Client.Geometry.MapPoint mpStart = pCollection[0];
Graphic graphicTextStart = new Graphic()
{
Geometry = mpStart,
Symbol = textSymbol
};
DZXMBiaoZhuLayer.Graphics.Add(graphicTextStart);
ESRI.ArcGIS.Client.Geometry.MapPoint mpEnd = pCollection[pCollection.Count - 1];
Graphic graphicTextEnd = new Graphic()
{
Geometry = mpEnd,
Symbol = textSymbol
};
DZXMBiaoZhuLayer.Graphics.Add(graphicTextEnd);
#endregion
}
DZXMLayer.Graphics.Add(graphic);
}
相关文章推荐
- 已知经纬度坐标,如何在地方坐标系下的地图上展示轨迹Arcgis for sl
- 如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题
- 如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题
- 《ArcGIS Runtime SDK for Android开发笔记》——问题集:如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题(转载)
- 《ArcGIS Runtime SDK for Android开发笔记》——问题集:如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题(转载)
- arcgis for flex api version3.7 教程:3.如何使用QueryTask查询地图服务
- ArcGIS API for JavaScript——给图层添加标注
- ArcGIS 10.1 for Server 如何使用10或者之前的切片
- ArcGIS API for Silverlight之Web Mapping开发:根据图层属性查询、定位、高亮显示并显示标注(2)
- 如何更改ArcGIS 10.1 for Server的端口号
- ArcGIS Api for javaScript 4.6 实现将一个标注显示在地图上
- ArcGIS Runtime SDK for iOS开发系列教程(4)——如何让你的iOS应用具有GIS能力
- arcgis for js文本标注背景设置
- arcgis for js如何画台风风圈
- Arcgis API for Silverlight如何加载天地图底图以及地方坐标系的偏门底图
- ArcGIS API for JavaScript在地图上添加一个标注图标
- ArcGIS API For JavaScript 利用GP服务生成等值线、等值面(二)之生成等值面
- arcgis api for flex 设置 TextSymbol 竖排字 道路标注
- ArcGIS for Android 10.1.1API 中文标注导致程序异常崩溃问题
- 【ArcGIS for JavaScript】加载地图,并标注点