Пример #1
0
        private void buttonPlotLocation_Click(object sender, EventArgs e)
        {
            string GPSLocation = dataGridView1.Rows[m_CurrentRowIndex].Cells["GPSLocation"].Value.ToString();

            if (GPSLocation.Length < 5)
            {
                MessageBox.Show("No location found");
                return;
            }

            string gpsTest = GPSLocation.ToLower();

            if (gpsTest.Contains("unknown"))
            {
                MessageBox.Show("No location found");
                return;
            }

            gpsTest = GPSLocation.ToLower();
            if (gpsTest.Contains("no position"))
            {
                MessageBox.Show("No location found");
                return;
            }

            string mapURL = UserSettings.Get(UserSettingTags.GPSMAPURL);

            if (mapURL == null)
            {
                mapURL = "http://maps.google.com/maps?q=";
            }

            mapURL = mapURL + GPSLocation;

            if (m_Plotter == null)
            {
                m_Plotter = new WebPlotLocation(mapURL);
                m_Plotter.Show();
            }
            else if (!m_Plotter.Visible)
            {
                m_Plotter = null;
                m_Plotter = new WebPlotLocation(mapURL);
                m_Plotter.Show();
            }
            else
            {
                m_Plotter.SetNewURL(mapURL);
            }
        }
Пример #2
0
        private void buttonPlotLocation_Click(object sender, EventArgs e)
        {
            string GPSLocation = dataGridView1.Rows[m_CurrentRowIndex].Cells["GPSLocation"].Value.ToString();

            if (GPSLocation.Length < 5)
            {
                MessageBox.Show("No location found");
                return;
            }

            string gpsTest = GPSLocation.ToLower();

            if (gpsTest.Contains("unknown"))
            {
                MessageBox.Show("No location found");
                return;
            }

            gpsTest = GPSLocation.ToLower();
            if (gpsTest.Contains("no position") )
            {
                MessageBox.Show("No location found");
                return;
            }

            string mapURL = UserSettings.Get(UserSettingTags.GPSMAPURL);
            if (mapURL == null)
                mapURL = "http://maps.google.com/maps?q=";

            mapURL = mapURL + GPSLocation;

            if (m_Plotter == null)
            {
                m_Plotter = new WebPlotLocation(mapURL);
                m_Plotter.Show();
            }
            else if (!m_Plotter.Visible)
            {
                m_Plotter = null;
                m_Plotter = new WebPlotLocation(mapURL);
                m_Plotter.Show();
            }
            else
            {
                m_Plotter.SetNewURL(mapURL);
            }
        }