Skip to content

Commit

Permalink
More debugging, let's see if the maps are fixed now.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthaeusHarris committed Mar 21, 2015
1 parent 9d46141 commit d487149
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions routes/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,21 @@ router.get('/map', auth.ensureAuthenticated, function(req, res) {
if (err) {
res.render('500', {error: err});
} else {
var packages = {};
for(var package in data) {
if (data[package].currentLocation) {
data[package].location = {
latitude: data[package].currentLocation.geoInfo[0].latitude,
longitude: data[package].currentLocation.geoInfo[0].longitude
packages[package] = {
_id: data[package]._id,
description: data[package].description,
location: {
latitude: data[package].currentLocation.geoInfo[0].latitude,
longitude: data[package].currentLocation.geoInfo[0].longitude
}
};
} else {
data.splice(package, 1);
}
}
res.render('map', {packages: data, mapsApiKey: credentials.apiKeys.googleMaps});
console.log(packages);
res.render('map', {packages: packages, mapsApiKey: credentials.apiKeys.googleMaps});
}
});
});
Expand Down
1 change: 1 addition & 0 deletions views/map.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
map: map,
title: packages[packageId].description
});
console.log("Added " + packages[packageId].description);
}
}
Expand Down

0 comments on commit d487149

Please sign in to comment.