helium / mappers

Mappers Frontend and API
Apache License 2.0
65 stars 23 forks source link

Add Locate User Location #55

Closed kent-williams closed 2 years ago

kent-williams commented 3 years ago

https://docs.mapbox.com/mapbox-gl-js/example/locate-user/

jthiller commented 3 years ago

Another thought I've had would be to save the user's last location in localstorage and center on that during page load.

Carries most of the benefit of geolocation for the user but without the prompt from the browser on each load.

jthiller commented 3 years ago

Latest thoughts on user location:

User can center the map on their location after pressing a ‘center on location’ button. After user requests location, ask the browser for location permission if permission granted, center location. Store permission for later use. if no permission granted, do not center location. user can press location button again to retry Until the user pans on the map, the user location remains centered on the map (following) While location is centered and not panned, location centering button disappears. After user pans, centering button reappears. Set map center at a coarse resolution in order to crudely smooth location jitter. (?)

Stretch idea: As user enters location enters new hexes, automatically select that hex and show its uplink lines and details. Is user ‘minimizes’ the info pane, remember that state and only show uplink lines on the map. If info pane is open, adjust map center to be the viewable map area on mobile, (100vh - infopaneHeight)/2 on desktop, (100vw - infopaneWidth)/2

Alternate stretch idea: For the centered hex, highlight it in some way. Color, border, etc. Giving the user a clear ‘center’ for their location. OR Draw an icon at the user location.


I'm gradually working through some UI for this which should clarify implementation.

jthiller commented 2 years ago

Closed via #72