bikehopper / bikehopper-ui

Friendly bike+transit directions (frontend)
Other
26 stars 1 forks source link

Always refresh current location for route fetch #242

Closed graue closed 1 year ago

graue commented 1 year ago

Today while out and about using BikeHopper, I noticed that when I changed my plans along the way and changed my destination, the "Current Location" start point of the route provided was stale.

This looks like a bug in locationsSubmitted. It's always falling back to a point if present, which it should do for Custom points or geocoded points, but for "Current Location," we should always geolocate, relying on the browser's caching (via the maximumAge param and the value provided for that in features/geolocation.js).

With this change, any time you fetch a new route, your "Current Location" will be updated first.