Пример #1
0
        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();
        }
Пример #2
0
        public void PrintDetails()
        {
            Location    location = new Location("New York");
            WeatherData wm       = WeatherMap.Instance();

            checked { wm.PrintDetails(); } // checks that function initialized
        }
Пример #3
0
        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;
        }
Пример #5
0
        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);
        }
Пример #6
0
 private void OnEnable()
 {
     weatherMap = (WeatherMap)target;
 }
Пример #7
0
 void OnEnable()
 {
     weather = (WeatherMap)target;
 }