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 = "
" +
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',