예제 #1
0
        private void btnShowDataSources_Click(object sender, EventArgs e)
        {
            Cursor current = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            stations.Markers.Clear();

            //if (_projMgr.SiteInfo.Project != "" || _projMgr.SiteInfo.Project != null)
            //{
            // _projMgr.SiteInfo.Location.Latitude = Convert.ToDouble(textBoxCurrLat.Text.ToString());
            // _projMgr.SiteInfo.Location.Longitude = Convert.ToDouble(textBoxCurrLng.Text.ToString());
            //}

            double minX = MainMap.CurrentViewArea.Left;
            double minY = MainMap.CurrentViewArea.Bottom;
            double maxX = MainMap.CurrentViewArea.Right;
            double maxY = MainMap.CurrentViewArea.Top;

            try
            {
                VBD4EM.D4EMData d4emData = new VBD4EM.D4EMData(minX, minY, maxX, maxY, "gcjjaDgainKJnfefJK");
                //List<VBD4EM.StationInfo> nwisList = null;
                //List<VBD4EM.StationInfo> ncdcList = null;
                List <VBD4EM.StationInfo> list = null;

                VBMarker    stationMarker = null;
                PointLatLng pt;

                if (cbnwis.Checked)
                {
                    list = d4emData.NWISStations();
                    for (int i = 0; i < list.Count; i++)
                    {
                        pt                        = new PointLatLng(list[i].Latitude, list[i].Longitude);
                        stationMarker             = new VBMarker(pt);
                        stationMarker.MarkerImage = new Bitmap(Properties.Resources.USGS);
                        stationMarker.Size        = new System.Drawing.Size(15, 15);
                        System.Drawing.Size size = stationMarker.Size;
                        stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                        stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                        stations.Markers.Add(stationMarker);
                    }
                }
                if (cbncdc.Checked)
                {
                    list = d4emData.NCDCStations();
                    for (int i = 0; i < list.Count; i++)
                    {
                        pt                        = new PointLatLng(list[i].Latitude, list[i].Longitude);
                        stationMarker             = new VBMarker(pt);
                        stationMarker.MarkerImage = new Bitmap(Properties.Resources.NOAA);
                        stationMarker.Size        = new System.Drawing.Size(15, 15);
                        System.Drawing.Size size = stationMarker.Size;
                        stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                        stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                        stations.Markers.Add(stationMarker);
                    }
                }

                //if ((nwisList != null) && (nwisList.Count > 0))
                //    list.AddRange(nwisList);

                //if ((ncdcList != null) && (ncdcList.Count > 0))
                //    list.AddRange(ncdcList);

                //GMapMarkerGoogleGreen stationMarker = null;



                //for (int i = 0; i < list.Count; i++)
                //{

                //    pt = new PointLatLng(list[i].Latitude, list[i].Longitude);
                //    //stationMarker = new GMapMarkerGoogleGreen(pt);
                //    stationMarker = new VBMarker(pt);
                //    stationMarker.MarkerImage = new Bitmap(Properties.Resources.USGS);
                //    stationMarker.Size = new System.Drawing.Size(15, 15);
                //    System.Drawing.Size size = stationMarker.Size;
                //    stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                //    stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                //    stations.Markers.Add(stationMarker);
                //}
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Cursor.Current = current;
        }
예제 #2
0
파일: frmLocation.cs 프로젝트: wrbrooks/VB3
        private void btnShowDataSources_Click(object sender, EventArgs e)
        {
            Cursor current = Cursor.Current;
            Cursor.Current = Cursors.WaitCursor;

            stations.Markers.Clear();

            //if (_projMgr.SiteInfo.Project != "" || _projMgr.SiteInfo.Project != null)
            //{
                // _projMgr.SiteInfo.Location.Latitude = Convert.ToDouble(textBoxCurrLat.Text.ToString());
                // _projMgr.SiteInfo.Location.Longitude = Convert.ToDouble(textBoxCurrLng.Text.ToString());
            //}

            double minX = MainMap.CurrentViewArea.Left;
            double minY = MainMap.CurrentViewArea.Bottom;
            double maxX = MainMap.CurrentViewArea.Right;
            double maxY = MainMap.CurrentViewArea.Top;

            try
            {
                VBD4EM.D4EMData d4emData = new VBD4EM.D4EMData(minX, minY, maxX, maxY, "gcjjaDgainKJnfefJK");
                //List<VBD4EM.StationInfo> nwisList = null;
                //List<VBD4EM.StationInfo> ncdcList = null;
                List<VBD4EM.StationInfo> list = null;

                VBMarker stationMarker = null;
                PointLatLng pt;

                if (cbnwis.Checked)
                {
                    list = d4emData.NWISStations();
                    for (int i = 0; i < list.Count; i++)
                    {
                        pt = new PointLatLng(list[i].Latitude, list[i].Longitude);
                        stationMarker = new VBMarker(pt);
                        stationMarker.MarkerImage = new Bitmap(Properties.Resources.USGS);
                        stationMarker.Size = new System.Drawing.Size(15, 15);
                        System.Drawing.Size size = stationMarker.Size;
                        stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                        stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                        stations.Markers.Add(stationMarker);
                    }
                }
                if (cbncdc.Checked)
                {
                    list = d4emData.NCDCStations();
                    for (int i = 0; i < list.Count; i++)
                    {
                        pt = new PointLatLng(list[i].Latitude, list[i].Longitude);
                        stationMarker = new VBMarker(pt);
                        stationMarker.MarkerImage = new Bitmap(Properties.Resources.NOAA);
                        stationMarker.Size = new System.Drawing.Size(15, 15);
                        System.Drawing.Size size = stationMarker.Size;
                        stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                        stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                        stations.Markers.Add(stationMarker);
                    }
                }

                //if ((nwisList != null) && (nwisList.Count > 0))
                //    list.AddRange(nwisList);

                //if ((ncdcList != null) && (ncdcList.Count > 0))
                //    list.AddRange(ncdcList);

                //GMapMarkerGoogleGreen stationMarker = null;

                //for (int i = 0; i < list.Count; i++)
                //{

                //    pt = new PointLatLng(list[i].Latitude, list[i].Longitude);
                //    //stationMarker = new GMapMarkerGoogleGreen(pt);
                //    stationMarker = new VBMarker(pt);
                //    stationMarker.MarkerImage = new Bitmap(Properties.Resources.USGS);
                //    stationMarker.Size = new System.Drawing.Size(15, 15);
                //    System.Drawing.Size size = stationMarker.Size;
                //    stationMarker.TooltipMode = MarkerTooltipMode.OnMouseOver;
                //    stationMarker.ToolTipText = "Station ID: " + list[i].ID + Environment.NewLine + "Station Name: " + list[i].Name;
                //    stations.Markers.Add(stationMarker);
                //}

            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Cursor.Current = current;
        }