public SearchResult(MobileSrc.Services.GeocodeServices.GeocodeResult result, double lat, double lon)
        {
            this.Result      = result;
            this.DisplayName = result.DisplayName;

            this.Distance        = Utils.CalculateDistance(result.Locations[0].Latitude, result.Locations[0].Longitude, lat, lon) * 0.62137119;
            this.DisplayDistance = string.Format("{0:0.00} miles", this.Distance);
        }
Exemple #2
0
        public static RouteLocation CreateRouteLocation(MobileSrc.Services.GeocodeServices.GeocodeResult result)
        {
            RouteLocation routeLoc = new RouteLocation();

            routeLoc.Location           = new GpsLocation();
            routeLoc.Location.Latitude  = result.Locations[0].Latitude;
            routeLoc.Location.Longitude = result.Locations[0].Longitude;
            routeLoc.Location.Altitude  = result.Locations[0].Altitude;

            routeLoc.Address = result.Address.FormattedAddress;

            return(routeLoc);
        }
 void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = (listBox.SelectedIndex >= 0);
     SelectedGeocodeResult = ((SearchResult)listBox.SelectedItem).Result;
 }