oSoc17/rideaway-frontend

The current location is shown but there is no way to route from/to there.

xivk opened this issue · 1 comments

xivk commented

The current location is shown but there is no way to route from/to there. Expected is that the current location is either selected by default or that it can be selected somehow.

So I've spent some time trying to figure this one out, and sadly I couldn't find a native way for the mapbox-gl-geocoder to support geolocating the user. So I here's the plan:

  • Show my location option in the controls
  • Hide the option when starting to type
  • Show the option again when the input is empty
  • Set origin/destination on select
  • Calculate route
    Hide my location option from other control when it's selected in one

Complications

  • Change the position when we move => recalculate every time => complicated