private void NextCurier_Click(object sender, EventArgs e)//maintain switching between routes { StepOverlay.Clear(); RouteOverlay.Clear(); CurrentRoutes.Clear(); CurrentSteps.Clear(); stepcounter = 0; routecounter = 0; if (allroutescounter == AllRoutes.Count) { allroutescounter = 0; curier_text.Text = "Nothing selected"; return; } curier_text.Text = AllRoutes[allroutescounter].Item2; CurrentRoutes = new List <DelivererRoute>(AllRoutes[allroutescounter].Item1); allroutescounter++; }
private void Next_route_click(object sender, EventArgs e)//maintain switching between routes { RouteOverlay.Clear(); if (routecounter == CurrentRoutes.Count) { StepOverlay.Clear(); CurrentSteps.Clear(); if (allroutescounter != 0) { curier_text.Text = AllRoutes[allroutescounter - 1].Item2; } stepcounter = 0; routecounter = 0; return; } StepOverlay.Clear(); CurrentSteps.Clear(); stepcounter = 0; curier_text.Text = AllRoutes[allroutescounter - 1].Item2 + ": route " + (routecounter + 1).ToString(); for (int i = 0; i < CurrentRoutes[routecounter].route.Count - 1; i++) { List <LandPoint> temp = new List <LandPoint>(); temp.Add(CurrentRoutes[routecounter].route[i]); temp.Add(CurrentRoutes[routecounter].route[i + 1]); CurrentSteps.Add(temp); } for (int i = 1; i < CurrentRoutes[routecounter].route.Count; i++) { var route = GoogleMapProvider.Instance.GetRoute(CurrentRoutes[routecounter].route[i - 1].coordinates, CurrentRoutes[routecounter].route[i].coordinates, false, true, 10); GMapRoute gMapRoute = new GMapRoute(route.Points, i.ToString()) { Stroke = new Pen(Color.Blue, 3) }; GMarkerGoogle temp = new GMarkerGoogle(CurrentRoutes[routecounter].route[i - 1].coordinates, GMarkerGoogleType.blue); temp.ToolTip = new GMap.NET.WindowsForms.ToolTips.GMapRoundedToolTip(temp); temp.ToolTipText = CurrentRoutes[routecounter].route[i - 1].adress + CurrentRoutes[routecounter].Tooltips[i - 1]; BuildRoute(gMapRoute, temp); } routecounter++; }