private void trackZoom_ValueChanged(object sender, EventArgs e) { IPosition66 ipos = sgworld.Window.CenterPixelToWorld().Position; double x, y, z, dir; //var cPos = sgworld.Navigate.GetPosition(AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE); double meters; double dist; CRailwayLine crwline = gRWScene.mMiddleLines.getMeterbyPos(marker.Position.Lng, marker.Position.Lat, out meters, out dist); gRWScene.mMiddleLines.getPosbyDKCode(crwline.mDKCode, meters, out x, out y, out z, out dir); double dis = Math.Pow(10, trackZoom.Value + 1); if (trackZoom.Value == 5) { dis = dis / 2; } IPosition66 dPos = sgworld.Creator.CreatePosition(x, y, 0, AltitudeTypeCode.ATC_TERRAIN_RELATIVE, dir, -70, 0, dis); //CRailwayScene.mMiddleLine.findNearestPos(cPos); sgworld.Navigate.FlyTo(dPos); //double t = (double)(trackZoom.Value - trackZoom.Minimum) / (trackZoom.Maximum - trackZoom.Minimum); //int t2 = (int)((eTime.DayOfYear - sTime.DayOfYear) * t); //DateTime dt = sTime.AddDays(t2); //trackZoom.Tooltip = dt.ToString(); //sgworld.DateTime.Current = dt; //trackZoom.ShowToolTip(); }
private void gMapControl1_MouseDoubleClick(object sender, MouseEventArgs e) { marker.Position = gMapControl1.FromLocalToLatLng(e.X, e.Y); double x, y, z, dir; //var cPos = sgworld.Navigate.GetPosition(AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE); double meters; double dis; CRailwayLine crwline = gRWScene.mMiddleLines.getMeterbyPos(marker.Position.Lng, marker.Position.Lat, out meters, out dis); gRWScene.mMiddleLines.getPosbyDKCode(crwline.mDKCode, meters, out x, out y, out z, out dir); IPosition66 dPos = sgworld.Creator.CreatePosition(x, y, z, AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE, dir, -70, 0, 1500); //CRailwayScene.mMiddleLine.findNearestPos(cPos); sgworld.Navigate.FlyTo(dPos); }