Example #1
0
        private async Task <List <Result> > QueryGoogleGeocoderAsync(string inputAddress)
        {
            var geocoder = new GoogleGeocoder();

            geocoder.GeocodeAddress(inputAddress);
            var geocodedLocation = await geocoder.GetJsonObjectFromGeocodeResultAsync();

            Status.Text = geocodedLocation.status;

            List <Result> foundLocations = new List <Result>();

            if (geocodedLocation.status != "REQUEST_DENIED" && geocodedLocation.results.Any())
            {
                foundLocations = geocodedLocation.results;                 // This is horrid, but for now...
                //foundLocation.IsValid = true;
                foreach (var result in foundLocations)
                {
                    result.IsValid = true;
                }
            }
            return(foundLocations);
        }