signalk-mareas-ihm 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ Plugin de Signal K que convierte tu OpenPlotter / Raspberry Pi en un **visor com
30
30
  - **El grado de abrigo se ajusta automáticamente** cuando la ola medida supera la prevista.
31
31
 
32
32
  #### Visor de fondeo
33
- - **Mapa Leaflet** con posición GPS en tiempo real y capas múltiples (ESRI, Bing, Google, IHM S-52, SonarChart, MBTiles offline).
33
+ - **Mapa Leaflet** con posición GPS en tiempo real y capas múltiples (ESRI, Bing, Google, IHM S-52, Batimetría, MBTiles offline).
34
34
  - **Anchor Watch** con alarma de garreo visual y sonora.
35
35
  - **Cadena largada** con slider bidireccional y cálculo automático (métodos tradicional y Vicente).
36
36
  - **Radio de borneo y alarma** con etiquetas en la carta y predicción según marea.
@@ -138,7 +138,7 @@ Signal K plugin that turns your OpenPlotter / Raspberry Pi into a **complete anc
138
138
  - **Shelter grade auto-adjusts** when measured wave exceeds forecast.
139
139
 
140
140
  #### Anchor watch viewer
141
- - **Leaflet map** with real-time GPS position and multiple layers (ESRI, Bing, Google, IHM S-52, SonarChart, offline MBTiles).
141
+ - **Leaflet map** with real-time GPS position and multiple layers (ESRI, Bing, Google, IHM S-52, Bathymetry, offline MBTiles).
142
142
  - **Anchor Watch** with visual and audible drag alarm.
143
143
  - **Chain deployed** with bidirectional slider and automatic calculation (traditional and Vicente methods).
144
144
  - **Swing and alarm radius** with chart labels and tide-aware prediction.
package/dist/README.md CHANGED
@@ -30,7 +30,7 @@ Plugin de Signal K que convierte tu OpenPlotter / Raspberry Pi en un **visor com
30
30
  - **El grado de abrigo se ajusta automáticamente** cuando la ola medida supera la prevista.
31
31
 
32
32
  #### Visor de fondeo
33
- - **Mapa Leaflet** con posición GPS en tiempo real y capas múltiples (ESRI, Bing, Google, IHM S-52, SonarChart, MBTiles offline).
33
+ - **Mapa Leaflet** con posición GPS en tiempo real y capas múltiples (ESRI, Bing, Google, IHM S-52, Batimetría, MBTiles offline).
34
34
  - **Anchor Watch** con alarma de garreo visual y sonora.
35
35
  - **Cadena largada** con slider bidireccional y cálculo automático (métodos tradicional y Vicente).
36
36
  - **Radio de borneo y alarma** con etiquetas en la carta y predicción según marea.
@@ -138,7 +138,7 @@ Signal K plugin that turns your OpenPlotter / Raspberry Pi into a **complete anc
138
138
  - **Shelter grade auto-adjusts** when measured wave exceeds forecast.
139
139
 
140
140
  #### Anchor watch viewer
141
- - **Leaflet map** with real-time GPS position and multiple layers (ESRI, Bing, Google, IHM S-52, SonarChart, offline MBTiles).
141
+ - **Leaflet map** with real-time GPS position and multiple layers (ESRI, Bing, Google, IHM S-52, Bathymetry, offline MBTiles).
142
142
  - **Anchor Watch** with visual and audible drag alarm.
143
143
  - **Chain deployed** with bidirectional slider and automatic calculation (traditional and Vicente methods).
144
144
  - **Swing and alarm radius** with chart labels and tide-aware prediction.
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "2.1.0",
3
- "timestamp": "20260602-0142",
2
+ "version": "2.1.2",
3
+ "timestamp": "20260609-0141",
4
4
  "gitHash": null,
5
5
  "gitDirty": true,
6
- "builtAt": "2026-06-01T23:42:06.561Z"
6
+ "builtAt": "2026-06-08T23:41:36.818Z"
7
7
  }
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ function isPositionValue(v) {
49
49
  // timestamp + git hash so we can verify exactly which build is running on the Pi
50
50
  // without ambiguity. ("¿Qué versión tengo deployada?" → /api/paths or landing.)
51
51
  const PLUGIN_VERSION = esmRequire("../package.json").version;
52
- const PLUGIN_REVISION = "Rev292";
52
+ const PLUGIN_REVISION = "Rev313";
53
53
  let _buildInfo = null;
54
54
  try {
55
55
  _buildInfo = esmRequire("./build-info.json");
@@ -3465,12 +3465,12 @@ export default function (app) {
3465
3465
  res.status(500).send("Tile read error");
3466
3466
  }
3467
3467
  });
3468
- // ── Navionics SonarChart proxy (CORS bypass) ──
3469
- let _navTokenCache = null;
3470
- const NAV_TTL = 5 * 60 * 1000; // 5 minutes
3471
- function fetchNavTokens() {
3472
- if (_navTokenCache && (Date.now() - _navTokenCache.ts < NAV_TTL)) {
3473
- return Promise.resolve({ token: _navTokenCache.token, bearer: _navTokenCache.bearer });
3468
+ // ── Batimetría proxy (CORS bypass para servidor de tiles externo) ──
3469
+ let _chTokenCache = null;
3470
+ const CHART_TOKEN_TTL = 5 * 60 * 1000; // 5 minutes
3471
+ function fetchChartTokens() {
3472
+ if (_chTokenCache && (Date.now() - _chTokenCache.ts < CHART_TOKEN_TTL)) {
3473
+ return Promise.resolve({ token: _chTokenCache.token, bearer: _chTokenCache.bearer });
3474
3474
  }
3475
3475
  return new Promise((resolve, reject) => {
3476
3476
  const req = https.get("https://maps.garmin.com/marine/api/getNavionicsTokens", {
@@ -3485,7 +3485,7 @@ export default function (app) {
3485
3485
  const bearer = j.access_token || "";
3486
3486
  if (!token)
3487
3487
  return reject(new Error("No token"));
3488
- _navTokenCache = { token, bearer, ts: Date.now() };
3488
+ _chTokenCache = { token, bearer, ts: Date.now() };
3489
3489
  resolve({ token, bearer });
3490
3490
  }
3491
3491
  catch (e) {
@@ -3499,7 +3499,7 @@ export default function (app) {
3499
3499
  }
3500
3500
  expressApp.get("/signalk-mareas-ihm/api/nav-token", async (_req, res) => {
3501
3501
  try {
3502
- const t = await fetchNavTokens();
3502
+ const t = await fetchChartTokens();
3503
3503
  res.json(t);
3504
3504
  }
3505
3505
  catch (e) {
@@ -3508,9 +3508,9 @@ export default function (app) {
3508
3508
  });
3509
3509
  expressApp.get("/signalk-mareas-ihm/navtiles/:z/:x/:y.png", async (req, res) => {
3510
3510
  try {
3511
- const { token, bearer } = await fetchNavTokens();
3511
+ const { token, bearer } = await fetchChartTokens();
3512
3512
  const z = req.params.z, x = req.params.x, y = req.params.y;
3513
- const layer = req.query.layer || "1"; // 0=SeaChart, 1=SonarChart
3513
+ const layer = req.query.layer || "1"; // 0=SeaChart, 1=Bathymetry
3514
3514
  const tileUrl = `https://tile1.navionics.com/viewer/api/v1/tile/${z}/${x}/${y}?config=${token}&transparent=true&ugc=true&layer=${layer}&du=1&sd=2&sa=false`;
3515
3515
  const tileReq = https.get(tileUrl, {
3516
3516
  headers: {