Skip to content

Commit a05dc5a

Browse files
authored
Fix bug with car rotation (projecthorus#333)
1 parent 78e810c commit a05dc5a

File tree

2 files changed

+9
-39
lines changed

2 files changed

+9
-39
lines changed

js/tracker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
16521652
vehicle.marker.setLatLng(latlng);
16531653

16541654
if(!!vehicle.marker.setCourse) {
1655-
if (vehicle.curr_position.gps_heading) {
1655+
if (vehicle.curr_position.gps_heading && vehicle.marker.rotated) {
16561656
vehicle.marker.setCourse((vehicle.curr_position.gps_heading !== "") ? parseInt(vehicle.curr_position.gps_heading) : 90);
16571657
}
16581658
}
@@ -3000,10 +3000,10 @@ var marker_rotate_setup = function(marker, image_src) {
30003000
else {
30013001
marker.iconImg = new Image();
30023002
icon_cache[image_src] = marker.iconImg;
3003-
marker.iconImg.onload = function() {
3003+
marker.iconImg.addEventListener("load", function() {
30043004
if(!marker.rotated) marker.setCourse(90);
30053005
marker.setLatLng(marker.getLatLng());
3006-
};
3006+
})
30073007
marker.iconImg.src = image_src;
30083008
}
30093009
};

service-worker.js

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,19 @@ self.addEventListener('install', function(event) {
1111
'/js/L.Terminator.js',
1212
'/js/mobile.js',
1313
'/js/rbush.js',
14-
'/js/leaflet.canvas-markers.js',
1514
'/js/pwa.js',
1615
'/js/init_plot.js',
17-
'/img/markers/antenna-green.png',
18-
'/img/markers/balloon-blue.png',
19-
'/img/markers/balloon-cyan.png',
20-
'/img/markers/balloon-green.png',
21-
'/img/markers/balloon-orange.png',
22-
'/img/markers/balloon-purple.png',
23-
'/img/markers/balloon-red.png',
24-
'/img/markers/balloon-yellow.png',
25-
'/img/markers/car-blue.png',
26-
'/img/markers/car-green.png',
27-
'/img/markers/car-red.png',
28-
'/img/markers/car-yellow.png',
29-
'/img/markers/parachute-yellow.png',
30-
'/img/markers/parachute-blue.png',
31-
'/img/markers/parachute-cyan.png',
32-
'/img/markers/parachute-green.png',
33-
'/img/markers/parachute-orange.png',
34-
'/img/markers/parachute-purple.png',
35-
'/img/markers/parachute-red.png',
36-
'/img/markers/payload-blue.png',
37-
'/img/markers/payload-cyan.png',
38-
'/img/markers/payload-green.png',
16+
'/img/markers/balloon.svg',
17+
'/img/markers/car.svg',
18+
'/img/markers/parachute.svg',
19+
'/img/markers/payload.svg',
3920
'/img/markers/payload-not-recovered.png',
40-
'/img/markers/payload-orange.png',
41-
'/img/markers/payload-purple.png',
4221
'/img/markers/payload-recovered.png',
43-
'/img/markers/payload-red.png',
44-
'/img/markers/payload-yellow.png',
45-
'/img/markers/target-blue.png',
46-
'/img/markers/target-cyan.png',
47-
'/img/markers/target-green.png',
48-
'/img/markers/target-orange.png',
49-
'/img/markers/target-purple.png',
50-
'/img/markers/target-red.png',
51-
'/img/markers/target-yellow.png',
22+
'/img/markers/target.svg',
5223
'/img/markers/shadow.png',
5324
'/img/markers/balloon-pop.png',
5425
'/img/hab-spinner.gif',
55-
'/img/marker-you.gif',
56-
'/img/sondehub_logo.gif',
26+
'/img/sondehub_logo.png',
5727
'/favicon.ico',
5828
'/font/HabitatFont.woff',
5929
'/font/Roboto-regular.woff',

0 commit comments

Comments
 (0)