helium / mappers

Mappers Frontend and API
Apache License 2.0
67 stars 26 forks source link

Adds basic distance calc for uplinks in miles. #65

Closed jthiller closed 3 years ago

jthiller commented 3 years ago

This adds a distance column in the info pane.

General logic: If the surveyed hex is within a res8 hex containing the hotspot, we return a null value. If the distance is over a mile, I'm rounding the value to the nearest full unit.

I'd love some critique on my approach here, as I think my current approach runs twice for each uplinks (Once for the value and again for the unit)

Additional thoughts: I want follow this up at some point with the ability for the user to toggle between miles and kilometers by clicking on any distance value. Interaction is mocked here: https://codepen.io/jthiller/pen/abJbZEM Haven't sorted out how I'll approach that in a way that doesn't mean a full new set of recalculating those values.

I might also want to sort the values by their distance to make it a little easier to parse. Would love thoughts on that as well.

image

will close #42