Skip to content

Commit c0433ce

Browse files
committed
Pickup SOG earlier in chain
1 parent 47a37bf commit c0433ce

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Change Log for Node-RED Worldmap
22

3+
- v5.5.3 - ensure SOG gets picked up earlier in chain
34
- v5.5.2 - Slight improvement for on/offline choice of map
45
- v5.5.1 - Fix maxNativeZoom for pmtiles to pull from tiles files. Issue #312
56
- v5.5.0 - Add ability to load raster pmtiles files. Issue #312

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A <a href="https://nodered.org" target="mapinfo">Node-RED</a> node to provide a
1010

1111
### Updates
1212

13+
- v5.5.3 - ensure SOG gets picked up earlier in chain
1314
- v5.5.2 - Slight improvement for on/offline choice of map
1415
- v5.5.1 - Fix maxNativeZoom for pmtiles to pull from tiles files. Issue #312
1516
- v5.5.0 - Add ability to load raster pmtiles files. Issue #312

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-web-worldmap",
3-
"version": "5.5.2",
3+
"version": "5.5.3",
44
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
55
"dependencies": {
66
"@turf/bezier-spline": "~7.2.0",

worldmap/worldmap.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,9 @@ function setMarker(data) {
18281828

18291829
if (data.draggable === true) { drag = true; }
18301830

1831+
if (data.sog) { data.speed = data.sog * 0.514444; data.sog = data.sog + " kt"; } // SOG is in knots
1832+
if (data.SOG) { data.speed = data.SOG * 0.514444; data.SOG = data.SOG + " kt"; } // SOG is in knots
1833+
18311834
if (data.hasOwnProperty("icon")) {
18321835
var dir = parseFloat(data.track ?? data.hdg ?? data.heading ?? data.bearing ?? "0") + map.getBearing();
18331836
var siz = 32;
@@ -1845,6 +1848,7 @@ function setMarker(data) {
18451848
});
18461849
marker.setHeading(dir);
18471850
q = 'https://www.bing.com/images/search?q='+data.icon+'%20%2B"'+encodeURIComponent(data["name"])+'"';
1851+
if (data?.IMO) { q = 'https://www.bing.com/images/search?q='+data.IMO; }
18481852
words += '<a href=\''+q+'\' target="_thingpic">Pictures</a><br>';
18491853
}
18501854
else if (data.icon === "plane") {
@@ -2249,8 +2253,6 @@ function setMarker(data) {
22492253
data.alt = +(parseFloat(data.altm)).toFixed(2) + " m";
22502254
delete data.altm;
22512255
}
2252-
if (data.sog) { data.speed = data.sog * 0.514444; data.sog = data.sog + " kt"; } // SOG is in knots
2253-
if (data.SOG) { data.speed = data.SOG * 0.514444; data.SOG = data.SOG + " kt"; } // SOG is in knots
22542256

22552257
// remove items from list of properties, then add all others to popup
22562258
if (data.hasOwnProperty("options")) { delete data.options; }
@@ -3140,7 +3142,7 @@ function doCommand(cmd) {
31403142
// if (cmd.hasOwnProperty("panlock") && lockit === true) { doLock(true); }
31413143

31423144
if (cmd.hasOwnProperty("zoomLevels")) {
3143-
if (Array.isArray(cmd.zoomLevels) && cmd?.zoomLevels.length > 0) {
3145+
if (Array.isArray(cmd.zoomLevels) && cmd.zoomLevels.length > 0) {
31443146
map.options.zooms = cmd.zoomLevels;
31453147
}
31463148
else { delete map.options.zooms; }

0 commit comments

Comments
 (0)