node-red-contrib-web-worldmap 5.5.2 → 5.5.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v5.5.4 - slight tweak to geojson property display as table
4
+ - v5.5.3 - ensure SOG gets picked up earlier in chain
3
5
  - v5.5.2 - Slight improvement for on/offline choice of map
4
6
  - v5.5.1 - Fix maxNativeZoom for pmtiles to pull from tiles files. Issue #312
5
7
  - v5.5.0 - Add ability to load raster pmtiles files. Issue #312
package/README.md CHANGED
@@ -10,6 +10,8 @@ A <a href="https://nodered.org" target="mapinfo">Node-RED</a> node to provide a
10
10
 
11
11
  ### Updates
12
12
 
13
+ - v5.5.4 - slight tweak to geojson property display as table
14
+ - v5.5.3 - ensure SOG gets picked up earlier in chain
13
15
  - v5.5.2 - Slight improvement for on/offline choice of map
14
16
  - v5.5.1 - Fix maxNativeZoom for pmtiles to pull from tiles files. Issue #312
15
17
  - v5.5.0 - Add ability to load raster pmtiles files. Issue #312
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "5.5.2",
3
+ "version": "5.5.4",
4
4
  "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
5
5
  "dependencies": {
6
6
  "@turf/bezier-spline": "~7.2.0",
@@ -1828,6 +1828,9 @@ function setMarker(data) {
1828
1828
 
1829
1829
  if (data.draggable === true) { drag = true; }
1830
1830
 
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
+
1831
1834
  if (data.hasOwnProperty("icon")) {
1832
1835
  var dir = parseFloat(data.track ?? data.hdg ?? data.heading ?? data.bearing ?? "0") + map.getBearing();
1833
1836
  var siz = 32;
@@ -1845,6 +1848,7 @@ function setMarker(data) {
1845
1848
  });
1846
1849
  marker.setHeading(dir);
1847
1850
  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; }
1848
1852
  words += '<a href=\''+q+'\' target="_thingpic">Pictures</a><br>';
1849
1853
  }
1850
1854
  else if (data.icon === "plane") {
@@ -2249,8 +2253,6 @@ function setMarker(data) {
2249
2253
  data.alt = +(parseFloat(data.altm)).toFixed(2) + " m";
2250
2254
  delete data.altm;
2251
2255
  }
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
2254
2256
 
2255
2257
  // remove items from list of properties, then add all others to popup
2256
2258
  if (data.hasOwnProperty("options")) { delete data.options; }
@@ -3140,7 +3142,7 @@ function doCommand(cmd) {
3140
3142
  // if (cmd.hasOwnProperty("panlock") && lockit === true) { doLock(true); }
3141
3143
 
3142
3144
  if (cmd.hasOwnProperty("zoomLevels")) {
3143
- if (Array.isArray(cmd.zoomLevels) && cmd?.zoomLevels.length > 0) {
3145
+ if (Array.isArray(cmd.zoomLevels) && cmd.zoomLevels.length > 0) {
3144
3146
  map.options.zooms = cmd.zoomLevels;
3145
3147
  }
3146
3148
  else { delete map.options.zooms; }
@@ -3253,6 +3255,9 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
3253
3255
  delete feature.properties["fill-opacity"];
3254
3256
  delete feature.properties["font-color"];
3255
3257
  delete feature.properties["font-opacity"];
3258
+ // delete feature.properties["styleUrl"];
3259
+ delete feature.properties["styleHash"];
3260
+ delete feature.properties["styleMapHash"];
3256
3261
  }
3257
3262
  if (feature.hasOwnProperty("style")) {
3258
3263
  //console.log("GSTYLE", feature.style)
@@ -3336,12 +3341,21 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
3336
3341
  delete tx["_gpxType"];
3337
3342
  var n = tx["name"];
3338
3343
  delete tx["name"];
3339
- tx = JSON.stringify(tx,null,' ');
3340
- if ( tx !== "{}") {
3341
- var gp = '<pre style="overflow-x:scroll">'+tx.replace(/[\{\}"]/g,'')+'</pre>'
3342
- if (n) { gp = '<b>'+n+'</b>' + gp; }
3343
- l.bindPopup(gp);
3344
- }
3344
+ var tx2 = Object.entries(tx);
3345
+ var gp = '<table style="border:none;">';
3346
+ for (var i=0; i < tx2.length; i++) {
3347
+ gp += '<tr><td style="border:none; vertical-align:top; padding-right:3px;">'+tx2[i][0]+'</td><td style="border:none; vertical-align:top;">'+tx2[i][1]+'</td></tr>';
3348
+ }
3349
+ gp += '</table>';
3350
+ //tx = JSON.stringify(tx,null,' ');
3351
+ // if ( tx !== "{}") {
3352
+ // //var gp = '<pre style="overflow-x:scroll">'+tx.replace(/[\{\}"]/g,'')+'</pre>'
3353
+ // var gp = '<pre>'+tx.replace(/[\{\}"]/g,'')+'</pre>'
3354
+ // if (n) { gp = '<b>'+n+'</b>' + gp; }
3355
+ // l.bindPopup(gp);
3356
+ // }
3357
+ if (n) { gp = '<b>'+n+'</b>' + gp; }
3358
+ if (gp.length > 36) { l.bindPopup(gp); }
3345
3359
  }
3346
3360
  if (o && o.hasOwnProperty("clickable") && o.clickable === true) {
3347
3361
  l.on('click', function (e) {