示例#1
0
        /// <summary>
        /// Make Open Weather API Call to get location coordinates
        /// </summary>
        public async Task SearchLocations()
        {
            LocationResponse LR = await OpenWeather.LocationSearch(SearchText);

            SearchResults.Clear();

            foreach (var L in LR.Locations)
            {
                var LocationVM = new Location()
                {
                    Name    = L.Name,
                    Country = L.Country,
                    Lon     = L.Coordinate.Lon,
                    Lat     = L.Coordinate.Lat
                };

                SearchResults.Add(LocationVM);
            }
        }