node-red-contrib-web-worldmap 2.37.2 → 2.37.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
+ - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
4
+ - v2.37.3 - Fix hang on layer change
3
5
  - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
4
6
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
5
7
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
package/README.md CHANGED
@@ -11,6 +11,8 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
15
+ - v2.37.3 - Fix hang on layer change
14
16
  - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
15
17
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
16
18
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
@@ -421,13 +423,15 @@ Optional properties include
421
423
  - **zoomlock** - locks the zoom control to the current value and removes zoom control - `{"command":{"zoomlock":true}}`
422
424
  - **hiderightclick** - disables the right click that allows adding or deleting points on the map - `{"command":{"hiderightclick":true}}`
423
425
  - **coords** - turns on and off a display of the current mouse co-ordinates. Values can be "deg", "dms", or "none" (default). - `{"command":{"coords":"deg"}}`
424
- - **showruler** - turns on and off a display of the ruler control. Values can be "true" or "false". - `{"command":{"showruler":true}}`
426
+ - **showruler** - turns on and off a display of the ruler control. Values can be "true" or "false". - `{"command": {"ruler": {"showruler": true}}}`
425
427
  - **button** - if supplied with a `name` and `icon` property - adds a button to provide user input - sends
426
428
  a msg `{"action":"button", "name":"the_button_name"}` to the worldmap in node. If supplied with a `name` property only, it will remove the button. Optional `position` property can be 'bottomright', 'bottomleft', 'topleft' or 'topright' (default). button can also be an array of button objects.
427
429
  - **contextmenu** - html string to define the right click menu when not on a marker. Defaults to the simple add marker input. Empty string `""` disables this right click.
428
430
  - **toptitle** - Words to replace title in title bar (if not in iframe)
429
431
  - **toplogo** - URL to logo image for top tile bar (if not in iframe) - ideally 60px by 24px.
430
432
  - **trackme** - Turns on/off the browser self locating. Boolean false = off, true = cyan circle showing accuracy error, or an object like `{"command":{"trackme":{"name":"Dave","icon":"car","iconColor":"blue","layer":"mytrack","accuracy":false}}}`. Usual marker options can be applied.
433
+ - **showmenu** - Show or hide the display of the hamberger menu control in the top right . Values can be "show" or "hide". - `{"command":{"showmenu: "hide"}}`
434
+ - **showlayers** - Show or hide the display of selectable layers. Does not control the display of an individual layer, rather a users ability to interact with them. Values can be "show" or "hide". - `{"command":{"showlayers: "hide"}}`
431
435
 
432
436
  #### To switch layer, move map and zoom
433
437
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.37.2",
3
+ "version": "2.37.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": "~6.5.0",
@@ -389,7 +389,7 @@ var edgeAware = function() {
389
389
 
390
390
  var viewBounds = L.latLngBounds(map.options.crs.pointToLatLng(L.point(pSW.x - (pCenter.x - pSW.x ), pSW.y - (pCenter.y - pSW.y )), map.getZoom()) , map.options.crs.pointToLatLng(L.point(pNE.x + (pNE.x - pCenter.x) , pNE.y + (pNE.y - pCenter.y) ), map.getZoom()) );
391
391
  for (var id in markers) {
392
- if (allData[id].hasOwnProperty("SIDC")) {
392
+ if (allData[id] && allData[id].hasOwnProperty("SIDC")) {
393
393
  markerLatLng = markers[id].getLatLng();
394
394
  if ( viewBounds.contains(markerLatLng) && !mapBounds.contains(markerLatLng) ) {
395
395
  var k = (markerLatLng.lat - mapBoundsCenter.lat) / (markerLatLng.lng - mapBoundsCenter.lng);
package/worldmap.js CHANGED
@@ -120,6 +120,7 @@ module.exports = function(RED) {
120
120
  });
121
121
  node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
122
122
  }
123
+
123
124
  node.on('input', function(msg) {
124
125
  if (!msg.hasOwnProperty("payload")) { node.warn("Missing payload"); return; }
125
126
  if (msg.hasOwnProperty("_sessionid")) {
@@ -134,7 +135,7 @@ module.exports = function(RED) {
134
135
  }
135
136
  }
136
137
  }
137
- if (msg.payload.hasOwnProperty("name")) {
138
+ if (msg.payload.hasOwnProperty("name") && !msg.hasOwnProperty("_sessionid")) {
138
139
  allPoints[msg.payload.name] = RED.util.cloneMessage(msg.payload);
139
140
  var t = node.maxage || 3600;
140
141
  if (msg.payload.ttl && msg.payload.ttl < t) { t = msg.payload.ttl; }