From 59a90e352cb07a7f3eb2ae7c2d284a3e0030293d Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Sun, 3 Aug 2025 11:53:55 +0200 Subject: [PATCH] Add tooltips for preplot layers --- .../source/src/views/MapTooltipsMixin.vue | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/lib/www/client/source/src/views/MapTooltipsMixin.vue b/lib/www/client/source/src/views/MapTooltipsMixin.vue index 95b3eba..28ae474 100644 --- a/lib/www/client/source/src/views/MapTooltipsMixin.vue +++ b/lib/www/client/source/src/views/MapTooltipsMixin.vue @@ -20,6 +20,8 @@ export default { return this.eventLogTooltip(args); } else if (args?.layer?.id == "pplp" || args?.layer?.id == "pslp") { return this.preplotPointsTooltip(args); + } else if (args?.layer?.id == "ppll" || args?.layer?.id == "psll") { + return this.preplotLinesTooltip(args); } else if (args?.layer?.id == "plan") { return this.plannedLinesTooltip(args); } else if (args?.layer?.id == "seqrl" || args?.layer?.id == "seqfl") { @@ -30,23 +32,54 @@ export default { }, preplotPointsTooltip (args) { - const p = args?.object?.properties; - const isSailline = args?.layer?.id == "psl"; + const p = args?.object; if (p) { - let html = `${isSailline ? "Sail" : "Preplot"} line ${p.line} (${p.incr ? "+" : "-"})`; - if (p.ntba) { - html += ` NTBA`; + let html = "Preplot
\n"; + + if ("sailline" in p) { + // If there is a "sailline" attribute, this is actually a source line + // "i" is the source line number, "sailline" the sail line number. + html += `S${String(p.i).padStart(4, "0")}
\n`; + html += `V${String(p.sailline).padStart(4, "0")}
\n`; + } else { + html += `V${String(p.i).padStart(4, "0")}
\n`; } - if (p.remarks) { - html += `
\n${p.remarks}`; + html += `P${String(p.j).padStart(4, "0")}
\n`; + + if (p.sailline_ntba) { + html += `Line NTBA
\n`; } - const style = { "max-width": "50ex"}; + if (p.ntba) { + html += `Point NTBA
\n`; + } return {html, style: this.tooltipDefaultStyle}; } }, + preplotLinesTooltip (args) { + const p = args?.object?.properties; + if (p) { + const lineType = args.layer.id == "psll" ? "Sailline" : "Source line"; + const direction = p.incr ? "▲" : "▼"; + let html = ""; + + html += `L${String(p.line).padStart(4, "0")} ${direction}
\n`; + html += `${lineType}
\n`; + + if (p.ntba) { + html += "Not to be acquired (NTBA)
\n"; + } + + if (p.remarks) { + html += `
\n${this.$root.markdown(p.remarks)}\n`; + } + + return {html, style: this.tooltipDefaultStyle}; + } + }, + sequenceLinesTooltip (args) { let type; switch(args.layer.id) {