Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix bug with car rotation
  • Loading branch information
bismurphy committed Jul 17, 2024
commit a3fd3e17565eb9961496e6cf33ad00d019783bc7
6 changes: 3 additions & 3 deletions js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
vehicle.marker.setLatLng(latlng);

if(!!vehicle.marker.setCourse) {
if (vehicle.curr_position.gps_heading) {
if (vehicle.curr_position.gps_heading && vehicle.marker.rotated) {
vehicle.marker.setCourse((vehicle.curr_position.gps_heading !== "") ? parseInt(vehicle.curr_position.gps_heading) : 90);
}
}
Expand Down Expand Up @@ -2987,10 +2987,10 @@ var marker_rotate_setup = function(marker, image_src) {
else {
marker.iconImg = new Image();
icon_cache[image_src] = marker.iconImg;
marker.iconImg.onload = function() {
marker.iconImg.addEventListener("load", function() {
if(!marker.rotated) marker.setCourse(90);
marker.setLatLng(marker.getLatLng());
};
})
marker.iconImg.src = image_src;
}
};
Expand Down
42 changes: 6 additions & 36 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,19 @@ self.addEventListener('install', function(event) {
'/js/L.Terminator.js',
'/js/mobile.js',
'/js/rbush.js',
'/js/leaflet.canvas-markers.js',
'/js/pwa.js',
'/js/init_plot.js',
'/img/markers/antenna-green.png',
'/img/markers/balloon-blue.png',
'/img/markers/balloon-cyan.png',
'/img/markers/balloon-green.png',
'/img/markers/balloon-orange.png',
'/img/markers/balloon-purple.png',
'/img/markers/balloon-red.png',
'/img/markers/balloon-yellow.png',
'/img/markers/car-blue.png',
'/img/markers/car-green.png',
'/img/markers/car-red.png',
'/img/markers/car-yellow.png',
'/img/markers/parachute-yellow.png',
'/img/markers/parachute-blue.png',
'/img/markers/parachute-cyan.png',
'/img/markers/parachute-green.png',
'/img/markers/parachute-orange.png',
'/img/markers/parachute-purple.png',
'/img/markers/parachute-red.png',
'/img/markers/payload-blue.png',
'/img/markers/payload-cyan.png',
'/img/markers/payload-green.png',
'/img/markers/balloon.svg',
'/img/markers/car.svg',
'/img/markers/parachute.svg',
'/img/markers/payload.svg',
'/img/markers/payload-not-recovered.png',
'/img/markers/payload-orange.png',
'/img/markers/payload-purple.png',
'/img/markers/payload-recovered.png',
'/img/markers/payload-red.png',
'/img/markers/payload-yellow.png',
'/img/markers/target-blue.png',
'/img/markers/target-cyan.png',
'/img/markers/target-green.png',
'/img/markers/target-orange.png',
'/img/markers/target-purple.png',
'/img/markers/target-red.png',
'/img/markers/target-yellow.png',
'/img/markers/target.svg',
'/img/markers/shadow.png',
'/img/markers/balloon-pop.png',
'/img/hab-spinner.gif',
'/img/marker-you.gif',
'/img/sondehub_logo.gif',
'/img/sondehub_logo.png',
'/favicon.ico',
'/font/HabitatFont.woff',
'/font/Roboto-regular.woff',
Expand Down