node-red-contrib-web-worldmap 5.1.1 → 5.1.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
+ - v5.1.2 - Fix for longer line msg properties.
3
4
  - v5.1.1 - Fix CoT inline image.
4
5
  - v5.1.0 - Let special icons be sizeable using iconSize property.
5
6
  - v5.0.9 - Slight tidy on flags, bump turf dep.
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.2 - Fix for longer line msg properties.
16
17
  - v5.1.1 - Fix CoT inline image.
17
18
  - v5.1.0 - Let special icons be sizeable using iconSize property.
18
19
  - v5.0.9 - Slight tidy on flags, bump turf dep.
@@ -27,25 +27,10 @@
27
27
  "mapurl": "",
28
28
  "mapopt": "",
29
29
  "mapwms": false,
30
- "x": 1840,
31
- "y": 820,
30
+ "x": 1760,
31
+ "y": 920,
32
32
  "wires": []
33
33
  },
34
- {
35
- "id": "be0f2591062868c9",
36
- "type": "worldmap in",
37
- "z": "f6f2187d.f17ca8",
38
- "name": "",
39
- "path": "/worldmap",
40
- "events": "connect,disconnect,point,layer,bounds,files,draw,other",
41
- "x": 140,
42
- "y": 900,
43
- "wires": [
44
- [
45
- "9a57374d6e27c511"
46
- ]
47
- ]
48
- },
49
34
  {
50
35
  "id": "9a57374d6e27c511",
51
36
  "type": "switch",
@@ -88,8 +73,8 @@
88
73
  "checkall": "true",
89
74
  "repair": false,
90
75
  "outputs": 6,
91
- "x": 340,
92
- "y": 900,
76
+ "x": 260,
77
+ "y": 1000,
93
78
  "wires": [
94
79
  [
95
80
  "47bd2da7d8d032c5"
@@ -117,8 +102,8 @@
117
102
  "z": "f6f2187d.f17ca8",
118
103
  "name": "Map Context Menu (1; 2; 3; 4; 5)",
119
104
  "info": "",
120
- "x": 610,
121
- "y": 760,
105
+ "x": 530,
106
+ "y": 860,
122
107
  "wires": []
123
108
  },
124
109
  {
@@ -127,8 +112,8 @@
127
112
  "z": "f6f2187d.f17ca8",
128
113
  "name": "Add to Store (8)",
129
114
  "info": "",
130
- "x": 560,
131
- "y": 900,
115
+ "x": 480,
116
+ "y": 1000,
132
117
  "wires": []
133
118
  },
134
119
  {
@@ -143,8 +128,8 @@
143
128
  "initialize": "",
144
129
  "finalize": "",
145
130
  "libs": [],
146
- "x": 550,
147
- "y": 940,
131
+ "x": 470,
132
+ "y": 1040,
148
133
  "wires": [
149
134
  [
150
135
  "e6ebed7ef8df0dcd"
@@ -157,8 +142,8 @@
157
142
  "z": "f6f2187d.f17ca8",
158
143
  "name": "This example can be used as a marker builder.\\n It utilizes the map's context menu option to create a form for adding map elements,\\n displays the msg.payload value for the element creation, and generates the map icon. \\n The example also demonstrates the following Red Map features: \\n 1. Mapcontext menu/Object Cotextmenu\\n 2. Usage of input fields/HTML/JavaScript in context menus\\n 3. Different icon types for Red Map markers (use SIDC link to generate SIDC string)\\n 4. Attributes of Red Map markers\\n 5. Feedback function\\n 6. Usage of the map input node\\n 7. Delete Objects\\n 8. Store list of objects\\n 9. Moving Objects\\n Usage: Sample data loaded, rightclick to update values\\n create multiple objects using rightclick on the map,\\n copy the payload field into function or change nodes to inject the icon from the backend\\n rightclick on any object to update its attributes or delete it\\n (contextmenu popup will stay open to allow payload copy)",
159
144
  "info": "",
160
- "x": 860,
161
- "y": 320,
145
+ "x": 780,
146
+ "y": 420,
162
147
  "wires": []
163
148
  },
164
149
  {
@@ -173,8 +158,8 @@
173
158
  "initialize": "",
174
159
  "finalize": "",
175
160
  "libs": [],
176
- "x": 790,
177
- "y": 940,
161
+ "x": 710,
162
+ "y": 1040,
178
163
  "wires": [
179
164
  [
180
165
  "d49d5d6e6b436813"
@@ -193,8 +178,8 @@
193
178
  "stream": false,
194
179
  "addname": "",
195
180
  "property": "payload",
196
- "x": 1110,
197
- "y": 680,
181
+ "x": 1030,
182
+ "y": 780,
198
183
  "wires": [
199
184
  [
200
185
  "94ae7a702138b59e"
@@ -213,8 +198,8 @@
213
198
  "initialize": "",
214
199
  "finalize": "",
215
200
  "libs": [],
216
- "x": 560,
217
- "y": 1020,
201
+ "x": 480,
202
+ "y": 1120,
218
203
  "wires": [
219
204
  [
220
205
  "eb0a9d4569cf7b06"
@@ -233,8 +218,8 @@
233
218
  "initialize": "",
234
219
  "finalize": "",
235
220
  "libs": [],
236
- "x": 750,
237
- "y": 1040,
221
+ "x": 670,
222
+ "y": 1140,
238
223
  "wires": [
239
224
  [
240
225
  "d49d5d6e6b436813"
@@ -247,8 +232,8 @@
247
232
  "z": "f6f2187d.f17ca8",
248
233
  "name": "Input Node (6)",
249
234
  "info": "",
250
- "x": 170,
251
- "y": 840,
235
+ "x": 90,
236
+ "y": 940,
252
237
  "wires": []
253
238
  },
254
239
  {
@@ -257,8 +242,8 @@
257
242
  "z": "f6f2187d.f17ca8",
258
243
  "name": "Delete (from store)",
259
244
  "info": "",
260
- "x": 570,
261
- "y": 980,
245
+ "x": 490,
246
+ "y": 1080,
262
247
  "wires": []
263
248
  },
264
249
  {
@@ -267,8 +252,8 @@
267
252
  "z": "f6f2187d.f17ca8",
268
253
  "name": "Delete (From Map) (7)",
269
254
  "info": "",
270
- "x": 780,
271
- "y": 1000,
255
+ "x": 700,
256
+ "y": 1100,
272
257
  "wires": []
273
258
  },
274
259
  {
@@ -277,8 +262,8 @@
277
262
  "z": "f6f2187d.f17ca8",
278
263
  "name": "Move (9)",
279
264
  "info": "",
280
- "x": 1260,
281
- "y": 640,
265
+ "x": 1180,
266
+ "y": 740,
282
267
  "wires": []
283
268
  },
284
269
  {
@@ -293,8 +278,8 @@
293
278
  "initialize": "",
294
279
  "finalize": "",
295
280
  "libs": [],
296
- "x": 550,
297
- "y": 1100,
281
+ "x": 470,
282
+ "y": 1200,
298
283
  "wires": [
299
284
  [
300
285
  "d22c566910bce313"
@@ -307,8 +292,8 @@
307
292
  "z": "f6f2187d.f17ca8",
308
293
  "name": "Update Object Data",
309
294
  "info": "",
310
- "x": 570,
311
- "y": 1060,
295
+ "x": 490,
296
+ "y": 1160,
312
297
  "wires": []
313
298
  },
314
299
  {
@@ -323,8 +308,8 @@
323
308
  "initialize": "",
324
309
  "finalize": "",
325
310
  "libs": [],
326
- "x": 550,
327
- "y": 600,
311
+ "x": 470,
312
+ "y": 700,
328
313
  "wires": [
329
314
  [
330
315
  "e2852ab33b037f41"
@@ -348,8 +333,8 @@
348
333
  "topic": "",
349
334
  "payload": "",
350
335
  "payloadType": "date",
351
- "x": 370,
352
- "y": 600,
336
+ "x": 290,
337
+ "y": 700,
353
338
  "wires": [
354
339
  [
355
340
  "eaea660f91589f0d"
@@ -368,8 +353,8 @@
368
353
  "initialize": "",
369
354
  "finalize": "",
370
355
  "libs": [],
371
- "x": 530,
372
- "y": 1180,
356
+ "x": 450,
357
+ "y": 1280,
373
358
  "wires": [
374
359
  [
375
360
  "d22c566910bce313"
@@ -388,8 +373,8 @@
388
373
  "initialize": "",
389
374
  "finalize": "",
390
375
  "libs": [],
391
- "x": 780,
392
- "y": 1140,
376
+ "x": 700,
377
+ "y": 1240,
393
378
  "wires": [
394
379
  [
395
380
  "d49d5d6e6b436813"
@@ -402,8 +387,8 @@
402
387
  "z": "f6f2187d.f17ca8",
403
388
  "name": "Update Object Position",
404
389
  "info": "",
405
- "x": 580,
406
- "y": 1140,
390
+ "x": 500,
391
+ "y": 1240,
407
392
  "wires": []
408
393
  },
409
394
  {
@@ -412,8 +397,8 @@
412
397
  "z": "f6f2187d.f17ca8",
413
398
  "name": "Object Context Menu ",
414
399
  "info": "",
415
- "x": 1620,
416
- "y": 640,
400
+ "x": 1540,
401
+ "y": 740,
417
402
  "wires": []
418
403
  },
419
404
  {
@@ -436,8 +421,8 @@
436
421
  "from": "",
437
422
  "to": "",
438
423
  "reg": false,
439
- "x": 950,
440
- "y": 680,
424
+ "x": 870,
425
+ "y": 780,
441
426
  "wires": [
442
427
  [
443
428
  "d35078c8f9df08de"
@@ -461,8 +446,8 @@
461
446
  "topic": "",
462
447
  "payload": "",
463
448
  "payloadType": "date",
464
- "x": 370,
465
- "y": 680,
449
+ "x": 290,
450
+ "y": 780,
466
451
  "wires": [
467
452
  [
468
453
  "18568709ef76cce5"
@@ -495,8 +480,8 @@
495
480
  "from": "",
496
481
  "to": "",
497
482
  "reg": false,
498
- "x": 710,
499
- "y": 600,
483
+ "x": 630,
484
+ "y": 700,
500
485
  "wires": [
501
486
  []
502
487
  ]
@@ -516,8 +501,8 @@
516
501
  "checkall": "true",
517
502
  "repair": false,
518
503
  "outputs": 1,
519
- "x": 530,
520
- "y": 680,
504
+ "x": 450,
505
+ "y": 780,
521
506
  "wires": [
522
507
  [
523
508
  "41067c9c0c7f3268"
@@ -543,8 +528,8 @@
543
528
  "from": "",
544
529
  "to": "",
545
530
  "reg": false,
546
- "x": 550,
547
- "y": 860,
531
+ "x": 470,
532
+ "y": 960,
548
533
  "wires": [
549
534
  []
550
535
  ]
@@ -561,8 +546,8 @@
561
546
  "initialize": "",
562
547
  "finalize": "",
563
548
  "libs": [],
564
- "x": 1270,
565
- "y": 680,
549
+ "x": 1190,
550
+ "y": 780,
566
551
  "wires": [
567
552
  [
568
553
  "62537dafd11e7751"
@@ -578,10 +563,10 @@
578
563
  "fieldType": "msg",
579
564
  "format": "html",
580
565
  "syntax": "mustache",
581
- "template": "<b>Update Object Properties</b><br/><br/>\n<table id='addTable' style=\"width:100%;\">\n<tr><td>Layer</td><td><input type='text' id='inLay' placeholder='unknown' value='{{menu.layer}}' /></td></tr>\n<tr><td>Draggable</td><td><input type='checkbox' id='inDrag' name='inDrag' {{menu.drag}}></td></tr>\n<tr><td>Track</td><td><input type='text' id='inTrack' value='{{menu.track}}' /></td></tr>\n<tr><td>Speed</td><td><input type='text' id='inSpeed' value='{{menu.speed}}' /></td></tr>\n<tr><td>Alt</td><td><input type='text' id='inAlt' value='{{menu.alt}}' /></td></tr>\n<tr><td>Lat</td><td><input type='text' id='inLat' value='{{menu.lat}}' /></td></tr>\n<tr><td>Lon</td><td><input type='text' id='inLon' value='{{menu.lon}}'/></td></tr>\n<tr><td>Label</td><td><input type='text' id='inLabel' value='{{menu.label}}' /></td></tr>\n<tr><td><a href=\"https://www.spatialillusions.com/unitgenerator-legacy/\" target=\"_blank\">SIDC</a></td>\n<td><input type='text' id='inSIDC' value='{{menu.SIDC}}' /></td></tr>\n<tr><td>SIDC Options</td><td><input type='text' id='inOptions' value='{{menu.options}}' /></td></tr>\n<tr><td>Icon Category</td><td>{{{menu.categories}}}</td></tr>\n<tr><td>Icon</td><td>{{{menu.icons}}}</td></tr>\n<tr><td>iconColor</td><td><input type='text' id='inColor' value='{{menu.iconColor}}' /></td></tr>\n<tr><td>toolTip</td><td><input type='text' id='inTool' value='{{menu.tooltip}}' /></td></tr>\n<tr><td>Payload</td><td><div id='payload'></div></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' onclick=\n 'let _lat = document.getElementById(\"inLat\").value; _lat = parseFloat((_lat === \"\") ? rclk.lat.toFixed(6) : _lat);\n let _lon = document.getElementById(\"inLon\").value; _lon = parseFloat((_lon === \"\") ? rclk.lng.toFixed(6) : _lon);\n let _lay = document.getElementById(\"inLay\").value;\n let _drag = document.getElementById(\"inDrag\").checked;\n let _track = document.getElementById(\"inTrack\").value; _track = parseFloat((_track === \"\") ? 0 : _track);\n let _speed = document.getElementById(\"inSpeed\").value; _speed = parseFloat((_speed === \"\") ? 0 : _speed);\n let _alt = document.getElementById(\"inAlt\").value; _alt = parseFloat((_alt === \"\") ? 0 : _alt);\n let _icon = document.getElementById(\"iconsSelect\").value; _icon = (_icon === \"\") ? \"uav\" : _icon;\n let _label = document.getElementById(\"inLabel\").value || \"\";\n let _color = document.getElementById(\"inColor\").value || \"\";\n let _tool = document.getElementById(\"inTool\").value;\n let _sidc = document.getElementById(\"inSIDC\").value;\n let _sidcOptions;\n try {_sidcOptions = JSON.parse(document.getElementById(\"inOptions\").value);} catch(e) {_sidcOptions = \"\";}\n _sidcOptions = (_sidc === \"\") ? \"\" : _sidcOptions;\n for (let key in _sidcOptions) {if ((_sidcOptions[key] === \"\") || (_sidcOptions[key] === 0)) {delete _sidcOptions[key];}}\n _sidcOptions = (Object.keys(_sidcOptions).length === 0 ) ? \"\" : _sidcOptions;\n _icon = (_sidc !== \"\") ? \"\" : _icon;\n let _fbData = {\"layer\": _lay,\"draggable\": _drag,\"track\":_track,\"speed\":_speed,\"alt\":_alt,\"lat\":_lat,\"lon\":_lon,\"icon\":_icon,\"iconColor\":_color,\"tooltip\":_tool,\"label\":_label,\"SIDC\":_sidc,\"options\":_sidcOptions};\n for (let key in _fbData) {if (_fbData[key] === \"\") {delete _fbData[key];}}\n document.getElementById(\"payload\").innerHTML = JSON.stringify({\"name\" :\"{{payload.name}}\", ..._fbData},null,2);\n feedback(\"{{payload.name}}\",_fbData,\"updateObject\",false);'\n style='width: 100% !important;'>Update Object Data</button></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' style='width:100%;background-color: red; color: white;' onclick='feedback(\"{{payload.name}}\",\"\",\"drawdelete\",true);'>Delete Object</button></td></tr>\n</table>",
566
+ "template": "<b>Update Object Properties</b><br/><br/>\n<table id='addTable' style=\"width:100%;\">\n<tr><td>Layer</td><td><input type='text' id='inLay' placeholder='unknown' value='{{menu.layer}}' /></td></tr>\n<tr><td>Draggable</td><td><input type='checkbox' id='inDrag' name='inDrag' {{menu.drag}}></td></tr>\n<tr><td>Track</td><td><input type='text' id='inTrack' value='{{menu.track}}' /></td></tr>\n<tr><td>Speed</td><td><input type='text' id='inSpeed' value='{{menu.speed}}' /></td></tr>\n<tr><td>Alt</td><td><input type='text' id='inAlt' value='{{menu.alt}}' /></td></tr>\n<tr><td>Lat</td><td><input type='text' id='inLat' value='{{menu.lat}}' /></td></tr>\n<tr><td>Lon</td><td><input type='text' id='inLon' value='{{menu.lon}}'/></td></tr>\n<tr><td>Label</td><td><input type='text' id='inLabel' value='{{menu.label}}' /></td></tr>\n<tr><td><a href=\"https://www.spatialillusions.com/unitgenerator-legacy/\" target=\"_blank\">SIDC</a></td>\n<td><input type='text' id='inSIDC' value='{{menu.SIDC}}' /></td></tr>\n<tr><td>SIDC Options</td><td><input type='text' id='inOptions' value='{{menu.options}}' /></td></tr>\n<tr><td>Icon Category</td><td>{{{menu.categories}}}</td></tr>\n<tr><td>Icon</td><td>{{{menu.icons}}}</td></tr>\n<tr>\n <td>iconSize</td>\n <td><input type='text' id='inSize' value='{{menu.iconSize}}' /></td>\n</tr>\n<tr><td>iconColor</td><td><input type='text' id='inColor' value='{{menu.iconColor}}' /></td></tr>\n<tr><td>toolTip</td><td><input type='text' id='inTool' value='{{menu.tooltip}}' /></td></tr>\n<tr><td>Payload</td><td><div id='payload'></div></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' onclick=\n 'let _lat = document.getElementById(\"inLat\").value; _lat = parseFloat((_lat === \"\") ? rclk.lat.toFixed(6) : _lat);\n let _lon = document.getElementById(\"inLon\").value; _lon = parseFloat((_lon === \"\") ? rclk.lng.toFixed(6) : _lon);\n let _lay = document.getElementById(\"inLay\").value;\n let _drag = document.getElementById(\"inDrag\").checked;\n let _track = document.getElementById(\"inTrack\").value; _track = parseFloat((_track === \"\") ? 0 : _track);\n let _speed = document.getElementById(\"inSpeed\").value; _speed = parseFloat((_speed === \"\") ? 0 : _speed);\n let _alt = document.getElementById(\"inAlt\").value; _alt = parseFloat((_alt === \"\") ? 0 : _alt);\n let _icon = document.getElementById(\"iconsSelect\").value; _icon = (_icon === \"\") ? \"uav\" : _icon;\n let _label = document.getElementById(\"inLabel\").value || \"\";\n let _size = document.getElementById(\"inSize\").value || 32;\n let _color = document.getElementById(\"inColor\").value || \"\";\n let _tool = document.getElementById(\"inTool\").value;\n let _sidc = document.getElementById(\"inSIDC\").value;\n let _sidcOptions;\n try {_sidcOptions = JSON.parse(document.getElementById(\"inOptions\").value);} catch(e) {_sidcOptions = \"\";}\n _sidcOptions = (_sidc === \"\") ? \"\" : _sidcOptions;\n for (let key in _sidcOptions) {if ((_sidcOptions[key] === \"\") || (_sidcOptions[key] === 0)) {delete _sidcOptions[key];}}\n _sidcOptions = (Object.keys(_sidcOptions).length === 0 ) ? \"\" : _sidcOptions;\n _icon = (_sidc !== \"\") ? \"\" : _icon;\n let _fbData = {\"layer\": _lay,\"draggable\": _drag,\"track\":_track,\"speed\":_speed,\"alt\":_alt,\"lat\":_lat,\"lon\":_lon,\"icon\":_icon,\"iconSize\":_size,\"iconColor\":_color,\"tooltip\":_tool,\"label\":_label,\"SIDC\":_sidc,\"options\":_sidcOptions};\n for (let key in _fbData) {if (_fbData[key] === \"\") {delete _fbData[key];}}\n document.getElementById(\"payload\").innerHTML = JSON.stringify({\"name\" :\"{{payload.name}}\", ..._fbData},null,2);\n feedback(\"{{payload.name}}\",_fbData,\"updateObject\",false);'\n style='width: 100% !important;'>Update Object Data</button></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' style='width:100%;background-color: red; color: white;' onclick='feedback(\"{{payload.name}}\",\"\",\"drawdelete\",true);'>Delete Object</button></td></tr>\n</table>",
582
567
  "output": "str",
583
- "x": 1640,
584
- "y": 680,
568
+ "x": 1560,
569
+ "y": 780,
585
570
  "wires": [
586
571
  [
587
572
  "f83930ff.b21488"
@@ -593,15 +578,15 @@
593
578
  "type": "function",
594
579
  "z": "f6f2187d.f17ca8",
595
580
  "name": "Set Form Values",
596
- "func": "let icons = flow.get(\"iconsObject\");\nlet category = Object.keys(icons).find(key => icons[key].includes(msg.payload.icon));\nmsg.menu = {};\nmsg.menu.layer = msg.payload.layer;\nmsg.menu.drag = msg.payload.draggable === true ? \"checked\" : \"\";\nmsg.menu.track = msg.payload.track || 0;\nmsg.menu.speed = msg.payload.speed || 0;\nmsg.menu.alt = msg.payload.alt || 0;\nmsg.menu.lat = msg.payload.lat;\nmsg.menu.lon = msg.payload.lon;\nmsg.menu.label = msg.payload.label || \"\";\nmsg.menu.SIDC = msg.payload.SIDC || \"\";\nmsg.menu.options = JSON.stringify(msg.payload.options) || \"\";\nmsg.menu.categories = flow.get(\"categoriesSelect\").replace(category+\"\\\"\",category+\"\\\" selected\");\nmsg.menu.icons = flow.get(\"iconsSelect\").replace(msg.payload.icon+\"\\\"\",msg.payload.icon+\"\\\" selected\");;\nmsg.menu.iconColor = msg.payload.iconColor || \"\";\nmsg.menu.tooltip = msg.payload.tooltip || \"\";\n\n\n\n\nreturn msg;",
581
+ "func": "let icons = flow.get(\"iconsObject\");\nlet category = Object.keys(icons).find(key => icons[key].includes(msg.payload.icon));\nmsg.menu = {};\nmsg.menu.layer = msg.payload.layer;\nmsg.menu.drag = msg.payload.draggable === true ? \"checked\" : \"\";\nmsg.menu.track = msg.payload.track || 0;\nmsg.menu.speed = msg.payload.speed || 0;\nmsg.menu.alt = msg.payload.alt || 0;\nmsg.menu.lat = msg.payload.lat;\nmsg.menu.lon = msg.payload.lon;\nmsg.menu.label = msg.payload.label || \"\";\nmsg.menu.SIDC = msg.payload.SIDC || \"\";\nmsg.menu.options = JSON.stringify(msg.payload.options) || \"\";\nmsg.menu.categories = flow.get(\"categoriesSelect\").replace(category+\"\\\"\",category+\"\\\" selected\");\nmsg.menu.icons = flow.get(\"iconsSelect\").replace(msg.payload.icon+\"\\\"\",msg.payload.icon+\"\\\" selected\");\nmsg.menu.iconSize = msg.payload.iconSize || 32;\nmsg.menu.iconColor = msg.payload.iconColor || \"\";\nmsg.menu.tooltip = msg.payload.tooltip || \"\";\n\n\n\n\nreturn msg;",
597
582
  "outputs": 1,
598
583
  "timeout": 0,
599
584
  "noerr": 0,
600
585
  "initialize": "",
601
586
  "finalize": "",
602
587
  "libs": [],
603
- "x": 1440,
604
- "y": 680,
588
+ "x": 1360,
589
+ "y": 780,
605
590
  "wires": [
606
591
  [
607
592
  "f85ab8a742392a3c"
@@ -623,8 +608,8 @@
623
608
  "checkall": "true",
624
609
  "repair": false,
625
610
  "outputs": 1,
626
- "x": 1020,
627
- "y": 1040,
611
+ "x": 940,
612
+ "y": 1140,
628
613
  "wires": [
629
614
  [
630
615
  "f83930ff.b21488"
@@ -637,8 +622,8 @@
637
622
  "z": "f6f2187d.f17ca8",
638
623
  "name": "Redra cycle",
639
624
  "info": "",
640
- "x": 370,
641
- "y": 640,
625
+ "x": 290,
626
+ "y": 740,
642
627
  "wires": []
643
628
  },
644
629
  {
@@ -647,8 +632,8 @@
647
632
  "z": "f6f2187d.f17ca8",
648
633
  "name": "Init",
649
634
  "info": "",
650
- "x": 350,
651
- "y": 560,
635
+ "x": 270,
636
+ "y": 660,
652
637
  "wires": []
653
638
  },
654
639
  {
@@ -657,8 +642,8 @@
657
642
  "z": "f6f2187d.f17ca8",
658
643
  "name": "Immediate draw",
659
644
  "info": "",
660
- "x": 1020,
661
- "y": 1000,
645
+ "x": 940,
646
+ "y": 1100,
662
647
  "wires": []
663
648
  },
664
649
  {
@@ -680,8 +665,8 @@
680
665
  "from": "",
681
666
  "to": "",
682
667
  "reg": false,
683
- "x": 550,
684
- "y": 820,
668
+ "x": 470,
669
+ "y": 920,
685
670
  "wires": [
686
671
  [
687
672
  "68a4405c6a59ddd8"
@@ -697,10 +682,10 @@
697
682
  "fieldType": "msg",
698
683
  "format": "html",
699
684
  "syntax": "mustache",
700
- "template": "<b>Update Object Properties</b><br/><br/>\n<table id='addTable' style=\"width:100%;\">\n<tr><td>Name</td><td><input type='text' id='inName' value='' autofocus;/></td></tr>\n<tr><td>Layer</td><td><input type='text' id='inLay' placeholder='unknown' value='' /></td></tr>\n<tr><td>Draggable</td><td><input type='checkbox' id='inDrag' name='inDrag'></td></tr>\n<tr><td>Track</td><td><input type='text' id='inTrack' value=0 /></td></tr>\n<tr><td>Speed</td><td><input type='text' id='inSpeed' value=0 /></td></tr>\n<tr><td>Alt</td><td><input type='text' id='inAlt' value=0 /></td></tr>\n<tr><td>Lat</td><td><input type='text' id='inLat' placeholder='Value/Empty/dblClk' value='' ondblclick='this.value=rclk.lat.toFixed(6);' /></td></tr>\n<tr><td>Lon</td><td><input type='text' id='inLon' placeholder='Value/Empty/dblClk' value='' ondblclick='this.value=rclk.lng.toFixed(6);' /></td></tr>\n<tr><td>Label</td><td><input type='text' id='inLabel' value='' /></td></tr>\n<tr><td><a href=\"https://www.spatialillusions.com/unitgenerator-legacy/\" target=\"_blank\">SIDC</a></td>\n<td><input type='text' id='inSIDC' value='' /></td></tr>\n<tr><td>SIDC Options</td><td><input type='text' id='inOptions' value='{\"fillOpacity\":0,\"direction\":0,\"speed\":0,\"type\":\"\",\"infoSize\":0,\"infoFields\":\"\",\"staffComments\":\"\",\"altitudeDepth\":\"\",\"quantity\":0,\"additionalInformation\":\"\"}' /></td></tr>\n<tr><td>Icon Category</td><td>{{{flow.categoriesSelect}}}</td></tr>\n<tr><td>Icon</td><td>{{{flow.iconsSelect}}}</td></tr>\n<tr><td>iconColor</td><td><input type='text' id='inColor' value='' /></td></tr>\n<tr><td>toolTip</td><td><input type='text' id='inTool' value='' /></td></tr>\n<tr><td>Payload</td><td><div id='payload'></div></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' onclick=\n 'let _name = document.getElementById(\"inName\").value; _name = (_name === \"\") ? \"ID\"+Math.floor(Math.random() * 10000) : _name;\n let _lat = document.getElementById(\"inLat\").value; _lat = parseFloat((_lat === \"\") ? rclk.lat.toFixed(6) : _lat);\n let _lon = document.getElementById(\"inLon\").value; _lon = parseFloat((_lon === \"\") ? rclk.lng.toFixed(6) : _lon);\n let _lay = document.getElementById(\"inLay\").value;\n let _drag = document.getElementById(\"inDrag\").checked;\n let _track = document.getElementById(\"inTrack\").value; _track = parseFloat((_track === \"\") ? 0 : _track);\n let _speed = document.getElementById(\"inSpeed\").value; _speed = parseFloat((_speed === \"\") ? 0 : _speed);\n let _alt = document.getElementById(\"inAlt\").value; _alt = parseFloat((_alt === \"\") ? 0 : _alt);\n let _icon = document.getElementById(\"iconsSelect\").value; _icon = (_icon === \"\") ? \"uav\" : _icon;\n let _label = document.getElementById(\"inLabel\").value || \"\";\n let _color = document.getElementById(\"inColor\").value || \"\";\n let _tool = document.getElementById(\"inTool\").value;\n let _sidc = document.getElementById(\"inSIDC\").value;\n let _sidcOptions;\n try {_sidcOptions = JSON.parse(document.getElementById(\"inOptions\").value);} catch(e) {_sidcOptions = \"\";}\n _sidcOptions = (_sidc === \"\") ? \"\" : _sidcOptions;\n for (let key in _sidcOptions) {if ((_sidcOptions[key] === \"\") || (_sidcOptions[key] === 0)) {delete _sidcOptions[key];}}\n _sidcOptions = (Object.keys(_sidcOptions).length === 0 ) ? \"\" : _sidcOptions;\n _icon = (_sidc !== \"\") ? \"\" : _icon;\n let _fbData = {\"layer\": _lay,\"draggable\": _drag,\"track\":_track,\"speed\":_speed,\"alt\":_alt,\"lat\":_lat,\"lon\":_lon,\"icon\":_icon,\"iconColor\":_color,\"tooltip\":_tool,\"label\":_label,\"SIDC\":_sidc,\"options\":_sidcOptions};\n for (let key in _fbData) {if (_fbData[key] === \"\") {delete _fbData[key];}}\n document.getElementById(\"payload\").innerHTML = JSON.stringify({\"name\" :_name, ..._fbData},null,2);\n feedback(_name,_fbData,\"addObject\",false);'\n style='width: 100% !important;'>Add New Object</button></td></tr>\n</table>",
685
+ "template": "<b>Update Object Properties</b><br/><br/>\n<table id='addTable' style=\"width:100%;\">\n<tr><td>Name</td><td><input type='text' id='inName' value='' autofocus;/></td></tr>\n<tr><td>Layer</td><td><input type='text' id='inLay' placeholder='unknown' value='' /></td></tr>\n<tr><td>Draggable</td><td><input type='checkbox' id='inDrag' name='inDrag'></td></tr>\n<tr><td>Track</td><td><input type='text' id='inTrack' value=0 /></td></tr>\n<tr><td>Speed</td><td><input type='text' id='inSpeed' value=0 /></td></tr>\n<tr><td>Alt</td><td><input type='text' id='inAlt' value=0 /></td></tr>\n<tr><td>Lat</td><td><input type='text' id='inLat' placeholder='Value/Empty/dblClk' value='' ondblclick='this.value=rclk.lat.toFixed(6);' /></td></tr>\n<tr><td>Lon</td><td><input type='text' id='inLon' placeholder='Value/Empty/dblClk' value='' ondblclick='this.value=rclk.lng.toFixed(6);' /></td></tr>\n<tr><td>Label</td><td><input type='text' id='inLabel' value='' /></td></tr>\n<tr><td><a href=\"https://www.spatialillusions.com/unitgenerator-legacy/\" target=\"_blank\">SIDC</a></td>\n<td><input type='text' id='inSIDC' value='' /></td></tr>\n<tr><td>SIDC Options</td><td><input type='text' id='inOptions' value='{\"fillOpacity\":0,\"direction\":0,\"speed\":0,\"type\":\"\",\"infoSize\":0,\"infoFields\":\"\",\"staffComments\":\"\",\"altitudeDepth\":\"\",\"quantity\":0,\"additionalInformation\":\"\"}' /></td></tr>\n<tr><td>Icon Category</td><td>{{{flow.categoriesSelect}}}</td></tr>\n<tr><td>Icon</td><td>{{{flow.iconsSelect}}}</td></tr>\n<tr>\n <td>iconSize</td>\n <td><input type='text' id='inSize' value='' /></td>\n</tr>\n<tr><td>iconColor</td><td><input type='text' id='inColor' value='' /></td></tr>\n<tr><td>toolTip</td><td><input type='text' id='inTool' value='' /></td></tr>\n<tr><td>Payload</td><td><div id='payload'></div></td></tr>\n<tr><td></td><td><button id='addIcon' type='button' onclick=\n 'let _name = document.getElementById(\"inName\").value; _name = (_name === \"\") ? \"ID\"+Math.floor(Math.random() * 10000) : _name;\n let _lat = document.getElementById(\"inLat\").value; _lat = parseFloat((_lat === \"\") ? rclk.lat.toFixed(6) : _lat);\n let _lon = document.getElementById(\"inLon\").value; _lon = parseFloat((_lon === \"\") ? rclk.lng.toFixed(6) : _lon);\n let _lay = document.getElementById(\"inLay\").value;\n let _drag = document.getElementById(\"inDrag\").checked;\n let _track = document.getElementById(\"inTrack\").value; _track = parseFloat((_track === \"\") ? 0 : _track);\n let _speed = document.getElementById(\"inSpeed\").value; _speed = parseFloat((_speed === \"\") ? 0 : _speed);\n let _alt = document.getElementById(\"inAlt\").value; _alt = parseFloat((_alt === \"\") ? 0 : _alt);\n let _icon = document.getElementById(\"iconsSelect\").value; _icon = (_icon === \"\") ? \"uav\" : _icon;\n let _label = document.getElementById(\"inLabel\").value || \"\";\n let _size = document.getElementById(\"inSize\").value || 32;\n let _color = document.getElementById(\"inColor\").value || \"\";\n let _tool = document.getElementById(\"inTool\").value;\n let _sidc = document.getElementById(\"inSIDC\").value;\n let _sidcOptions;\n try {_sidcOptions = JSON.parse(document.getElementById(\"inOptions\").value);} catch(e) {_sidcOptions = \"\";}\n _sidcOptions = (_sidc === \"\") ? \"\" : _sidcOptions;\n for (let key in _sidcOptions) {if ((_sidcOptions[key] === \"\") || (_sidcOptions[key] === 0)) {delete _sidcOptions[key];}}\n _sidcOptions = (Object.keys(_sidcOptions).length === 0 ) ? \"\" : _sidcOptions;\n _icon = (_sidc !== \"\") ? \"\" : _icon;\n let _fbData = {\"layer\": _lay,\"draggable\": _drag,\"track\":_track,\"speed\":_speed,\"alt\":_alt,\"lat\":_lat,\"lon\":_lon,\"icon\":_icon,\"iconSize\": _size, \"iconColor\":_color,\"tooltip\":_tool,\"label\":_label,\"SIDC\":_sidc,\"options\":_sidcOptions};\n for (let key in _fbData) {if (_fbData[key] === \"\") {delete _fbData[key];}}\n document.getElementById(\"payload\").innerHTML = JSON.stringify({\"name\" :_name, ..._fbData},null,2);\n feedback(_name,_fbData,\"addObject\",false);'\n style='width: 100% !important;'>Add New Object</button></td></tr>\n</table>",
701
686
  "output": "str",
702
- "x": 750,
703
- "y": 820,
687
+ "x": 670,
688
+ "y": 920,
704
689
  "wires": [
705
690
  [
706
691
  "f83930ff.b21488"
@@ -724,8 +709,8 @@
724
709
  "drop": true,
725
710
  "allowrate": true,
726
711
  "outputs": 1,
727
- "x": 790,
728
- "y": 680,
712
+ "x": 710,
713
+ "y": 780,
729
714
  "wires": [
730
715
  [
731
716
  "f2bc3916dc12ca60"
@@ -751,12 +736,27 @@
751
736
  "from": "",
752
737
  "to": "",
753
738
  "reg": false,
754
- "x": 670,
755
- "y": 680,
739
+ "x": 590,
740
+ "y": 780,
756
741
  "wires": [
757
742
  [
758
743
  "8923e313189793d4"
759
744
  ]
760
745
  ]
746
+ },
747
+ {
748
+ "id": "be0f2591062868c9",
749
+ "type": "worldmap in",
750
+ "z": "f6f2187d.f17ca8",
751
+ "name": "",
752
+ "path": "/worldmap",
753
+ "events": "connect,disconnect,point,layer,bounds,files,draw,other",
754
+ "x": 60,
755
+ "y": 1000,
756
+ "wires": [
757
+ [
758
+ "9a57374d6e27c511"
759
+ ]
760
+ ]
761
761
  }
762
762
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "5.1.1",
3
+ "version": "5.1.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": "~7.2.0",
@@ -253,9 +253,10 @@ var readFile = function(file) {
253
253
  file.type.indexOf('kmz') === -1 &&
254
254
  file.type.indexOf('json') === -1 &&
255
255
  file.type.indexOf('image/jpeg') === -1 &&
256
+ file.type.indexOf('image/webp') === -1 &&
256
257
  file.type.indexOf('image/png') === -1 &&
257
258
  file.type.indexOf('image/tiff') === -1) {
258
- console.log('File is not text, kml, kmz, jpeg, png, or json', file.type, file);
259
+ console.log('File is not text, kml, kmz, jpeg, png, webp, or json', file.type, file);
259
260
  return;
260
261
  }
261
262
 
@@ -2359,17 +2360,19 @@ function setMarker(data) {
2359
2360
  if (data.hasOwnProperty("greatcircle")) { delete data.greatcircle; }
2360
2361
 
2361
2362
  // then any remaining properties to the info box
2363
+ var longline = 0;
2362
2364
  if (data.popup) { words = data.popup; }
2363
2365
  else {
2364
2366
  words += '<table>';
2365
2367
  for (var i in data) {
2366
2368
  if ((i != "name") && (i != "length") && (i != "clickable")) {
2367
2369
  if (typeof data[i] === "object") {
2368
- words += '<tr><td>'+ i +'</td><td>' + JSON.stringify(data[i]) + '</td></tr>';
2370
+ words += '<tr><td valign="top">'+ i +'</td><td>' + JSON.stringify(data[i]) + '</td></tr>';
2369
2371
  }
2370
2372
  else {
2371
2373
  // words += i +" : "+data[i]+"<br/>";
2372
- words += '<tr><td>'+ i +'</td><td>' + data[i] + '</td></tr>';
2374
+ if (data[i].length > longline) { longline = data[i].length; }
2375
+ words += '<tr><td valign="top">'+ i +'</td><td>' + data[i] + '</td></tr>';
2373
2376
  }
2374
2377
  }
2375
2378
  }
@@ -2379,6 +2382,7 @@ function setMarker(data) {
2379
2382
  words = "<b>"+data["name"]+"</b><br/>" + words.replace(/\${name}/g,data["name"]); //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
2380
2383
  var wopt = {autoClose:false, closeButton:true, closeOnClick:false, minWidth:200};
2381
2384
  if (words.indexOf('<video ') >=0 || words.indexOf('<img ') >=0 ) { wopt.maxWidth="640"; } // make popup wider if it has an image or video
2385
+ if (longline > 100) { wopt.minWidth="640"; } // make popup wider if it has a long line
2382
2386
  if (!data.hasOwnProperty("clickable") && data.clickable != false) {
2383
2387
  marker.bindPopup(words, wopt);
2384
2388
  marker._popup.dname = data["name"];
package/worldmap.js CHANGED
@@ -8,7 +8,7 @@ module.exports = function(RED) {
8
8
  var compression = require("compression");
9
9
  var sockjs = require('sockjs');
10
10
  var sockets = {};
11
- RED.log.info("Worldmap version " + require('./package.json').version );
11
+ RED.log.info("Worldmap version: " + require('./package.json').version );
12
12
  // add the cgi module for serving local maps.... only if mapserv exists
13
13
  if (fs.existsSync((__dirname + '/mapserv'))) {
14
14
  RED.httpNode.use("/cgi-bin/mapserv", require('cgi')(__dirname + '/mapserv'));