public WeatherMapPage(WeatherMapPageModel pageModel) { InitializeComponent(); App.CurrentPage = "weathermap"; this.pageModel = pageModel; Position zipPosition = new Position(Double.Parse(pageModel.Weather.Lat), Double.Parse(pageModel.Weather.Lon)); WeatherMap.MoveToRegion( MapSpan.FromCenterAndRadius(zipPosition, Distance.FromMiles(0.3))); var pin = new Pin { Type = PinType.Place, Position = zipPosition, Label = "Temperature:Wind:Humidity:Visibility", Address = pageModel.Weather.Temperature + ":" + pageModel.Weather.Wind + ":" + pageModel.Weather.Humidity + ":" + pageModel.Weather.Visibility }; pin.Clicked += Pin_Clicked; WeatherMap.Pins.Add(pin); MapWeatherDataToUI(); }
public void PrintDetails() { Location location = new Location("New York"); WeatherData wm = WeatherMap.Instance(); checked { wm.PrintDetails(); } // checks that function initialized }
public void GetWeatherData() { Location location = new Location("New York"); WeatherMap wm = WeatherMap.Instance(); WeatherData wd = wm.GetWeatherData(location); Assert.AreEqual(location.City, wd.Location.City); }
public static void InitializeWeatherMap(this IWeatherManager manager, int weatherSizeX, int weatherSizeY) { var newMap = new WeatherMap(GameManager.Instance.GameTime, weatherSizeX, weatherSizeY); newMap.LoadMap(SystemFileTypes.StarMap, newMap.StarMap.ToList()); newMap.LoadMap(SystemFileTypes.SunMap, newMap.SunMap.ToList()); newMap.LoadMap(SystemFileTypes.MoonMap, newMap.MoonMap.ToList()); newMap.Initialize(); manager.Weather = newMap; }
public WeatherMap RestSharp() { RestClient client = new RestClient(); client.BaseUrl = new Uri("http://api.openweathermap.org/data/2.5/"); RestRequest req = new RestRequest("weather?q=London,uk&appid=44db6a862fba0b067b1930da0d769e98"); IRestResponse <WeatherMap> res = client.Get <WeatherMap>(req); var content = res.Content; WeatherMap wm = new WeatherMap(); wm = res.Data; return(wm); }
private void OnEnable() { weatherMap = (WeatherMap)target; }
void OnEnable() { weather = (WeatherMap)target; }