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(); } }
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(); } }