Rcube

1. Introduction

The RCube client is a standard web front end built with HTML, CSS, and JavaScript. Most of the application logic is written in JavaScript and communicates with the server through a JSON API using native fetch.

A C plugin named aisgpsserver is available on the server side to retrieve AIS and GPS information (see the server technical annex for details).

The client uses the following libraries:

Notes & Recommendations:

Use a modern browser (ES2018+) so modules and fetch work reliably.

Windy / Leaflet layers may require Internet access and valid API keys.

2. Maps

Three different modes and behavior depend on global variable mapMode.

Note that WINDY and OSM modes require Internet connectivity from browser/server.

LOCAL mode is less rich for the map, but does no require internet connectivity if the client and the server are on the same machine (or local network)

3. Documentation

The documentation consists of:

4. Files

html and css

Files and actions
FileComment
index.htmlEntry point. Menu definitions
Er3help.htmlUser Help in English
Fr3help.htmlAide Utilisateur en français
r3ServerTechDoc.htmlServer Side Technical Documentation and API Description.
r3ClientTechDoc.htmlClient Side Technical Documentation (the file you are reading).
r3.cssMain CSS elements.
r3help.cssCSS for Er3help.html, Fr3help.html, r3ServerTechDoc.html and r3ClientTechDoc.html.
r3par.cssCSS for r3par.js, imported via r3.html.
launch.cssCSS for launch.js, imported via r3.html.
polygon.cssCSS for polygon.js, imported via r3.html.
stamina.cssCSS for stamina.js, imported via r3.html.

JavaScript files

Files and actions
FileComment
init.jsInit when loading and choosse between windy, OSM or geojson map
r3.jsMain application code.
r3param.jsGlobal parameters to adjust.
r3par.jsParameters UI. Associated with r3par.css.
aisgps.jsAIS and GPS handling. To be used with the C plugin aisgpsserver.
feedback.jsUser feedback submission.
filedump.jsFile fump management.
launch.jsRouting launch dialog.
marks.jsMarks coming from Virtual Regatta dashboard Management.
meters.jsMesurement on map (orthodromic and cap).
polygon.jsManage polygons for forbidden zones.
ports.jsList of ports for tides.
r3besttime.jsSelect the best departure time.
r3displaycomp.jsDisplay and manage competitors. CSV import supported for Virtual Regatta.
r3grib.jsDisplay of GRIB metadata.
r3polar.jsSelect, display, and export polars.
r3routereport.jsRoute display (route-gram), route export, and export of isoDesc (isochrone metadata).
r3routinglaunch.jsRun the routing.
r3util.jsUtilities (helpInfo, initialization).
util.jsUtility for conversions and time handling.
r3waypoints.jsDisplay waypoints and geodesic calculations (great-circle, rhumb line).
stamina.jsManage stamina/energy for Virtual Regatta.
wind.jsDraw wind barbules when OpenStreetMap mode (not Windy) is used.

Directory "out"

Contains the files produced by JSDoc. The entry point is out/index.html.

Coding conventions

ESLint is used to check the code

package.json and eslint.config.js define the behavior.

Annex: GeoJson files

LOCAL mode use GeoJson files.

Map

The map is generated from a shapefile.
ogr2ogr -f GeoJSON \
  land_europe_w_clip.geojson \
  land_polygons.shp \
  -clipsrc -20 35 2 55

ports

Ifremer proposes an official list of martime french ports.

https://sextant.ifremer.fr/geonetwork/srv/api/records/5498d7d1-1fee-4bcf-a0aa-9c57fd29d667?utm_source=chatgpt.com

Links

JSDoc

Windy API

Leaflet Library

SweetAlert2 (swal2)

Plotly

Fontawesome