feat: Great Circle predictor#365
Conversation
The upstream formatLineDashArray() split the SVG string char-by-char, which works for single-digit values but would break for any entry ≥ 10 (e.g. '12 4' → [1, 2, 4] instead of [12, 4]). Replace with a DASH_PATTERNS lookup table (exported from util.ts; might also be moved somewhere else if better suited) that maps named patterns directly to number arrays, removing the fragile parsing. lineDashMap in AppFacade now derives SVG strings from the same table. Also tightens LineStyleConfig.dash from string to LineStyleDash.
Otherwise, thick line segments bleed into the gaps
Add LineStyleConfig (color/weight/dash) for three route-related lines: - activeRoute — the currently-navigated route (was hardcoded blue/4/solid) - activeSegment — the active route leg (XTE reference track) - defaultRoute — all other displayed routes (was hardcoded green/2/dashed) - destination — vessel-to-next-waypoint bearing line (was hardcoded orange/2/solid)
Replace the upstream plain \`length: number\` with \`lineLength: ILineLengthDef\` supporting three unit kinds: - 'time' — minutes at current SOG (original COG behaviour) - 'distance' — nautical miles (original heading behaviour) - 'pixels' — fixed screen pixels at current map resolution
Add selfTrailStyle and aisTrackStyle settings (color, weight, dash pattern) for the self vessel trail and AIS target tracks, using the existing linestyle-select component.
0417da0 to
4b0e70c
Compare
|
Interesting new feature! Do you think, you can apply the concept of the great-circle curve to the lines of the measurement module as well? When measuring, at the moment straight lines are shown. Having the great-circle-curve there as well would be great. |
|
If this PR seeks to implement a great-circle predictor for the vessel's current path then let's only include the required changes required to enact that. |
Do you want me to change the PR? The idea behind stacking this PR on top of #361 is to avoid merge conflicts and build the great-circle predictor with flexible linestyles (and because #361 is more important to me personally). If you'd prefer to sort out the conflicts later, I can separate the PRs. #363 got already merged. The dependency to #364 got already removed. Also feel free to do small amendments on this PR's branch if you want. You should have writing access. Having said this, this PR brings two commits on top of #361:
|
Yes, I think that should be possible. But it depends on this project's plan whether great-circles are interesting. I figured this PR is a first test for that. On a side note, I also started building an experimental chart plotter with a slightly different approach (MapLibre) and goal (web + native) where great-circle is the default. |
|
Can you fix the merge conflicts when you have time so I can have a closer look? |
|
@joelkoz, thanks for looking into this and the other PRs! I'll update them as soon as I have time. |
This PR builts on top of #361 (and transitively #363) and #364.
This PR adds a Great Circle predictor to the vessel lines. It shows what lies "straight ahead" in a circle around the globe.