Exemplo n.º 1
0
 private void SaveGpxButton_Click(object sender, RoutedEventArgs e)
 {
     e.Handled = true;
     if (GpxUtils.SaveGpxDialog(out string gpxFileName) == System.Windows.Forms.DialogResult.OK)
     {
         GpxUtils.SaveGpxCoordinates(route, gpxFileName);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// load GPX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void load_gpx_button_Click(object sender, RoutedEventArgs e)
        {
            if (GpxUtils.OpenGpxDlg(out string gpxFileName) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            if (gpxFileName == null || gpxFileName.Length == 0)
            {
                return;
            }

            var newRoute = GpxUtils.ReadGpxCoords(gpxFileName);

            route.Clear();
            foreach (Location loc in newRoute)
            {
                route.Add(loc);
            }

            navigator.SetRoute(route);
            uiMgr.SetRoute(route);
            myMap.Center = route[0];
        }