public GridUI(GridPlugin plugin) { this.plugin = plugin; InitializeComponent(); map.MapProvider = plugin.Host.FDMapType; layerpolygons = new GMapOverlay("polygons"); map.Overlays.Add(layerpolygons); CMB_startfrom.DataSource = Enum.GetNames(typeof(Utilities.Grid.StartPosition)); CMB_startfrom.SelectedIndex = 0; // set and angle that is good list = new List <PointLatLngAlt>(); plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); }); var area = calcpolygonarea(plugin.Host.FPDrawnPolygon.Points); if (area > 10000) { NUM_Distance.Value = (int)Math.Sqrt(area) / 10; NUM_spacing.Value = (int)Math.Sqrt(area) / 10; } NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360); // Map Events map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter); map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave); map.MouseUp += new MouseEventHandler(map_MouseUp); map.MouseDown += new System.Windows.Forms.MouseEventHandler(this.map_MouseDown); map.MouseMove += new System.Windows.Forms.MouseEventHandler(this.map_MouseMove); }
// List<PointLatLng> listpoly = new List<PointLatLng>(); public GridUI(GridPlugin plugin) { this.plugin = plugin; InitializeComponent(); map.MapProvider = plugin.Host.FDMapType; layerpolygons = new GMapOverlay("polygons"); map.Overlays.Add(layerpolygons); kmlpolygonsoverlay = new GMapOverlay("kmlpolygons"); map.Overlays.Add(kmlpolygonsoverlay); CMB_startfrom.DataSource = Enum.GetNames(typeof(Utilities.Grid.StartPosition)); CMB_startfrom.SelectedIndex = 0; // set and angle that is good list = new List <PointLatLngAlt>(); plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); //listpoly.Add(x); }); NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360); map.ZoomAndCenterMarkers("polygons");//缩放到多边形 // Map Events map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter); map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave); map.MouseUp += new MouseEventHandler(map_MouseUp); map.MouseDown += new System.Windows.Forms.MouseEventHandler(this.map_MouseDown); map.MouseMove += new System.Windows.Forms.MouseEventHandler(this.map_MouseMove); foreach (var temp in FlightData.kmlpolygons.Polygons) { kmlpolygonsoverlay.Polygons.Add(new GMapPolygon(temp.Points, "") { Fill = Brushes.Transparent }); } foreach (var temp in FlightData.kmlpolygons.Routes) { kmlpolygonsoverlay.Routes.Add(new GMapRoute(temp.Points, "")); } xmlcamera(false, Settings.GetRunningDirectory() + "camerasBuiltin.xml"); xmlcamera(false, Settings.GetUserDataDirectory() + "cameras.xml"); }
public GridUI(GridPlugin plugin) { this.plugin = plugin; InitializeComponent(); map.MapProvider = plugin.Host.FDMapType; layerpolygons = new GMapOverlay( "polygons"); map.Overlays.Add(layerpolygons); CMB_startfrom.DataSource = Enum.GetNames(typeof(Grid.StartPosition)); CMB_startfrom.SelectedIndex = 0; // set and angle that is good List<PointLatLngAlt> list = new List<PointLatLngAlt>(); plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); }); NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360); }
public GridUI(GridPlugin plugin) { this.plugin = plugin; InitializeComponent(); map.MapProvider = plugin.Host.FDMapType; layerpolygons = new GMapOverlay("polygons"); map.Overlays.Add(layerpolygons); CMB_startfrom.DataSource = Enum.GetNames(typeof(Grid.StartPosition)); CMB_startfrom.SelectedIndex = 0; // set and angle that is good List <PointLatLngAlt> list = new List <PointLatLngAlt>(); plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); }); NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360); }