projecthorus / sondehub-tracker

🎈 Frontend for SondeHub Radiosonde Tracking
https://v2.sondehub.org
MIT License
60 stars 25 forks source link

Fix bug with car rotation #333

Closed bismurphy closed 1 month ago

bismurphy commented 1 month ago

The new SVG system allows cars to rotate on the map. However, there is a bug that seems to happen with cars that do not have headings, where the car does not get rendered.

I tracked down the issue with this logic; it's that the setCourse call in line 1657 happens before the image is ready, so then the one that sets the course to 90 by default doesn't run, since marker.rotated becomes true. Now, we will not update from gps heading unless the car is already rotated.

Additionally, while running this through the debugger, I noticed a bunch of 404 errors originating from the file list in service_worker.js; I've gone ahead and cleaned up all the files that were listed there which no longer exist.

Not completely clear what service_worker.js is, but removing the names of the files which have subsequently been deleted seems to have removed the errors.

LukePrior commented 1 month ago

service_worker.js is used to in theory speed up the site with a custom caching policy for specific files, if it works well however is another question...

I implemented it a few years back.