Architecture for Calling getCurrentPosition?


#1

My app’s homepage doesn’t need to know the users location, but other pages do. So my app will call:

navigator.geolocation.getCurrentPosition

I need to figure out a good architecture for this.

If the call to getCurrentPosition is in Meteor.startup(), the user can easily go to a template that needs the position info, before the call to getCurrentPosition is complete.

On the other hand, if I delay the call to getCurrentPosition until the time the user first loads the template, he or she could be staring at a blank screen for 5-10 seconds.

I guess I need some way to initiate the call to getCurrentPosition in or at the same time as meteor.startup(), and then find some way to make the template make sure the info is available before it loads.

What is a correct way to to do this?

Thanks very much in advance to all for any thoughts/info.