Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use "from" location to determine preferred distance units #14

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

michaelkirk
Copy link
Owner

@michaelkirk michaelkirk commented Nov 10, 2022

Currently it's all km all the time. As much as I'd like for that to be true, for now I think I need to accommodate the whimsical units of my home.

So now we choose units based on the preferred units of the "from" location.

  • London to Glasgow will be in miles.
  • Paris to Lyon will be in km.
  • London to Paris will be in miles.
  • Paris to London will be in km.

Screenshot 2022-11-09 at 6 02 58 PM

Screenshot 2022-11-09 at 6 02 39 PM

This is only a fix to the type checking - behavior is the same.
There's an unfortunate redundant fetch to the pelias endpoint to
populate the POI. I'd like to address this in future work, probably by
replacing POI with Place, but POI is used all over the place so I'd want
to do it gradually as I have a better understanding of how its used.

In the meanwhile I think this extra request is worth getting the units
right for people.
@michaelkirk michaelkirk merged commit c59fa64 into main Nov 10, 2022
@michaelkirk michaelkirk deleted the mkirk/units branch November 10, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant