node-red-contrib-web-worldmap 2.21.8 → 2.21.9

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/README.md CHANGED
@@ -11,6 +11,7 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.21.9 - Unbreak Drawing layer that I must have broken recently
14
15
  - v2.21.8 - Let SIDC/icon short code be only 4 chars long
15
16
  - v2.21.5 - Fix handling of "old" ship nav to ship navigation
16
17
  - v2.21.4 - Fix speed leader length. Add transparentPixels option..
@@ -29,13 +30,6 @@ map web page for plotting "things" on.
29
30
  - v2.16.3 - Ensure polygons can be deleted.
30
31
  - v2.16.2 - Better handling of unpacked kmz objects.
31
32
  - v2.16.0 - Allow specifying custom base map server.
32
- - v2.15.8 - Adjust ui check timing for UI worldmap.
33
- - v2.15.7 - Tidy up geoJson handling a bit more.
34
- - v2.15.5 - Fix SIDC icons to accept unicoded icons as labels.
35
- - v2.15.4 - Let clear heatmap command do what it says.
36
- - v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
37
- - v2.15.0 - Let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
38
- - v2.14.0 - Let geojson features be clickable if added as overlay.
39
33
 
40
34
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
41
35
 
@@ -464,6 +458,13 @@ Or with an input box
464
458
  contextmenu: '<input name="slide1" type="range" min="1" max="100" value="50" onchange=\'feedback(this.name,this.value,"myEventName")\' >'
465
459
  }
466
460
 
461
+ Example simple form
462
+
463
+ ```
464
+ [{"id":"7351100bacb1f5fe","type":"function","z":"4aa2ed2fd1b11362","name":"","func":"msg.payload = { command: {\ncontextmenu: String.raw`\nText <input type=\"text\" id=\"sometext\" value=\"hello\"><br/>\nNumber <input type=\"number\" id=\"somenum\" value=\"5\"><br/>\n<input type=\"button\" value=\"Send\" onclick=\n'feedback(\"myform\",{\n \"st\":document.getElementById(\"sometext\").value,\n \"sn\":document.getElementById(\"somenum\").value,\n})'\n>\n`\n}}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":360,"wires":[["a6a82f2e8efc44fc"]]},{"id":"7b595f0c8f6ac710","type":"worldmap in","z":"4aa2ed2fd1b11362","name":"","path":"/worldmap","events":"connect","x":195,"y":360,"wires":[["7351100bacb1f5fe"]]}]
465
+ ```
466
+
467
+
467
468
  See the section on **Utility Functions** for details of the feedback function.
468
469
 
469
470
  #### To add and remove a legend
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.21.8",
3
+ "version": "2.21.9",
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",
@@ -28,7 +28,10 @@ var heat;
28
28
  var minimap;
29
29
  var sidebyside;
30
30
  var layercontrol;
31
+ var drawControl;
31
32
  var drawingColour = "#910000";
33
+ var sendRoute;
34
+ var sendDrawing;
32
35
 
33
36
  var iconSz = {
34
37
  "Team/Crew": 24,
@@ -930,7 +933,7 @@ var addOverlays = function(overlist) {
930
933
  overlays["drawing"] = layers["_drawing"];
931
934
  map.options.drawControlTooltips = false;
932
935
  var drawCount = 0;
933
- var drawControl = new L.Control.Draw({
936
+ drawControl = new L.Control.Draw({
934
937
  draw: {
935
938
  polyline: { shapeOptions: { clickable:true } },
936
939
  marker: false,
@@ -996,7 +999,7 @@ var addOverlays = function(overlist) {
996
999
  setTimeout(function() {map.openPopup(rightmenuMarker)},25);
997
1000
  });
998
1001
 
999
- var sendDrawing = function(n) {
1002
+ sendDrawing = function(n) {
1000
1003
  var thing = document.getElementById('dinput').value;
1001
1004
  map.closePopup();
1002
1005
  shape.m.name = thing;
@@ -1079,7 +1082,7 @@ var addOverlays = function(overlist) {
1079
1082
  return numbers;
1080
1083
  }
1081
1084
 
1082
- var sendRoute = function(n) {
1085
+ sendRoute = function(n) {
1083
1086
  var p = (polygons[n]._latlngs.map(function(x) {
1084
1087
  return x.lng+","+x.lat;
1085
1088
  })).join(';');