private void wegpunktBearbeitenToolStripMenuItem_Click(object sender, EventArgs e) { int index = ((int)this.lastmarker.Tag); Navigation.EditWayPoint frm = new Navigation.EditWayPoint(666, WayPoints[index].IsAbsolute);; // frm.IsAbsolute = WayPoints[index].IsAbsolute; if (frm.IsAbsolute) { frm.Altitude = Convert.ToInt32(WayPoints[index].Altitude); } else { frm.Altitude = Convert.ToInt32(WayPoints[index].AltitudeAGL); } if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsAbsolute) { WayPoints[index].Altitude = frm.Altitude; } else { WayPoints[index].AltitudeAGL = frm.Altitude; } WayPoints[index].IsAbsolute = frm.IsAbsolute; this.gMapControl1.UpdateMarkerLocalPosition(lastmarker); Markers_CollectionChanged(null, null); } }
private GMap.NET.PointLatLng CreateWayPoint(GMap.NET.PointLatLng point) { frm = new Navigation.EditWayPoint(1200, true); if (frm.Altitude == 0) { if (frm.ShowDialog() == DialogResult.Abort) { return(new GMap.NET.PointLatLng()); } } route.Points.Add(point); UAVCommons.Navigation.WayPoint wpoint = new UAVCommons.Navigation.WayPoint(); wpoint.Longitude = point.Lng; wpoint.Latitude = point.Lat; string altstring = " ("; altstring += frm.Altitude; wpoint.IsAbsolute = frm.IsAbsolute; if (frm.IsAbsolute) { wpoint.Altitude = frm.Altitude; altstring += "M"; wpoint.AltitudeAGL = 0; } else { wpoint.AltitudeAGL = frm.Altitude; wpoint.Altitude = 0; altstring += "M AGL"; } altstring += ")"; WayPoints.Add(wpoint); GMapMarker mymarker = new GMapMarkerGoogleRed(point); mymarker.Tag = route.Points.Count - 1; mymarker.ToolTipMode = MarkerTooltipMode.Always; mymarker.ToolTipText = "Wegpunkt " + Convert.ToString(route.Points.Count) + altstring; overlay.Markers.Add(mymarker); route.Overlay.IsVisibile = true; route.IsVisible = true; gMapControl1.UpdateRouteLocalPosition(route); gMapControl1.UpdateMarkerLocalPosition(mymarker); return(point); }
private void wegpunktBearbeitenToolStripMenuItem_Click(object sender, EventArgs e) { int index = ((int)this.lastmarker.Tag); Navigation.EditWayPoint frm = new Navigation.EditWayPoint(666,WayPoints[index].IsAbsolute);; // frm.IsAbsolute = WayPoints[index].IsAbsolute; if (frm.IsAbsolute) { frm.Altitude = Convert.ToInt32(WayPoints[index].Altitude); } else { frm.Altitude = Convert.ToInt32(WayPoints[index].AltitudeAGL); } if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsAbsolute){ WayPoints[index].Altitude = frm.Altitude; }else{ WayPoints[index].AltitudeAGL = frm.Altitude; } WayPoints[index].IsAbsolute = frm.IsAbsolute; this.gMapControl1.UpdateMarkerLocalPosition(lastmarker); Markers_CollectionChanged(null, null); } }
private GMap.NET.PointLatLng CreateWayPoint(GMap.NET.PointLatLng point) { frm = new Navigation.EditWayPoint(1200, true); if (frm.Altitude == 0) { if (frm.ShowDialog() == DialogResult.Abort) return new GMap.NET.PointLatLng(); } route.Points.Add(point); UAVCommons.Navigation.WayPoint wpoint = new UAVCommons.Navigation.WayPoint(); wpoint.Longitude = point.Lng; wpoint.Latitude = point.Lat; string altstring = " ("; altstring += frm.Altitude; wpoint.IsAbsolute = frm.IsAbsolute; if (frm.IsAbsolute) { wpoint.Altitude = frm.Altitude; altstring += "M"; wpoint.AltitudeAGL = 0; } else { wpoint.AltitudeAGL = frm.Altitude; wpoint.Altitude = 0; altstring+= "M AGL"; } altstring += ")"; WayPoints.Add(wpoint); GMapMarker mymarker = new GMapMarkerGoogleRed(point); mymarker.Tag = route.Points.Count - 1; mymarker.ToolTipMode = MarkerTooltipMode.Always; mymarker.ToolTipText = "Wegpunkt " + Convert.ToString(route.Points.Count) + altstring; overlay.Markers.Add(mymarker); route.Overlay.IsVisibile = true; route.IsVisible = true; gMapControl1.UpdateRouteLocalPosition(route); gMapControl1.UpdateMarkerLocalPosition(mymarker); return point; }