What is the best way to get user geolocation before rendering a template

Hi, I am having a lot of trouble on iOS and Android with a Google Map I added to my Meteor app, and I think that the main problem is the way I am getting the geolocation right now which is by using this:

 Tracker.autorun(function () {
    var geo = Geolocation.latLng();
    Session.set('geo', geo);

and the mdg:geolocation pacakge (https://atmospherejs.com/mdg/geolocation) I would like to know what do you think would be the best way to get the current user location, maybe a waitOn on the route? Or how can I make a function to wait for the Session before Meteor renders the template? Thanks in advance!

Did you add org.apache.cordova.geolocation?

The mdg:geolocation package adds it

  "org.apache.cordova.geolocation": "0.3.10"

what i would like is to display a loading template while Geolocation.latLng(); is getting the position from the device GPS, do you know how could I do this? :s thanks in advance!

Hey cosio55,

Were you able to figure out the issue. I am having the same problem in one of my apps.


Hi @cosio55 @jamgold @abhirakshit

Anyone fix this problem. Currently having the same issue.

Geeting geolocalization to render before anything else.

Thank you so much.