Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            MapFormParams LeoPass = new MapFormParams();
            //LeoPass.longitude = 37.9641;
            //LeoPass.latitude = 23.5660;
            double LeoPasslongitude, LeoPasslatitude;
            int    Leoradius;

            double.TryParse(textBox2.Text.ToString().Trim(), out LeoPasslongitude);
            double.TryParse(textBox1.Text.ToString().Trim(), out LeoPasslatitude);
            int.TryParse(textBox3.Text.ToString().Trim(), out Leoradius);
            LeoPass.longitude = LeoPasslongitude;
            LeoPass.latitude  = LeoPasslatitude;
            LeoPass.radius    = Leoradius;
            LeoPass.apiKey    = "AIzaSyCxAKDi4ZgokHWCYK_5sQ8Dg-nlcLT2myo";

            //string dbFilePath = "StationGeoData.db";
            //SQLiteConnectionStringBuilder aaa = new SQLiteConnectionStringBuilder();
            //aaa.DataSource = dbFilePath;
            //LeoPass.connectionString = aaa.ConnectionString;

            LeoPass.connectionString = "Data Source=StationGeoData.db";
            //string dbFile = Application.StartupPath + "\\DBs\\StationGeoData.db";
            //string myconnectionString = "Data Source=" + dbFile + ";Version=3;";
            //LeoPass.connectionString = myconnectionString;

            //StationInterop Leo = new StationInterop();
            //Maps.Form2 tex = new Maps.Form2(23.5660, 37.9641, 500, Leo);
            // Old using Interop Maps.Form2 tex = new Maps.Form2(37.9561, 23.6890, 10, Leo);
            Maps.Form2 tex = new Maps.Form2(LeoPass);
            tex.ShowDialog();
            //tex.GleoPass.address

            MessageBox.Show(tex.GleoPass.address + " " + tex.GleoPass.name + " " + tex.GleoPass.brand_id.ToString() + " " + tex.GleoPass.id.ToString());
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            MapFormParams LeoPass = new MapFormParams();

            LeoPass.longitude = 0;
            LeoPass.latitude  = 0;
            LeoPass.radius    = 50;
            LeoPass.apiKey    = "AIzaSyCxAKDi4ZgokHWCYK_5sQ8Dg-nlcLT2myo";

            LeoPass.connectionString = "Data Source=StationGeoData.db";

            int StationId;

            int.TryParse(textBox4.Text.ToString().Trim(), out StationId);

            Maps.Form2 tex = new Maps.Form2(LeoPass, StationId);
            tex.ShowDialog();
            //tex.GleoPass.address

            MessageBox.Show(tex.GleoPass.address + " " + tex.GleoPass.name + " " + tex.GleoPass.brand_id.ToString() + " " + tex.GleoPass.id.ToString());
        }