コード例 #1
0
 /// <summary>
 /// Gets the current weather based on latitude and longitude. This operation is synchronous.
 ///
 /// https://openweathermap.org/current
 /// </summary>
 /// <param name="latitude"></param>
 /// <param name="longitude"></param>
 /// <returns></returns>
 public static ICurrentWeather GetCurrentWeather(double latitude, double longitude)
 {
     return(OpenWeatherMap.GetCurrentWeather(new Coordinate {
         Latitude = latitude, Longitude = longitude
     }));
 }
コード例 #2
0
 /// <summary>
 /// Gets the current weather based on latitude and longitude. This operation is asyncronous,
 /// requires a callback to get the result.
 ///
 /// https://openweathermap.org/current
 /// </summary>
 /// <param name="latitude"></param>
 /// <param name="longitude"></param>
 /// <param name="callback">Callback that will receive the a weather object.</param>
 public static void GetCurrentWeatherAsync(double latitude, double longitude, System.Action <IResponse> callback)
 {
     OpenWeatherMap.GetCurrentWeatherAsync(new Coordinate {
         Latitude = latitude, Longitude = longitude
     }, callback);
 }