GeocodeAddress() 공개 메소드

Calls bing maps api to geocode address specified in string parametr.
public GeocodeAddress ( string address, EventHandler handler ) : void
address string
handler EventHandler
리턴 void
예제 #1
0
        private void ComputeDirections_Click(object sender, RoutedEventArgs e)
        {
            //hide the directions panel
            DirectionsPanel.Visibility = System.Windows.Visibility.Collapsed;

            string address = String.Empty;

            //if the address does not contain the name of the city, we will add it
            if (!this.AddressTextBox.Text.Contains(CurrentCity.Name))
            {
                address = String.Format("{0},{1}", this.AddressTextBox.Text, CurrentCity.Name);
            }
            else
            {
                address = this.AddressTextBox.Text;
            }


            //call the geocode
            if (_currentState == BikeInCity.State.Directions)
            {
                _serviceCaller.GeocodeAddress(address, GeocodeForDirectionsCompleted);
            }
            else
            {
                _serviceCaller.GeocodeAddress(address, GeocodeForStationsCompleted);
            }
        }