Closed aleksandrenko closed 3 years ago
if(Meteor.isClient) {
Tracker.autorun(function() { var g = Geolocation.currentLocation(); if(g) { console.log('set', g); Session.set('g',g); console.log('get', Session.get('g')); } });
The console outputs are as follow: set Geoposition {} get Object {}
Setting the geolocation object in a Session does not work. Can someone take a look :)
You have to call the the currentLocation() inside of a helper or autorun. Check the solomo example on the github page!
if(Meteor.isClient) {
Tracker.autorun(function() { var g = Geolocation.currentLocation(); if(g) { console.log('set', g); Session.set('g',g); console.log('get', Session.get('g')); } });
The console outputs are as follow: set Geoposition {} get Object {}
Setting the geolocation object in a Session does not work. Can someone take a look :)