private void AddRouteMarkerFromGhostMarker(GhostPoint ghostPoint, GMapRoute route) { var routeMarker = new RoutePointMarker(ghostPoint.Marker.Position, ghostPoint.IndexPoint, route); //_routeMarkers.Remove(ghostPoint.Marker); _routeMarkers.Insert(ghostPoint.IndexPoint, routeMarker); _routeOverlay.Markers.Add(routeMarker); route.Points.Insert(ghostPoint.IndexPoint, routeMarker.Position); //RemoveGhostPointAt(ghostPoint.IndexPoint , route); for (int i = ghostPoint.IndexPoint + 1; i < _routeMarkers.Count; i++) { if (IsGhostPointExistForIndex(_routeMarkers[i].RoutePointIndex, route)) { GetGhostPointForIndex(_routeMarkers[i].RoutePointIndex, route).SetIndexPoint(i); } ((RoutePointMarker)_routeMarkers[i]).SetRouteIndex(i); } //for (int i = ghostPoint.IndexPoint + 1; i < _ghostPointDictionary[route].Count; i++) //{ // _ghostPointDictionary[route][i].SetIndexPoint(i + 1); //} _selectedMarker = routeMarker; //CreateGhostPoint(ghostPoint.IndexPoint-1, routeMarker.Position, route); }
private GMap.NET.PointLatLng CreateGhostPoint(int index, GMap.NET.PointLatLng point, GMapRoute route) { GhostMarker g = new GhostMarker(point); _routeOverlay.Markers.Add(g); GhostPoint ghostPoint = new GhostPoint(index, g); if (_ghostPointDictionary.ContainsKey(route) == false) { _ghostPointDictionary.Add(route, new List<GhostPoint>()); } _ghostPointDictionary[route].Add(ghostPoint); return point; }