Updating Weather Data Properties
Hello Everyone
I have tried to alter the Weather forecast API tutorial to get current weather data and write it to some thing properties instead of an infotable. I'm doing this so that I can log it against some other data. Currently when i run my script i get back NaN in the properties. My code is below
var stringLocation=me.Location+" ";
var arrayLocations=stringLocation.split(",");
var lat=arrayLocations[0];
var long=arrayLocations[1];
var params = {
url: "http://api.openweathermap.org/data/2.5/weather?lat="+lat+"&lon="+long+"&units=metric&type=accurate&mode=xml&APPID=4abc8a3c9f101ccf9c7cfe7cbf3dfed7" /* STRING */,
timeout: 160 /* NUMBER */
};
// result:
var xmlPage = Resources["ContentLoaderFunctions"].LoadXML(params);
me.WindDirection = xmlPage.current.wind.direction.@name;
me.WindSpeed=xmlPage.current.wind.speed.@value;
me.WeatherTemp=parseInt(xmlPage.current.temperature.@value);
me.WeatherHumidity=parseFloat(xmlPage.current.humidity.@value);
me.WeatherTime = xmlPage.current.lastupdate.@value;
me.Title=xmlPage.current.city.@name+" "+xmlPage.city.country;
me.Precipitation=(xmlPage.current.precipitation.@mode);
I'm not sure if it is correct and am new to javascript and API calls
Any help will be greatly appreciated.
Thanks Matt

