fruktkartan icon indicating copy to clipboard operation
fruktkartan copied to clipboard

Show user's location

Open bluss opened this issue 5 years ago • 1 comments

When using the map in the field, it's useful for many users to show the user's current location on the map (you know with a blue dot or similar).

Nice job on the service and the site.

bluss avatar Sep 12 '20 09:09 bluss

Agreed. Just a few things to keep in mind:

  • We only want to show the location if the geolocating is fairly accurate
  • Should we only enable this on handheld devices? (desktop geolocating is often very approximate anway)
  • Getting the position is typically a two-step process: An approximate reading is quick (that's what we use now, on loading the map), then it can take seconds (or minutes in extreme cases) to get a more exact reading. This means that re-centering the map on the second reading is potentially disruptive. My suggestion: Only show the user's location if geolocating is manually triggered. The icon could even be used to toggle geolocation polling.
  • Constantly polling for a position is battery intensive, and another reason to make it possible to toggle this behaviour.
  • Using a shaded circle that indicates the exactness could be useful, and also make the re-adjusting of the map more transparent and less disruptive. (Like we did on the old version of Fruktkartan)
  • Should we indicate direction?
  • While the geolocation api is straightforward enough, there are a lot of different ways clients handle permissions etc, making it a bit hard to interpret all the possible error messages when a request times out, etc. TL;DR: If we want a Google Maps like functionality, actually being able to follow the user around, implementation will get more complex if we want to get everything right. Might be worth looking for a library/Leaflet plugin to handle this for us?

rotsee avatar Sep 15 '20 10:09 rotsee