From f4785585c5f2aecb6feb4e18ca645cc2f54b2743 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 12 Apr 2020 17:11:08 +0200 Subject: [PATCH] change outline approach, use one path per SVG only add C130/4 prop icon, use it for A400 as well. --- html/markers.js | 66 ++++++++++++++++++++++++++++----------------- html/planeObject.js | 8 +++--- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/html/markers.js b/html/markers.js index 4629d30..1bd887c 100644 --- a/html/markers.js +++ b/html/markers.js @@ -5,58 +5,69 @@ // FA icons let shapes = { 'airliner': { - svg: 'airliner_live', - size: [25,26] + svg: 'airliner_live', + size: [32,32] }, 'balloon': { - svg: 'balloon_live', + svg: 'balloon_live', size: [9,13], noRotate: true }, 'cessna': { - svg: 'cessna_live', - size: [22,16] + svg: 'cessna_live', + size: [32,32] }, 'heavy_2e': { - svg: 'heavy_2e_live', + svg: 'heavy_2e_live', size: [28,29] }, //MD Series //MD11 - Standard Scale 63px, 3in4 Non-linear Scale 53px 'md11': { - svg: 'md11_live', - size: [36,31] + svg: 'md11_live', + size: [36,31], + strokeScale: 1.8, + }, + // C130 from https://discussions.flightaware.com/ads-b-flight-tracking-f21/some-custom-svg-plane-icons-t37783.html + // by Peter Lowden + // licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) + 'c130': { + svg: 'md11_live', + size: [36,31], + strokeScale: 1.8, }, 'heavy_4e': { - svg: 'heavy_4e_live', + svg: 'heavy_4e_live', size: [28,30] }, 'helicopter': { - svg: 'helicopter_live', - size: [16,18] + svg: 'helicopter_live', + size: [32,34], + strokeScale: 1.1, }, 'hi_perf': { - svg: 'hi_perf_live', + svg: 'hi_perf_live', size: [15,21] }, 'single_turbo': { - svg: 'single_turbo', + svg: 'single_turbo', size: [18,18] }, 'jet_nonswept': { - svg: 'jet_nonswept_live', + svg: 'jet_nonswept_live', size: [22,22] }, 'jet_swept': { - svg: 'jet_swept_live', + svg: 'jet_swept_live', size: [18,24] }, 'twin_large': { - svg: 'twin_large_live', - size: [21,20] + svg: 'twin_large_live', + size: [21,20], + strokeScale: 0.9, }, 'twin_small': { - svg: 'twin_small_live', + svg: 'twin_small_live', size: [21,18] }, 'ground_emergency': { @@ -73,12 +84,13 @@ let shapes = { }, 'ground_fixed': { svg: 'fixed_dark', - size: [12, 12] + size: [12, 12], + noRotate: true, }, 'unknown': { - svg: 'unknown_live', - size: [17,17] - } + svg: 'unknown_live', + size: [22,22] + }, } let TypeDesignatorIcons = { @@ -267,7 +279,10 @@ let TypeDesignatorIcons = { 'YK28': ['hi_perf', 1], // 'BE20': [_b200, 1], - // 'C130': [_c130, 1], + 'C130': ['c130', 1], + 'C30J': ['c130', 1], + + 'A400': ['c130', 1.15], // 'GND': ['ground_unknown', 1], 'GRND': ['ground_unknown', 1], @@ -301,8 +316,9 @@ let TypeDescriptionIcons = { 'L3J-H': ['md11', 1], // > 136t - 'L4T-M': ['heavy_4e', 0.84], - 'L4T-H': ['heavy_4e', 1], + 'L4T-M': ['c130', 1], + 'L4T-H': ['c130', 1.15], + 'L4J-H': ['heavy_4e' , 1], }; diff --git a/html/planeObject.js b/html/planeObject.js index d22ce16..253603d 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -706,10 +706,10 @@ PlaneObject.prototype.updateIcon = function() { if (!this.baseMarker) console.log(baseMarkerKey); } - let outline = (this.shape != 'md11') ? - ' stroke="'+OutlineADSBColor+'" stroke-width="0.4px"' : - ' stroke="'+OutlineADSBColor+'" stroke-width="2px"'; - let add_stroke = (this.selected && !SelectedAllPlanes && !onlySelected) ? outline : ''; + let strokeScale = this.baseMarker.strokeScale ? this.baseMarker.strokeScale : 1; + let outline = ' stroke="'+OutlineADSBColor+'" stroke-width="' + 0.65 * strokeScale + 'px"'; + let select_outline = ' stroke="'+OutlineADSBColor+'" stroke-width="' + 1.35 * strokeScale + 'px"'; + let add_stroke = (this.selected && !SelectedAllPlanes && !onlySelected) ? select_outline : outline; this.scale = scaleFactor * this.baseScale; let svgKey = col + '!' + this.shape + '!' + add_stroke;