private PathGeometry BuildGeoLine(SuperMap.WindowsPhone.Core.GeoLine geoLine)
{
PathGeometry geometry = new PathGeometry();
Rectangle2D bounds = geoLine.Bounds;
if (!Rectangle2D.IsNullOrEmpty(bounds))
{
Point topLeft = this.MapPointToScreen(new Point2D(bounds.Left, bounds.Top));
foreach (Point2DCollection points in geoLine.Parts)
{
if (points.Count >= 2)
{
PathFigure figure = new PathFigure();
Point point = this.MapPointToScreen(points[0]);
point.X -= topLeft.X;
point.Y -= topLeft.Y;
figure.StartPoint = point;
for (int i = 1; i < points.Count; i++)
{
point = this.MapPointToScreen(points[i]);
point.X -= topLeft.X;
point.Y -= topLeft.Y;
figure.Segments.Add(new LineSegment { Point = point });
}
geometry.Figures.Add(figure);
}
}
}
geometry.Transform = new ScaleTransform();
return geometry;
}