Commit 91f46452 authored by Zach's avatar Zach
Browse files

added array of locations, probably the wrong way to do this but it's a start....

added array of locations, probably the wrong way to do this but it's a start. - WARNING, in this state it will make 4 API calls per page reload
parent 9b53dbf2
LOCATIONS = {
FAIRFAX: {name: 'Fairfax', lat: '38.830295', long: '-77.307717'},
ARLINGTON: {name: 'Arlington', lat: '38.885025', long: '-77.101114'},
SCITECH: {name: 'SciTech', lat: '38.756211', long: '-77.521461'},
KOREA: {name: 'Mason Korea', lat: '37.367863', long: '126.630984'}//,
//RAK: {name: 'Mason Ras-Al-Khaimah', lat: '0', long: '0'} NEED LAT AND LONG
};
if (Meteor.isClient) { if (Meteor.isClient) {
Meteor.call('weatherDataForLoc', '38.830295', '-77.307717', function(err, res){ for(var key in LOCATIONS) {
console.log(res); var current = LOCATIONS[key];
//Sends the result of the API call to the browser console, will change console.log(current.name);
}); Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
console.log(res);
//Sends the result of the API call to the browser console, will change
});
}
Template.weather.helpers({ Template.weather.helpers({
updateData: function() {
}
}); });
Template.weather.events({ Template.weather.events({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment