///
<summary>
///
画跟踪线
///
</summary>
///
<param name="color">
线颜色
</param>
///
<param name="size">
线宽度
</param>
///
<param name="linestyle">
线样式
</param>
///
<param name="history_gps">
GPS数据集合
</param>
private Feature DrawTraceLine(
uint color,
int size,
int linestyle, GPS_MSG_GPSDATA_RESP[] history_gps)
{
if (history_gps.Length <=
1)
return
null;
Points linePts =
new PointsClass();
//
标记点集合
for (
int i =
0; i < history_gps.Length; i++)
//
遍历gps数据集合
{
MapXLib.Point linePt =
new PointClass();
//
新建标记点
linePt.Set(history_gps[i].Longitude, history_gps[i].Latitude);
//
设置标记点的坐标
linePts.Add(linePt, i +
1);
//
将标记点添加到集合中
}
Style style =
new StyleClass();
style.LineWidth = (
short)size;
style.LineColor = color;
style.LineStyle = (PenStyleConstants)linestyle;
//
设置线的样式
Feature lineObj =
this._mapObject.FeatureFactory.CreateLine(linePts, style);
//
生成线的图元
//
lineObj = this._mapObject.Layers.AnimationLayer.AddFeature(lineObj, Type.Missing);
return lineObj;
}