dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Route Overlay Disappears After Hover

Open jdalrym2 opened this issue 7 months ago • 4 comments

OS & Hardware Dawarich: Docker container on Debian 12 Host (OpenMediaVault 17) Browser: Firefox 128.10.0esr / Google Chrome 136.0.7103.92, both on Debian 12

Version 0.26.0 (since at least 0.25.6)

Describe the bug When I hover over a route on the map, the route highlights as yellow and displays a tooltip as expected. However, once I'm done hovering, the route disappears from the map. No errors appear to be logged in the Docker container or the console.

To Reproduce Steps to reproduce the behavior:

  1. View route on homepage Image
  2. Hover mouse over route to see tooltip Image
  3. After hovering, route disappears, leaving only the heatmap overlay in its place Image

Expected behavior The route display should still be visible after hovering (like the first screenshot)

Screenshots See To Reproduce

Logs I don't see anything relevant in the logs for both dawarich_app and dawarich_sidekiq for when this issue occurs. I also don't see anything logged in the web browser developer console.

Additional context N/A


Just wanted to put in a kind word and say I've really been enjoying using this project! Thanks so much for the support!

jdalrym2 avatar May 19 '25 19:05 jdalrym2

Can you provide the contents of your browser console during these actions? I couldn't reproduce it on my setups

Freika avatar May 20 '25 17:05 Freika

Thanks for the quick reply!

Nothing shows up in the browser console during this action. Nonetheless, here's the console while loading the page:

Map controller connected maps_controller-0df97898088e0f43c7ce9854cf0dc8f3425e45490cfe6a42686537607ec19cdf.js:40:13
wrong event specified: touchleave leaflet-df8cad8209f4c881748f4a80602b1db6b35fd939bdeba37ddbd0402f3782648b.js:5:21102
Clearing 0 highlighted circles visits:1205:13
Fetching visits for: 2025-05-21T02:27:39.849Z 2025-05-21T02:27:39.849Z visits:563:15
Sending tile usage batch: 21 tile_monitor:35:13
Tile usage batch sent successfully tile_monitor:59:15

This looks pretty benign expect for maybe the wrong event specified: touchleave coming from Leaflet.

However, I did look into this further by putting breakpoints in the JavaScript code on the handlers for mouseOver/mouseOut. I think the problem is here: https://github.com/Freika/dawarich/blob/bd5e5f4a0a32a8c558226523f8f21ecbe2b6f679/app/javascript/maps/polylines.js#L259 ...because if I put a breakpoint here and print out userSettings I get

{
  "route_opacity": "0",
  "live_map_enabled": false,
  "fog_of_war_meters": "100",
  "speed_color_scale": "0:#00ff00|15:#00ffff|30:#ff00ff|50:#ffff00|100:#ff3300",
  "preferred_map_layer": "OpenStreetMap",
  "speed_colored_routes": false,
  "meters_between_routes": "1000",
  "points_rendering_mode": "simplified",
  "minutes_between_routes": "60",
  "time_threshold_minutes": "",
  "merge_threshold_minutes": ""
}

route_opacity is set to "0"!

If I use the browser console to change this value to what the opacity is for the polyline on load (e.g. userSettings.route_opacity = 0.6) then I can confirm the problem disappears.

What I didn't look into is where userSettings comes from and/or why route_opacity would be set to "0" for me by default.

Thanks for the help! -- Jon

jdalrym2 avatar May 21 '25 03:05 jdalrym2

I had more time to play around and I found where the userSettings variable gets populated. :) Image

I think when originally playing around with the app I managed to delete the value in the dialog box like this: Image and then clicked "Update" at the bottom.

Nothing happens at first, but upon a page refresh the same dialog displays the original 0.6: Image but under the hood it is set to "0", causing my problem. If I simply click "Update" again (which sets it back to 0.6), then refresh, the problem goes away.

So that leaves a few observations for me:

  • In my case where route opacity was set to "0", the starting style for the polylines on the map were still 0.6. They did not change to "0" until after an "onMouseOut" trigger occurred.
  • Clicking "Update" after changing the route opacity does not effect the "onMouseOut" polyline style set on the map until after a page refresh.
  • The dialog does not actually reflect the settings under the hood for userSettings (or at least in my case when I accidentally set route opacity to "0").

Up to you if you feel that these are worth addressing, otherwise feel free to close. Thanks!

jdalrym2 avatar May 22 '25 01:05 jdalrym2

It might be fixed in https://github.com/Freika/dawarich/releases/tag/0.26.6, can you please check? Also, great debugging process!

Freika avatar May 22 '25 17:05 Freika

Just updated to 0.26.6 and all 3 issues have been fixed! Thank you so much! 🎉

jdalrym2 avatar May 26 '25 03:05 jdalrym2