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:
- Windy API for the meteorological basemap (built on Leaflet).
- SweetAlert2 for dialogs, alerts, and table-like inputs.
- Plotly for data visualization and charts.
- Fontawesome icon library.
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.- 0 WINDY : The map used is Windy. Provide excellent Wind representation.
- 1 OSM : The map used is OpenStreeMap with OpenSeaMap adds. Provide excellent navigation map. Wind is represented with Meteo barbules.
- 2 LOCAL : The map is a geojson map. See annex to produce such map, with geojson ports from SHOM. Wind is represented with Meteo barbules.
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:
- The HTML/CSS files you are reading, stored in the directory
www/doc, - documentation generated by the command
jsdoc *.js
4. Files
html and css
| File | Comment |
|---|---|
| index.html | Entry point. Menu definitions |
| Er3help.html | User Help in English |
| Fr3help.html | Aide Utilisateur en français |
| r3ServerTechDoc.html | Server Side Technical Documentation and API Description. |
| r3ClientTechDoc.html | Client Side Technical Documentation (the file you are reading). |
| r3.css | Main CSS elements. |
| r3help.css | CSS for Er3help.html, Fr3help.html, r3ServerTechDoc.html and r3ClientTechDoc.html. |
| r3par.css | CSS for r3par.js, imported via r3.html. |
| launch.css | CSS for launch.js, imported via r3.html. |
| polygon.css | CSS for polygon.js, imported via r3.html. |
| stamina.css | CSS for stamina.js, imported via r3.html. |
JavaScript files
| File | Comment |
|---|---|
| init.js | Init when loading and choosse between windy, OSM or geojson map |
| r3.js | Main application code. |
| r3param.js | Global parameters to adjust. |
| r3par.js | Parameters UI. Associated with r3par.css. |
| aisgps.js | AIS and GPS handling. To be used with the C plugin aisgpsserver. |
| feedback.js | User feedback submission. |
| filedump.js | File fump management. |
| launch.js | Routing launch dialog. |
| marks.js | Marks coming from Virtual Regatta dashboard Management. |
| meters.js | Mesurement on map (orthodromic and cap). |
| polygon.js | Manage polygons for forbidden zones. |
| ports.js | List of ports for tides. |
| r3besttime.js | Select the best departure time. |
| r3displaycomp.js | Display and manage competitors. CSV import supported for Virtual Regatta. |
| r3grib.js | Display of GRIB metadata. |
| r3polar.js | Select, display, and export polars. |
| r3routereport.js | Route display (route-gram), route export, and export of isoDesc (isochrone metadata). |
| r3routinglaunch.js | Run the routing. |
| r3util.js | Utilities (helpInfo, initialization). |
| util.js | Utility for conversions and time handling. |
| r3waypoints.js | Display waypoints and geodesic calculations (great-circle, rhumb line). |
| stamina.js | Manage stamina/energy for Virtual Regatta. |
| wind.js | Draw 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