"GetWeatherInformation" Example not working.
Im trying to make this example: Tutorial: Creating a Mashup , I know the Yahoo Weather API doesnt work anymore and that I can use Weather Underground instead as I saw here: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS228421&art_lang=en , Im also using the same code, but when I try to test the service I get this error:
"Unable To Convert From org.mozilla.javascript.UniqueTag to LOCATION"
The code for my service is:
// Need to make a free wunderground.com account to get this key
var apiKey = "{381603bc1002b5ce}";
var temperature;
var humidity;
var LocationIn;
//Inputted location needs to be valid lat, long: 40.7127, 74.0059
if(LocationIn != null){
var test = LocationIn + " ";
var arrayLocations = test.split(",");
var lat = arrayLocations[0];
var long = arrayLocations[1];
var prm = {
url: "http://api.wunderground.com/api/"+apiKey+"/conditions/q/"+lat+","+long+".json",
timeout: 60
};
var json = Resources["ContentLoaderFunctions"].PostJSON(prm);
try {
temperature = parseInt(json.current_observation.temp_f);
humidity = parseInt(json.current_observation.relative_humidity);
me.Temperature = temperature;
me.Humidity = humidity;
result = "Success. Properties are updated.";
} catch(err) {
logger.error("Could not parse temperature and humidity for location: " + LocationIn
+ ". All valid Longitudes and Latitudes values must have decimal points" + " and be located where weather measurements are commonly taken (near cities).");
result = "Failed. Check Script Logs";
}
}
Im not an expert in JS and I'm new into Thingworx so thank you!

