Thanks @lashleigh, it was a download problem
Here is the code that worked for me (I use Modernizr.js to detect geolocation)
if (Meteor.is_client) {
Session.set('loc','?');
function foundLocation(location) {
console.log(location);
Session.set('loc','lat: '+location.coords.latitude+', lan: '+ location.coords.longitude);
}
function noLocation() {
alert('no location');
}
Template.hello.greeting = function () {
var output;
if (Modernizr.geolocation) {
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
outpout = Session.get('loc');
}
return Session.get('loc');
};
}
source
share