diff --git a/img/markers/balloon-adafruit.png b/img/markers/balloon-adafruit.png deleted file mode 100644 index 4c715f2..0000000 Binary files a/img/markers/balloon-adafruit.png and /dev/null differ diff --git a/img/markers/balloon-blue.png b/img/markers/balloon-blue.png deleted file mode 100644 index 9888487..0000000 Binary files a/img/markers/balloon-blue.png and /dev/null differ diff --git a/img/markers/balloon-buzz.png b/img/markers/balloon-buzz.png deleted file mode 100644 index 17097b5..0000000 Binary files a/img/markers/balloon-buzz.png and /dev/null differ diff --git a/img/markers/balloon-cyan.png b/img/markers/balloon-cyan.png deleted file mode 100644 index 9eae707..0000000 Binary files a/img/markers/balloon-cyan.png and /dev/null differ diff --git a/img/markers/balloon-green.png b/img/markers/balloon-green.png deleted file mode 100644 index 126a0b0..0000000 Binary files a/img/markers/balloon-green.png and /dev/null differ diff --git a/img/markers/balloon-invisible.png b/img/markers/balloon-invisible.png deleted file mode 100644 index 19464e9..0000000 Binary files a/img/markers/balloon-invisible.png and /dev/null differ diff --git a/img/markers/balloon-iss.png b/img/markers/balloon-iss.png deleted file mode 100644 index 23d2a49..0000000 Binary files a/img/markers/balloon-iss.png and /dev/null differ diff --git a/img/markers/balloon-orange.png b/img/markers/balloon-orange.png deleted file mode 100644 index b0c5d09..0000000 Binary files a/img/markers/balloon-orange.png and /dev/null differ diff --git a/img/markers/balloon-purple.png b/img/markers/balloon-purple.png deleted file mode 100644 index e129b1c..0000000 Binary files a/img/markers/balloon-purple.png and /dev/null differ diff --git a/img/markers/balloon-red.png b/img/markers/balloon-red.png deleted file mode 100644 index f079bfe..0000000 Binary files a/img/markers/balloon-red.png and /dev/null differ diff --git a/img/markers/balloon-rob.png b/img/markers/balloon-rob.png deleted file mode 100644 index 819a558..0000000 Binary files a/img/markers/balloon-rob.png and /dev/null differ diff --git a/img/markers/balloon-rpi.png b/img/markers/balloon-rpi.png deleted file mode 100644 index c340631..0000000 Binary files a/img/markers/balloon-rpi.png and /dev/null differ diff --git a/img/markers/balloon-shockpink.png b/img/markers/balloon-shockpink.png deleted file mode 100644 index 49ad112..0000000 Binary files a/img/markers/balloon-shockpink.png and /dev/null differ diff --git a/img/markers/balloon-thereg.png b/img/markers/balloon-thereg.png deleted file mode 100644 index f26068f..0000000 Binary files a/img/markers/balloon-thereg.png and /dev/null differ diff --git a/img/markers/balloon-yellow.png b/img/markers/balloon-yellow.png deleted file mode 100644 index 66fc042..0000000 Binary files a/img/markers/balloon-yellow.png and /dev/null differ diff --git a/img/markers/balloon.svg b/img/markers/balloon.svg new file mode 100755 index 0000000..8966505 --- /dev/null +++ b/img/markers/balloon.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/markers/car-blue.png b/img/markers/car-blue.png deleted file mode 100644 index 09192f0..0000000 Binary files a/img/markers/car-blue.png and /dev/null differ diff --git a/img/markers/car-green.png b/img/markers/car-green.png deleted file mode 100644 index c42da50..0000000 Binary files a/img/markers/car-green.png and /dev/null differ diff --git a/img/markers/car-purple.png b/img/markers/car-purple.png deleted file mode 100644 index a281513..0000000 Binary files a/img/markers/car-purple.png and /dev/null differ diff --git a/img/markers/car-red.png b/img/markers/car-red.png deleted file mode 100644 index ce44c92..0000000 Binary files a/img/markers/car-red.png and /dev/null differ diff --git a/img/markers/car-teal.png b/img/markers/car-teal.png deleted file mode 100644 index f0e6fe8..0000000 Binary files a/img/markers/car-teal.png and /dev/null differ diff --git a/img/markers/car-yellow.png b/img/markers/car-yellow.png deleted file mode 100644 index 5c35476..0000000 Binary files a/img/markers/car-yellow.png and /dev/null differ diff --git a/img/markers/car.svg b/img/markers/car.svg new file mode 100644 index 0000000..c277ce8 --- /dev/null +++ b/img/markers/car.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/markers/parachute-blue.png b/img/markers/parachute-blue.png deleted file mode 100644 index ff4dc5d..0000000 Binary files a/img/markers/parachute-blue.png and /dev/null differ diff --git a/img/markers/parachute-cyan.png b/img/markers/parachute-cyan.png deleted file mode 100644 index bf83a49..0000000 Binary files a/img/markers/parachute-cyan.png and /dev/null differ diff --git a/img/markers/parachute-green.png b/img/markers/parachute-green.png deleted file mode 100644 index f41d7e1..0000000 Binary files a/img/markers/parachute-green.png and /dev/null differ diff --git a/img/markers/parachute-orange.png b/img/markers/parachute-orange.png deleted file mode 100644 index e3f2d16..0000000 Binary files a/img/markers/parachute-orange.png and /dev/null differ diff --git a/img/markers/parachute-purple.png b/img/markers/parachute-purple.png deleted file mode 100644 index adae959..0000000 Binary files a/img/markers/parachute-purple.png and /dev/null differ diff --git a/img/markers/parachute-red.png b/img/markers/parachute-red.png deleted file mode 100644 index 603c60f..0000000 Binary files a/img/markers/parachute-red.png and /dev/null differ diff --git a/img/markers/parachute-rpi.png b/img/markers/parachute-rpi.png deleted file mode 100644 index ad421b6..0000000 Binary files a/img/markers/parachute-rpi.png and /dev/null differ diff --git a/img/markers/parachute-yellow.png b/img/markers/parachute-yellow.png deleted file mode 100644 index 4d85a51..0000000 Binary files a/img/markers/parachute-yellow.png and /dev/null differ diff --git a/img/markers/parachute.svg b/img/markers/parachute.svg new file mode 100644 index 0000000..8b10853 --- /dev/null +++ b/img/markers/parachute.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/markers/payload-blue.png b/img/markers/payload-blue.png deleted file mode 100644 index c03caee..0000000 Binary files a/img/markers/payload-blue.png and /dev/null differ diff --git a/img/markers/payload-cyan.png b/img/markers/payload-cyan.png deleted file mode 100644 index 226bfa8..0000000 Binary files a/img/markers/payload-cyan.png and /dev/null differ diff --git a/img/markers/payload-green.png b/img/markers/payload-green.png deleted file mode 100644 index f524a73..0000000 Binary files a/img/markers/payload-green.png and /dev/null differ diff --git a/img/markers/payload-orange.png b/img/markers/payload-orange.png deleted file mode 100644 index 20e5b05..0000000 Binary files a/img/markers/payload-orange.png and /dev/null differ diff --git a/img/markers/payload-purple.png b/img/markers/payload-purple.png deleted file mode 100644 index 80e1e1a..0000000 Binary files a/img/markers/payload-purple.png and /dev/null differ diff --git a/img/markers/payload-red.png b/img/markers/payload-red.png deleted file mode 100644 index 7ad8acc..0000000 Binary files a/img/markers/payload-red.png and /dev/null differ diff --git a/img/markers/payload-rpi.png b/img/markers/payload-rpi.png deleted file mode 100644 index 9f533fb..0000000 Binary files a/img/markers/payload-rpi.png and /dev/null differ diff --git a/img/markers/payload-yellow.png b/img/markers/payload-yellow.png deleted file mode 100644 index e9b7bb5..0000000 Binary files a/img/markers/payload-yellow.png and /dev/null differ diff --git a/img/markers/payload.svg b/img/markers/payload.svg new file mode 100644 index 0000000..b89d7d6 --- /dev/null +++ b/img/markers/payload.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/markers/target-blue.png b/img/markers/target-blue.png deleted file mode 100644 index fae5796..0000000 Binary files a/img/markers/target-blue.png and /dev/null differ diff --git a/img/markers/target-cyan.png b/img/markers/target-cyan.png deleted file mode 100644 index ba30743..0000000 Binary files a/img/markers/target-cyan.png and /dev/null differ diff --git a/img/markers/target-green.png b/img/markers/target-green.png deleted file mode 100644 index 56b4682..0000000 Binary files a/img/markers/target-green.png and /dev/null differ diff --git a/img/markers/target-orange.png b/img/markers/target-orange.png deleted file mode 100644 index 4b353b6..0000000 Binary files a/img/markers/target-orange.png and /dev/null differ diff --git a/img/markers/target-purple.png b/img/markers/target-purple.png deleted file mode 100644 index 4510158..0000000 Binary files a/img/markers/target-purple.png and /dev/null differ diff --git a/img/markers/target-red.png b/img/markers/target-red.png deleted file mode 100644 index 5987df9..0000000 Binary files a/img/markers/target-red.png and /dev/null differ diff --git a/img/markers/target-yellow.png b/img/markers/target-yellow.png deleted file mode 100644 index 8dc2d08..0000000 Binary files a/img/markers/target-yellow.png and /dev/null differ diff --git a/img/markers/target.svg b/img/markers/target.svg new file mode 100644 index 0000000..e80875e --- /dev/null +++ b/img/markers/target.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/app.js b/js/app.js index 351cf18..b939590 100644 --- a/js/app.js +++ b/js/app.js @@ -445,6 +445,25 @@ var format_time_friendly = function(start, end) { } }; +var format_coordinates = function(lat, lon, name) { + var coords_text; + var ua = navigator.userAgent.toLowerCase(); + + // determine how to link the coordinates to a native app, if on a mobile device + if(ua.indexOf('iphone') > -1) { + coords_text = '' + + roundNumber(lat, 5) + ', ' + roundNumber(lon, 5) +''; + } else if(ua.indexOf('android') > -1) { + coords_text = '' + + roundNumber(lat, 5) + ', ' + roundNumber(lon, 5) +''; + } else { + coords_text = '' + + roundNumber(lat, 5) + ', ' + roundNumber(lon, 5) +''; + } + + return coords_text; +}; + // runs every second var updateTime = function(date) { // update timebox @@ -553,12 +572,6 @@ $(window).ready(function() { $("#main").removeClass("drag"); }); - // confirm dialog when launchnig a native map app with coordinates - //$('#main').on('click', '#launch_mapapp', function() { - // var answer = confirm("Launch your maps app?"); - // return answer; - //}); - // follow vehicle by clicking on data $('#main').on('click', '.row .data', function() { var e = $(this).parent(); diff --git a/js/station.js b/js/station.js index 3a2f4a5..74f053c 100644 --- a/js/station.js +++ b/js/station.js @@ -179,7 +179,7 @@ function drawHistorical (data, station) { html = "
"; html += "
"+serial+" ("+time+")
"; html += "
"; - html += "
Last Position: "+roundNumber(landing.lat, 5) + ', ' + roundNumber(landing.lon, 5)+"
"; + html += "
Last Position: "+format_coordinates(landing.lat, landing.lon, serial)+"
"; var imp = offline.get('opt_imperial'); var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(landing.alt)) : parseInt(landing.alt)).toLocaleString("us"); diff --git a/js/tracker.js b/js/tracker.js index e518415..8ea9183 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -73,9 +73,8 @@ var manual_pan = false; // due to complaints it was not visible enough. - 2023-06-03 var car_index = 0; -var car_colors = ["blue", "red", "green", "yellow", "teal", "purple"]; -var balloon_colors_name = ["red", "blue", "green", "purple", "orange", "cyan"]; -var balloon_colors = ["#f00", "blue", "green", "#c700e6", "#ff8a0f", "#0fffca"]; +var car_colors = ["#a6cee3", "#1f78b4", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6"]; +var balloon_colors = ["#d95f02", "#7570b3", "#e7298a", "#e6ab02", "#a6761d", "#666666", "blue", "lime", "magenta", "#ffb300", "rebeccapurple"]; var nyan_color_index = 0; var nyan_colors = ['nyan', 'nyan-coin', 'nyan-mon', 'nyan-pirate', 'nyan-cool', 'nyan-tothemax', 'nyan-pumpkin', 'nyan-afro', 'nyan-coin', 'nyan-mummy']; @@ -1653,7 +1652,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); } } @@ -1800,23 +1799,7 @@ function updateVehicleInfo(vcallsign, newPosition) { hrate_text = imp ? (vehicle.horizontal_rate * 196.850394).toFixed(1) + ' ft/min' : vehicle.horizontal_rate.toFixed(1) + ' m/s'; } - var coords_text; - var ua = navigator.userAgent.toLowerCase(); - - // determine how to link the vehicle coordinates to a native app, if on a mobile device - if(ua.indexOf('iphone') > -1) { - coords_text = '' + - roundNumber(newPosition.gps_lat, 5) + ', ' + roundNumber(newPosition.gps_lon, 5) +'' + - ' '; - } else if(ua.indexOf('android') > -1) { - coords_text = '' + - roundNumber(newPosition.gps_lat, 5) + ', ' + roundNumber(newPosition.gps_lon, 5) +'' + - ' '; - } else { - coords_text = '' + - roundNumber(newPosition.gps_lat, 5) + ', ' + roundNumber(newPosition.gps_lon, 5) +'' + - ' '; - } + var coords_text = format_coordinates(newPosition.gps_lat, newPosition.gps_lon, vcallsign) + ' '; // format altitude strings var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(newPosition.gps_alt)) : parseInt(newPosition.gps_alt)).toLocaleString("us"); @@ -2260,16 +2243,20 @@ function set_polyline_visibility(vcallsign, val) { if(vehicle.prediction_polyline) { if (val) { - map.addLayer(vehicle.prediction_polyline); + map.addLayer(vehicle.prediction_polyline[0]); + map.addLayer(vehicle.prediction_polyline[1]); } else { - map.removeLayer(vehicle.prediction_polyline); + map.removeLayer(vehicle.prediction_polyline[0]); + map.removeLayer(vehicle.prediction_polyline[1]); } } if(vehicle.prediction_launch_polyline) { if (val) { - map.addLayer(vehicle.prediction_launch_polyline); + map.addLayer(vehicle.prediction_launch_polyline[0]); + map.addLayer(vehicle.prediction_launch_polyline[1]); } else { - map.removeLayer(vehicle.prediction_launch_polyline); + map.removeLayer(vehicle.prediction_launch_polyline)[0]; + map.removeLayer(vehicle.prediction_launch_polyline)[1]; } } if(vehicle.prediction_target) { @@ -2292,7 +2279,8 @@ function set_polyline_visibility(vcallsign, val) { function removePrediction(vcallsign) { if(vehicles[vcallsign].prediction_polyline) { - map.removeLayer(vehicles[vcallsign].prediction_polyline); + map.removeLayer(vehicles[vcallsign].prediction_polyline[1]); + map.removeLayer(vehicles[vcallsign].prediction_polyline[1]); vehicles[vcallsign].prediction_polyline = null; } if(vehicles[vcallsign].prediction_target) { @@ -2321,19 +2309,42 @@ function drawLaunchPrediction(vcallsign) { vehicle.prediction_launch_path = line; - vehicle.prediction_launch_polyline = new L.Polyline(line, { + vehicle.prediction_launch_polyline = [new L.Polyline(line, { color: balloon_colors[vehicle.color_index], - opacity: 0.4, + opacity: 0.8, weight: 3, - })//.addTo(map); - - vehicle.prediction_launch_polyline.on('click', function (e) { + }), + new L.Polyline(line, { + color: "#000", + opacity: 0.1, + weight: 6, +}) +]//.addTo(map); + + vehicle.prediction_launch_polyline[0].on('click', function (e) { + mapInfoBox_handle_prediction_path(e); + }); + vehicle.prediction_launch_polyline[1].on('click', function (e) { mapInfoBox_handle_prediction_path(e); }); vehicle.prediction_launch_polyline.path_length = path_length; } +// Takes in an SVG for a balloon, parachute, target, car, etc and sets a dynamic-color +// variable which that SVG can use to recolor any relevant elements. +// See balloon.svg, target.svg, etc for examples +function recolorSVG(svg_path, color) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', svg_path, false); + xhr.send(); + + const parser = new DOMParser(); + const svgDocument = parser.parseFromString(xhr.responseText, 'image/svg+xml'); + svgDocument.documentElement.style.setProperty("--dynamic-color", color); + return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgDocument.documentElement.outerHTML); + } + function redrawPrediction(vcallsign) { var vehicle = vehicles[vcallsign]; var data = vehicle.prediction.data; @@ -2373,16 +2384,27 @@ function redrawPrediction(vcallsign) { vehicle.prediction_path = line; if(vehicle.prediction_polyline !== null) { - vehicle.prediction_polyline.setLatLngs(line); + vehicle.prediction_polyline[0].setLatLngs(line); + vehicle.prediction_polyline[1].setLatLngs(line); } else { - vehicle.prediction_polyline = new L.Polyline(line, { + vehicle.prediction_polyline = [new L.Polyline(line, { color: balloon_colors[vehicle.color_index], - opacity: 0.5, // Was 0.4 + opacity: 0.8, // Was 0.4 weight: 3, - })//.addTo(map); - vehicle.prediction_polyline.on('click', function (e) { + }), + new L.Polyline(line, { + color: "#000", + opacity: 0.1, // Was 0.4 + weight: 6, + }) + + ]//.addTo(map); + vehicle.prediction_polyline[0].on('click', function (e) { mapInfoBox_handle_prediction_path(e); }); + vehicle.prediction_polyline[1].on('click', function (e) { + mapInfoBox_handle_prediction_path(e); + }) } vehicle.prediction_polyline.path_length = path_length; @@ -2393,7 +2415,7 @@ function redrawPrediction(vcallsign) { if(vehicle.prediction_target) { vehicle.prediction_target.setLatLng(latlng); } else { - image_src = host_url + markers_url + "target-" + balloon_colors_name[vehicle.color_index] + ".png"; + image_src = recolorSVG(host_url + markers_url + "target.svg", balloon_colors[vehicle.color_index]); predictionIcon = new L.icon({ iconUrl: image_src, iconSize: [20,20], @@ -2684,7 +2706,7 @@ function mapInfoBox_handle_path_old(vehicle, id) { html = "
"; html += "
"+data.serial+" ("+data.datetime+")
"; html += "
"; - html += "
 "+roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5)+"
"; + html += "
 "+format_coordinates(data.lat, data.lon, data.serial)+"
"; var imp = offline.get('opt_imperial'); var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(data.alt)) : parseInt(data.alt)).toLocaleString("us"); @@ -2759,7 +2781,7 @@ function mapInfoBox_handle_path_new(data, vehicle, date) { html = "
"; html += "
"+data.serial+" ("+date+")
"; html += "
"; - html += "
 "+roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5)+"
"; + html += "
 "+format_coordinates(data.lat, data.lon, data.serial)+"
"; var imp = offline.get('opt_imperial'); var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(data.alt)) : parseInt(data.alt)).toLocaleString("us"); @@ -2893,20 +2915,7 @@ function mapInfoBox_handle_prediction(event) { altitude = Math.round(data.alt) + " m"; } - var coords_text; - var ua = navigator.userAgent.toLowerCase(); - - // determine how to link the vehicle coordinates to a native app, if on a mobile device - if(ua.indexOf('iphone') > -1) { - coords_text = '' + - roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5) + ''; - } else if(ua.indexOf('android') > -1) { - coords_text = '' + - roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5) +''; - } else { - coords_text = '' + - roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5) +''; - } + var coords_text = format_coordinates(data.lat, data.lon, "Prediction"); mapInfoBox.setContent("
" +
                         formatDate(new Date(parseInt(data.time) * 1000), true) + "\n\n" +
@@ -2987,10 +2996,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;
     }
 };
@@ -3023,7 +3032,7 @@ function addPosition(position) {
         if(vcallsign.search(/(chase)/i) != -1) {
             vehicle_type = "car";
             color_index = car_index++ % car_colors.length;
-            image_src = host_url + markers_url + "car-" + car_colors[color_index] + ".png";
+            image_src = recolorSVG(host_url + markers_url + "car.svg", car_colors[color_index]);
             image_src_size = [55,25];
             image_src_offset = [0,-25];
 
@@ -3064,26 +3073,6 @@ function addPosition(position) {
                     weight: 3,
                 })
             ];
-        }
-        else if(vcallsign == "XX") {
-            vehicle_type = "xmark";
-            image_src = host_url + markers_url + "balloon-xmark.png";
-            image_src_size = [48,38];
-            image_src_offset = [0,-38];
-
-            xmarkIcon = new L.icon({
-                iconUrl: image_src,
-                iconSize: image_src_size,
-                iconAnchor: [24, 18],
-            });
-
-            marker = new L.Marker(point, {
-                icon: xmarkIcon,
-                title: vcallsign,
-                zIndexOffset: Z_CAR,
-            });
-
-            marker.addTo(map);
         } else {
             vehicle_type = "balloon";
             let colorHash = 0;
@@ -3096,9 +3085,7 @@ function addPosition(position) {
                 // All the balloon are red.
                 color_index = 0;
             }
-
-            image_src = host_url + markers_url + "balloon-" +
-                        ((vcallsign == "PIE") ? "rpi" : balloon_colors_name[color_index]) + ".png";
+            image_src = recolorSVG(host_url + markers_url + "balloon.svg", balloon_colors[color_index]);
             image_src_size = [46,84];
             image_src_offset = [-35,-46];
 
@@ -3143,7 +3130,7 @@ function addPosition(position) {
             };
 
             marker.shadow = marker_shadow;
-            marker.balloonColor = (vcallsign == "PIE") ? "rpi" : balloon_colors_name[color_index];
+            marker.balloonColor = balloon_colors[color_index];
             marker.mode = 'balloon';
             marker.setMode = function(mode) {
                 if(this.mode == mode) return;
@@ -3156,9 +3143,9 @@ function addPosition(position) {
                     map.removeLayer(vehicle.subhorizon_circle);
                     map.removeLayer(vehicle.horizon_circle_title);
                     map.removeLayer(vehicle.subhorizon_circle_title);
-
+                    img_src = recolorSVG(host_url + markers_url + "payload.svg", this.balloonColor);
                     img = new L.icon ({
-                        iconUrl: host_url + markers_url + "payload-" + this.balloonColor + ".png",
+                        iconUrl: img_src,
                         iconSize: [17,18],
                         iconAnchor: [8,14],
                         tooltipAnchor: [0,-20],
@@ -3174,15 +3161,17 @@ function addPosition(position) {
                     }
 
                     if(mode == "parachute") {
+                        img_src = recolorSVG(host_url + markers_url + "parachute.svg", this.balloonColor);
                         img = new L.icon ({
-                            iconUrl: host_url + markers_url + "parachute-" + this.balloonColor + ".png",
+                            iconUrl: img_src,
                             iconSize: [46,84],
                             tooltipAnchor: [0,-98],
                             iconAnchor: [23,90],
                         });
                     } else {
+                        img_src = recolorSVG(host_url + markers_url + "balloon.svg", this.balloonColor);
                         img = new L.icon ({
-                            iconUrl: host_url + markers_url + "balloon-" + this.balloonColor + ".png",
+                            iconUrl: img_src,
                             iconSize: [46,84],
                             tooltipAnchor: [0,-98],
                             iconAnchor: [23,90],
@@ -3290,6 +3279,11 @@ function addPosition(position) {
                     color: balloon_colors[color_index],
                     opacity: 1,
                     weight: 3,
+                }),
+                new L.Polyline(point, {
+                    color: "#fff",
+                    opacity: 0.6,
+                    weight: 6,
                 })
             ];
         }
@@ -3401,11 +3395,13 @@ function addPosition(position) {
         vehicle_info.kill = function() {
             $(".vehicle"+vehicle_info.uuid).remove();
             potentialobjects = [marker, marker_shadow, landing_marker, horizon_circle, horizon_circle_title, subhorizon_circle, subhorizon_circle_title, polyline];
-            if (map.hasLayer(vehicle_info["prediction_polyline"])) { 
-                map.removeLayer(vehicle_info["prediction_polyline"]);
+            if (map.hasLayer(vehicle_info["prediction_polyline"][0])) { 
+                map.removeLayer(vehicle_info["prediction_polyline"][0]);
+                map.removeLayer(vehicle_info["prediction_polyline"][1]);
             }
-            if (map.hasLayer(vehicle_info["prediction_launch_polyline"])) { 
-                map.removeLayer(vehicle_info["prediction_launch_polyline"]);
+            if (map.hasLayer(vehicle_info["prediction_launch_polyline"][0])) { 
+                map.removeLayer(vehicle_info["prediction_launch_polyline"][0]);
+                map.removeLayer(vehicle_info["prediction_launch_polyline"][1]);
             }
             if (map.hasLayer(vehicle_info["prediction_target"])) { 
                 map.removeLayer(vehicle_info["prediction_target"]);
@@ -4640,7 +4636,7 @@ function updateRecoveryMarker(recovery) {
       html = "
"; html += "
"+recovery.serial+(recovery.recovered ? " Recovered" : " Not Recovered")+"
"; html += "
"; - html += "
 "+roundNumber(recovery.lat, 5) + ', ' + roundNumber(recovery.lon, 5)+"
"; + html += "
 "+format_coordinates(recovery.lat, recovery.lon, recovery.serial)+"
"; var imp = offline.get('opt_imperial'); var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(recovery.alt)) : parseInt(recovery.alt)).toLocaleString("us"); @@ -4752,7 +4748,7 @@ function updateRecoveryPane(r){ html += "
"; html += "
"+r[i].serial+(r[i].recovered ? " Recovered by " : " Not Recovered by ")+r[i].recovered_by+"
"; - html += "
 "+roundNumber(lat, 5) + ', ' + roundNumber(lon, 5)+"
"; + html += "
 "+format_coordinates(lat, lon, r[i].serial)+"
"; var imp = offline.get('opt_imperial'); var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(alt)) : parseInt(alt)).toLocaleString("us"); diff --git a/service-worker.js b/service-worker.js index fc7d456..e82d2a4 100644 --- a/service-worker.js +++ b/service-worker.js @@ -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',