@sailingrotevista/rotevista-dash 7.0.28 → 7.0.29

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/weather-radar.js +22 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sailingrotevista/rotevista-dash",
3
- "version": "7.0.28",
3
+ "version": "7.0.29",
4
4
  "description": "Wind Dashboard with navigation and course aids",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
package/weather-radar.js CHANGED
@@ -279,14 +279,25 @@ function renderRadar() {
279
279
  const pt = polarToCartesian(200, 200, radiusAnello1, angleTarget);
280
280
 
281
281
  const led = document.createElementNS("http://www.w3.org/2000/svg", "circle");
282
- led.setAttribute("cx", pt.x.toFixed(1));
283
- led.setAttribute("cy", pt.y.toFixed(1));
284
- led.setAttribute("r", "5.5");
285
- led.setAttribute("fill", meteoColor);
286
- led.setAttribute("class", "is-trending");
287
- led.setAttribute("filter", "url(#radar-center-glow)");
288
- ringsContainer.appendChild(led);
289
- }
290
- }
291
- }
292
- }
282
+ led.setAttribute("cx", pt.x.toFixed(1));
283
+ led.setAttribute("cy", pt.y.toFixed(1));
284
+ led.setAttribute("r", "5.5");
285
+ led.setAttribute("fill", meteoColor);
286
+ led.setAttribute("class", "is-trending");
287
+ led.setAttribute("filter", "url(#radar-center-glow)");
288
+ ringsContainer.appendChild(led);
289
+ }
290
+ }
291
+ }
292
+
293
+ // ROTAZIONE TATTICA BARCA (North-Up Alignment)
294
+ // Orientiamo l'icona della barca in base alla Prua Vera (HDG)
295
+ const boatIcon = document.getElementById('radar-boat-icon');
296
+ if (boatIcon && typeof store !== 'undefined' && store.raw) {
297
+ const hdgRad = store.raw["navigation.headingTrue"] !== undefined ? store.raw["navigation.headingTrue"] : 0;
298
+ const hdgDeg = Math.round(radToDeg(hdgRad));
299
+
300
+ // Applicazione della rotazione centrata sull'asse (200, 200) dell'SVG
301
+ boatIcon.setAttribute("transform", `rotate(${hdgDeg}, 200, 200) translate(0, 5)`);
302
+ }
303
+ }