node-red-contrib-web-worldmap 4.3.1 → 4.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v4.3.2 - Fix geojson popup missing label name.
3
4
  - v4.3.1 - Small fix to icon transparency, and routing detail.
4
5
  - v4.3.0 - Add support for PMtiles files.
5
6
  - v4.2.1 - Revert use of optional chaining to extend life slightly. Issue #252
package/README.md CHANGED
@@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
13
13
 
14
14
  ### Updates
15
15
 
16
+ - v4.3.2 - Fix geojson popup missing label name.
16
17
  - v4.3.1 - Small fix to icon transparency, and routing detail.
17
18
  - v4.3.0 - Add support for PMtiles files.
18
19
  - v4.2.1 - Revert use of optional chaining to extend life slightly. Issue #252
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
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": "~6.5.0",
@@ -117,7 +117,7 @@ console.log("CONNECT TO",location.pathname + 'socket');
117
117
 
118
118
  var handleData = function(data) {
119
119
  if (Array.isArray(data)) {
120
- //console.log("ARRAY");
120
+ //console.log("ARRAY:",data.length);
121
121
  for (var prop in data) {
122
122
  if (data[prop].command) { doCommand(data[prop].command); delete data[prop].command; }
123
123
  if (data[prop].hasOwnProperty("name")) {
@@ -1716,8 +1716,16 @@ function setMarker(data) {
1716
1716
  delete data.position;
1717
1717
  ll = new L.LatLng((data.lat*1), (data.lon*1));
1718
1718
  }
1719
- else if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon")) { ll = new L.LatLng((data.lat*1), (data.lon*1)); }
1720
- else if (data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) { ll = new L.LatLng((data.latitude*1), (data.longitude*1)); }
1719
+ else if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon")) {
1720
+ if (isNaN(data.lat*1)) { console.log("Invalid lat: lat:",data.lat, " - lon:",data.lon); return; }
1721
+ if (isNaN(data.lon*1)) { console.log("Invalid lon: lat:",data.lat, " - lon:",data.lon); return; }
1722
+ ll = new L.LatLng((data.lat*1), (data.lon*1));
1723
+ }
1724
+ else if (data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) {
1725
+ if (isNaN(data.latitude*1)) { console.log("Invalid latitude: lat:",data.latitude, " - lon:",data.longitude); return; }
1726
+ if (isNaN(data.longitude*1)) { console.log("Invalid longitude: lat:",data.latitude, " - lon:",data.longitude); return; }
1727
+ ll = new L.LatLng((data.latitude*1), (data.longitude*1));
1728
+ }
1721
1729
  else {
1722
1730
  // console.log("No location:",data);
1723
1731
  return;
@@ -2128,6 +2136,7 @@ function setMarker(data) {
2128
2136
  // remove items from list of properties, then add all others to popup
2129
2137
  if (data.hasOwnProperty("options")) { delete data.options; }
2130
2138
  if (data.hasOwnProperty("icon")) { delete data.icon; }
2139
+ if (data.hasOwnProperty("iconSize")) { delete data.iconSize; }
2131
2140
  if (data.hasOwnProperty("iconColor")) { delete data.iconColor; }
2132
2141
  if (data.hasOwnProperty("photourl")) {
2133
2142
  words += "<img src=\"" + data.photourl + "\" style=\"max-width:100%; max-height:250px; margin-top:10px;\"><br/>";
@@ -3143,7 +3152,9 @@ function doGeojson(n,g,l,o) { // name, geojson, layer, options
3143
3152
  delete tx["name"];
3144
3153
  tx = JSON.stringify(tx,null,' ');
3145
3154
  if ( tx !== "{}") {
3146
- l.bindPopup('<b>'+n+'</b><pre style="overflow-x:scroll">'+tx.replace(/[\{\}"]/g,'')+'</pre>');
3155
+ var gp = '<pre style="overflow-x:scroll">'+tx.replace(/[\{\}"]/g,'')+'</pre>'
3156
+ if (n) { gp = '<b>'+n+'</b>' + gp; }
3157
+ l.bindPopup(gp);
3147
3158
  }
3148
3159
  }
3149
3160
  if (o && o.hasOwnProperty("clickable") && o.clickable === true) {