w3c / geolocation-sensor

Geolocation Sensor
https://www.w3.org/TR/geolocation-sensor/
Other
59 stars 21 forks source link

Update frequency (throttling) #20

Closed FluorescentHallucinogen closed 6 years ago

FluorescentHallucinogen commented 6 years ago

Currently, in my web app I use W3C Geolocation API and write (send) geolocation data directly to real-time database.

The problem is that the geolocation data is updated every second. This is a very large amount of data in the database.

How to limit geolocation update frequency (how often latitude and longitude values updates) to e.g. once per 1 or 5 minutes?

As a workaround, I can calculate the delta between the returned timestamp values and if the delta is less than 1 or 5 minutes, skip the new geolocation data and don't write (send) it to the database. But this doesn't solve the battery drain issues.

anssiko commented 6 years ago

Thanks for the use case description. This seems to be a duplicate of #16. I'll close this issue so that we can consolidate all related discussion in #16.