Drawing Route in WPF

Sep 18, 2009 at 8:07 AM

Hi

Cool Control in Windows Presentation.

I'v tried to draw a Route with 55 Points. All seams ok, but i don't see the Route.

The Map Control is on a Dialog Form.

code:

//Center Map

if (rteDef.RoutePoints.Count > 0)

{

PointLatLng pt = new PointLatLng(rteDef.RoutePoints[0].Latitude, rteDef.RoutePoints[0].Longitude);

MainMap.CurrentPosition = pt;

}

//Draw the route

List<PointLatLng> lst = new List<PointLatLng>();

foreach (RoutePoints rtP in rteDef.RoutePoints)

{

lst.Add(new PointLatLng(rtP.Latitude, rtP.Longitude));

}

var localPath = new List<System.Windows.Point>();

var offset = MainMap.FromLatLngToLocal(lst[0]);

foreach (var i in lst)

{

var p = MainMap.FromLatLngToLocal(new PointLatLng(i.Lat, i.Lng));

localPath.Add(new System.Windows.Point(p.X - offset.X, p.Y - offset.Y));

}

Brush before = new SolidColorBrush(Colors.Black);

 

this.shape = MainMap.CreateRoutePath(localPath);

if (before != null)

{

(this.shape as Path).Stroke = before;

}

<font size="2" color="#008000"><font size="2" color="#008000">

 

</font></font><font size="2" color="#008000">

 

</font>

 

Why i don't see the Route on the Map?

Thanks

 

Coordinator
Sep 18, 2009 at 9:37 AM

why you don't see demos source ;}