meteor / mobile-packages

Meteor packages that provide functionality on mobile and desktop via Cordova plugins.
Other
339 stars 153 forks source link

mdg:geolocation SesionSet.get('geoLocation') returns empty object #71

Closed aleksandrenko closed 3 years ago

aleksandrenko commented 9 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 :)

skhan02 commented 9 years ago

You have to call the the currentLocation() inside of a helper or autorun. Check the solomo example on the github page!