Ejemplo n.º 1
0
 private void OnGeoCodeRequestCompleted(GeoCodeRequestCompletedEventArgs e)
 {
     if (LocateAddressCompleted != null)
         LocateAddressCompleted(e);
 }
Ejemplo n.º 2
0
        private void Client_GeoCodeCompleted(object sender, GeocodeCompletedEventArgs e)
        {
            GeoCodeRequestCompletedEventArgs args = null;

            if (e.Result.ResponseSummary.StatusCode == GeocodeService.ResponseStatusCode.Success && e.Result.Results.Count > 0)
            {
                args = new GeoCodeRequestCompletedEventArgs();

                args.DisplayName = e.Result.Results[0].DisplayName;
                args.Address = e.Result.Results[0].Address.FormattedAddress;
                args.BestView = e.Result.Results[0].BestView;

                foreach (var loc in e.Result.Results[0].Locations)
                {
                    args.Locations.Add(new Location(loc.Latitude, loc.Longitude, loc.Altitude));
                }
            }

            OnGeoCodeRequestCompleted(args);
        }