icssc / AntAlmanac

A course exploration and scheduling tool for UCI Anteaters
https://antalmanac.com
MIT License
54 stars 65 forks source link

Improve route hover popup #485

Closed MinhxNguyen7 closed 1 year ago

MinhxNguyen7 commented 1 year ago

Currently, it is very difficult to hover over a route in such a way that the popup (displaying distance and duration) shows up. I think it's quite a helpful feature that should be easier to make use of.

Making the margins for error larger for the hover would probably be good. Also, we should consider letting users click on the route to display the popup to make it usable on touchscreen devices,

ap0nia commented 1 year ago

I recently took a look at this component and simplified it as best as I could. I think was able to reproduce most of the behaviors I can discern...bar specifically this one.

Here's my implementation: https://github.com/icssc/AntAlmanac/blob/aponia/src/components/Map/Routes.tsx

The main blocker I ran into was the routeLine option when configuring the router (it automatically fetches the data and draws lines to the map), and somehow getting the rendered route lines to do something on hover or interaction

ap0nia commented 1 year ago

Closing as I think I've been able implement this sufficiently: https://github.com/icssc/AntAlmanac/blob/aponia/src/components/Map/Routes.tsx

What should happen

Strategy

Caveats

EricPedley commented 1 year ago

Reopening until this change makes it onto the live site.