private void TestRoute() { Core.FileManager.OpenGPSFilesManager fileManager = new Core.FileManager.OpenGPSFilesManager(); var file = fileManager.GetFile(@"C:\Users\Public\Documents\GPX\538211.gpx"); _routeOverlay.IsVisibile = true; navigationalMapControl1.Overlays.Add(_routeOverlay); if (file.Tracks.Count > 0) { Core.NavigationElements.Services service = new Core.NavigationElements.Services(); _tempTrack = service.TrackSimplifier(file.Tracks[0]); navigationalMapControl1.DrawTrack(_tempTrack, true); List <GMapRoute> routes = navigationalMapControl1.GetRoute(_tempTrack); foreach (GMapRoute route in routes) { for (int i = 0; i < route.Points.Count; i++) { var marker = new RoutePointMarker(route.Points[i], i, route); marker.IsVisible = true; _routeMarkers.Add(marker); _routeOverlay.Markers.Add(marker); } } } }
private void TestRoute() { Core.FileManager.OpenGPSFilesManager fileManager = new Core.FileManager.OpenGPSFilesManager(); var file = fileManager.GetFile(@"C:\Users\Public\Documents\GPX\538211.gpx"); _routeOverlay.IsVisibile = true; navigationalMapControl1.Overlays.Add(_routeOverlay); if (file.Tracks.Count > 0) { Core.NavigationElements.Services service = new Core.NavigationElements.Services(); _tempTrack = service.TrackSimplifier(file.Tracks[0]); navigationalMapControl1.DrawTrack(_tempTrack, true); List<GMapRoute> routes = navigationalMapControl1.GetRoute(_tempTrack); foreach (GMapRoute route in routes) { for (int i = 0; i < route.Points.Count; i++) { var marker = new RoutePointMarker(route.Points[i], i, route); marker.IsVisible = true; _routeMarkers.Add(marker); _routeOverlay.Markers.Add(marker); } } } }
private void FileManagerItemClicked(object sender, EventArgs e) { if (_selectedFileManagerItem != null) { _selectedFileManagerItem.BackColor = _selectedFileManagerItem.DefaultBackgroundColor; foreach (Core.NavigationElements.ITrack track in _selectedFileManagerItem.File.Tracks) { navigationalMapControl1.RemoveTrack(track); } } _selectedFileManagerItem = sender as FileManagerItem; _selectedFileManagerItem.BackColor = SystemColors.GradientActiveCaption; foreach (Core.NavigationElements.ITrack track in _selectedFileManagerItem.File.Tracks) { Core.NavigationElements.Services s = new Core.NavigationElements.Services(); var newTrack = s.TrackSimplifier(track); navigationalMapControl1.DrawTrack(newTrack, true); } }