예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Text                    = "Store Finder";
            gMap.MapProvider             = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            var geocoder = new Geocoder.GeocodeService();
            var location = geocoder.GeocodeLocation("Palo Alto, CA");

            centerMap(location);
            markerOverlay = new GMap.NET.WindowsForms.GMapOverlay(gMap, "markers");
            gMap.Overlays.Add(markerOverlay);
        }
예제 #2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string address = "";

            if (txtStreetAddress.Text != "" && txtCity.Text != "" && txtState.Text != "")
            {
                address = txtStreetAddress.Text + "," + txtCity.Text + "," + txtState.Text;
            }
            else if (txtCity.Text != "" && txtState.Text != "")
            {
                address = txtCity.Text + "," + txtState.Text;
            }
            else if (txtZip.Text != "")
            {
                address = txtZip.Text;
            }

            if (address == "")
            {
                MessageBox.Show("Enter a valid address, city, or zip code");
            }
            else
            {
                var geocoder = new Geocoder.GeocodeService();
                var location = geocoder.GeocodeLocation(address);
                storeList.Items.Clear();
                txtStoreDetails.Text = "";
                markerOverlay.Markers.Clear();
                centerMap(location);
                markCurrentLocation(location);
                stores = findStores();
                for (int i = 0; i < stores.Count; i++)
                {
                    markStoreLocation(stores[i]);
                }
                addStoresToList();
            }
        }
예제 #3
0
파일: Form1.cs 프로젝트: xiongtec/usergrid
        private void btnSubmit_Click(object sender, EventArgs e)
        {

            string address = "";
            if (txtStreetAddress.Text != "" && txtCity.Text != "" && txtState.Text != "") { address = txtStreetAddress.Text + "," + txtCity.Text + "," + txtState.Text; }
            else if (txtCity.Text != "" && txtState.Text != ""){ address = txtCity.Text + "," + txtState.Text;}
            else if (txtZip.Text != "") { address = txtZip.Text; }

            if (address == "") { MessageBox.Show("Enter a valid address, city, or zip code");}
            else {
                var geocoder = new Geocoder.GeocodeService();
                var location = geocoder.GeocodeLocation(address);
                storeList.Items.Clear();
                txtStoreDetails.Text = "";
                markerOverlay.Markers.Clear(); 
                centerMap(location); 
                markCurrentLocation(location);
                stores = findStores();
                for (int i = 0; i < stores.Count; i++) { markStoreLocation(stores[i]); }
                addStoresToList();

            }
            
        }
예제 #4
0
파일: Form1.cs 프로젝트: xiongtec/usergrid
 private void Form1_Load(object sender, EventArgs e)
 {
     this.Text = "Store Finder";
     gMap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
     GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
     var geocoder = new Geocoder.GeocodeService();
     var location = geocoder.GeocodeLocation("Palo Alto, CA");
     centerMap(location);
     markerOverlay = new GMap.NET.WindowsForms.GMapOverlay(gMap, "markers");
     gMap.Overlays.Add(markerOverlay);
 }