Skip to content

feat: Great Circle predictor#365

Open
daniel-freiermuth wants to merge 7 commits into
SignalK:masterfrom
daniel-freiermuth:feat-great-circle-new
Open

feat: Great Circle predictor#365
daniel-freiermuth wants to merge 7 commits into
SignalK:masterfrom
daniel-freiermuth:feat-great-circle-new

Conversation

@daniel-freiermuth

Copy link
Copy Markdown
Contributor

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.

Screenshot From 2026-04-18 14-52-08

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.
@chris0348

Copy link
Copy Markdown

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.

@panaaj

panaaj commented May 24, 2026

Copy link
Copy Markdown
Member

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.

@daniel-freiermuth

daniel-freiermuth commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

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:

@daniel-freiermuth

Copy link
Copy Markdown
Contributor Author

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.

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.

@joelkoz

joelkoz commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Can you fix the merge conflicts when you have time so I can have a closer look?

@daniel-freiermuth

Copy link
Copy Markdown
Contributor Author

@joelkoz, thanks for looking into this and the other PRs! I'll update them as soon as I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants