Track User Location

What would be best practice for updating user last known locations at defined intervals?

My thoughts are to launch a Timeout Loop to have a user’s LKL updated in the DB, but can’t see how this would work with the component as it is view based.

I’ve also considered using tracking via Sessions but cant seem to extract position data from this.

I should note that updating the DB is a requirement for additional workflows.

Perhaps Tracks are what you are looking for?

I’ve considered it but the documentation is not clear on whether you can programmatically extract GPS data (Lat, Lon) from it every time the Timeouts are met

Hmm, unsure exactly what your workflow looks like, but I would give Tracks a go and see if you can make it work, as that would be the easiest route I think,.

If you cannot use Tracks, then you can have a location view variable and a show-if="false" <capture-location /> component bound to that var on every view and then just programmatically capture the location on any/every view based on your timeouts. On every view transition you would reset the timeout based on the last time the location was updated, or something like that I guess.