node-red-contrib-web-worldmap 5.1.2 → 5.1.3

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
+ - v5.1.3 - Fix clearlayer for tracks node.
3
4
  - v5.1.2 - Fix for longer line msg properties.
4
5
  - v5.1.1 - Fix CoT inline image.
5
6
  - v5.1.0 - Let special icons be sizeable using iconSize property.
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
+ - v5.1.3 - Fix clearlayer for tracks node.
16
17
  - v5.1.2 - Fix for longer line msg properties.
17
18
  - v5.1.1 - Fix CoT inline image.
18
19
  - v5.1.0 - Let special icons be sizeable using iconSize property.
@@ -25,27 +26,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
25
26
  - v5.0.2 - Fix sidcEdgeIcon docs PR#289.
26
27
  - v5.0.1 - Fix isArray error PR #288.
27
28
  - v5.0.0 - v5.0.0 - Feedback cleanup PR#281, edgeicons option PR#287, bump libs for vuln fixes.
28
- - v4.9.0 - If payload.flag is two char ISO code replace it with flag emoji. Revert part of PR #271
29
- - v4.8.1 - Slight tidy of some of the geojson handling
30
- - v4.8.0 - Merged PR for feedback functionality cleanup and example. PR #271 and #272
31
- - v4.7.0 - Update pmtiles library, fix feedback function inconsistency. Issue #270
32
- - v4.6.5 - Let geojson allow for generic overrides with .icon and .layer.
33
- - v4.6.4 - Fix deletion of layers logic to actually fully remove points.
34
- - v4.6.3 - Fix sending of layer events when not wanted. Issue #262
35
- - v4.6.2 - Fix multiple use of contextmenu feedback. Issue #259
36
- - v4.6.1 - Let default pmtiles be light/dark or monocolored.
37
- - v4.5.2 - Tidy up when pmtiles removed.
38
- - v4.5.0 - Fix pmtiles to look for maps in userdir rather than modules
39
- - v4.4.0 - Add quad(copter) drone icon.
40
- - v4.3.3 - Fix for objects changing layers.
41
- - v4.3.2 - Fix geojson popup missing label name.
42
- - v4.3.1 - Small fix to icon transparency, and routing detail.
43
- - v4.3.0 - Add support for PMtiles files.
44
- - v4.2.1 - Revert use of optional chaining to extend life slightly. Issue #252
45
- - v4.2.0 - Let icons also be inline images data:image...
46
- - v4.1.0 - Add optional SOG, COG, altft, altm input properties.
47
- - v4.0.0 - Breaking - Better context menu variable substitution and retention
48
- Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus.
29
+
49
30
 
50
31
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
51
32
 
@@ -723,7 +704,7 @@ There are some internal functions available to make interacting with Node-RED ea
723
704
 
724
705
  - **addToForm()** : takes a property name value pair to add to a variable called `form`. When used with contextmenu feedback (above) you can set the feedback value to `"_form"` to substitute this accumulated value. This allows you to do things like `onBlur='addToForm(this.name,this.value)'` over several different fields in the menu and then use `feedback(this.name,"_form")` to submit them all at once. For example a simple multiple line form could be as per the example below:
725
706
 
726
- Also if you wish to retain the values between separate openings of this form you can assign property names to the value field in the form `value="${foo}`, etc. These will then appear as part of an **value** property on the worldmap-in node message.
707
+ Retain Values - If you wish to retain the values between separate openings of this form you can assign property names to the value field in the form `value="${foo}`, etc. These will then appear as part of an **value** property on the worldmap-in node message.
727
708
 
728
709
  ```
729
710
  var menu = 'Add some data <input name="foo" value="${foo}" onchange=\'addToForm(this.name,this.value)\'></input><br/>'
@@ -732,6 +713,23 @@ menu += '<button name="my_form" onclick=\'feedback(this.name,"_form","formAction
732
713
  msg.payload = { command: { "contextmenu":menu } }
733
714
  ```
734
715
 
716
+ Custom Feedback Content - The example below shows how you can pass the latitude and longitude location value from the contextmenu popup when right clicking the map. You can also use this method with other data you wish.
717
+
718
+ ```
719
+ var menu ='<center><br/>';
720
+ menu += 'Add some data <input type="text" id="foo" placeholder="foo"><br/>';
721
+ menu += 'Add more data <input type="text" id="bar" placeholder="bar"><br/>';
722
+ menu += '<input type="button" value="Submit" onclick=';
723
+ menu += '\'feedback("myform",{';
724
+ menu += '"foo":document.getElementById("foo").value,';
725
+ menu += '"bar":document.getElementById("bar").value,';
726
+ menu += '"lat":rclk.lat.toFixed(12),';
727
+ menu += '"lon":rclk.lng.toFixed(12),';
728
+ menu += '},"formAction",true)\' > <br/><br/> ';
729
+ msg.payload = { command: { "contextmenu":menu } }
730
+ ```
731
+ For a more detailed example flow using this method see: [Moving Icons Demo & Builder](https://github.com/dceejay/RedMap/blob/master/examples/Moving%20Icons%20Demo%20%26%20Builder.json)
732
+
735
733
  - **delMarker()** : takes the name of the marker as a parameter. In a popup this can be specified as `${name}` for dynamic substitution.
736
734
 
737
735
  - **editPoly()** : takes the name of the shape or line as a parameter. In a popup this can be specified as `${name}` for dynamic substitution.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
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",
package/worldmap.js CHANGED
@@ -494,7 +494,7 @@ module.exports = function(RED) {
494
494
  }
495
495
  }
496
496
  if (msg.payload?.command?.clear) {
497
- if (!isArray(msg.payload?.command?.clear)) {
497
+ if (!Array.isArray(msg.payload?.command?.clear)) {
498
498
  msg.payload.command.clear = [ msg.payload.command.clear ]
499
499
  }
500
500
  msg.payload.command.clear.forEach(function(el) {
@@ -508,7 +508,7 @@ module.exports = function(RED) {
508
508
  })
509
509
  }
510
510
  if (msg.payload?.command?.clearlayer) {
511
- if (!isArray(msg.payload?.command?.clearlayer)) {
511
+ if (!Array.isArray(msg.payload?.command?.clearlayer)) {
512
512
  msg.payload.command.clearlayer = [ msg.payload.command.clearlayer ]
513
513
  }
514
514
  msg.payload.command.clearlayer.forEach(function(el) {