getAccurateCurrentPosition icon indicating copy to clipboard operation
getAccurateCurrentPosition copied to clipboard

Improvements

Open zevero opened this issue 9 years ago • 1 comments

Thank you for your nice library. I was implementing roughly the same ideas, but it is much cleaner doing it by extending navigator.geolocation than polluting my proper code...

I wanted to make some improvements however:

  1. Use bestCheckedPostion instead of lastCheckedPosition,
  2. Always call geoprogress (also the last one)
  3. Dont force maximumAge. Can be set optionally
  4. New Option countMin, which is defaulted to 2 (exactly as it was)
  5. Check Options with isNaN() to allow for 0 (would be overwritten otherwise)
  6. New Option enableLowAccuracyOnTimeout (calls getCurrentPosition with lowAccuracy doubling timeout)
  7. New Option desiredAccuracyCountMin, so we can wait just a little bit longer for an even better result (maxWait is unaffected)

Everything is backwards compatible but

  • not lastCheckedPosition but bestCheckedPosition is returned
  • geoprogress is called one more time (along with the result)

zevero avatar Sep 05 '15 13:09 zevero

I replaced enabelLowAccuracyOnTimeout by enableLowAccuracy, which starts a low accuracy getCurrentPosition simultaneously. However, this idea is at least not honored on Lollipop and Chrome 43.

http://stackoverflow.com/questions/17804469/html5-geolocation-ignores-enablehighaccuracy-option/32521789

Its a pitty, because instead of returning no position at all I would have liked at least the roughest idea of the position...

Maybe someone has a better idea?

zevero avatar Sep 11 '15 11:09 zevero