This is my code.
What i want?
I want draw route between point (routePoint)
exactly i want draw line between 1-2 point, then 2-3 etc
where i make error (mistake)
private void button1_Click_1(object sender, EventArgs e)
What i want?
I want draw route between point (routePoint)
exactly i want draw line between 1-2 point, then 2-3 etc
where i make error (mistake)
private void button1_Click_1(object sender, EventArgs e)
{
List<PointLatLng> routePoint = new List<PointLatLng>();
for (int i = 1; i < dostupno.zaTransformacijuImeTacke.Count + 1; i++)
{
MapRoute route = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute(
new PointLatLng(dostupno.Latituda[i], dostupno.Longituda[i]), new PointLatLng(dostupno.Latituda[i], dostupno.Longituda[i])
, false, false, 15);
//tackeRute.Add(dostupno.Latituda[i], dostupno.Longituda[i]);
gMapControl1.Position = new PointLatLng(dostupno.Latituda[i], dostupno.Longituda[i]);
routePoint.Add(gMapControl1.Position);
GMapRoute r = new GMapRoute(route.Points, "My route");
GMapOverlay routesOverlay = new GMapOverlay("My route");
routesOverlay.Routes.Add(r);
gMapControl1.Overlays.Add(routesOverlay);
r.Stroke.Width = 10;
r.Stroke.Color = Color.SeaGreen;
}
}