node-red-contrib-web-worldmap 2.20.0 → 2.21.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 +4 -0
- package/README.md +5 -6
- package/node_modules/@turf/bezier-spline/dist/es/index.js +7 -3
- package/node_modules/@turf/bezier-spline/dist/es/lib/spline.js +0 -0
- package/node_modules/@turf/bezier-spline/dist/js/index.d.ts +0 -0
- package/node_modules/@turf/bezier-spline/dist/js/index.js +7 -3
- package/node_modules/@turf/bezier-spline/dist/js/lib/spline.d.ts +1 -1
- package/node_modules/@turf/bezier-spline/dist/js/lib/spline.js +0 -0
- package/node_modules/@turf/bezier-spline/package.json +23 -19
- package/node_modules/@turf/helpers/dist/es/index.js +2 -2
- package/node_modules/@turf/helpers/dist/es/lib/geojson.js +0 -0
- package/node_modules/@turf/helpers/dist/js/index.d.ts +1 -1
- package/node_modules/@turf/helpers/dist/js/index.js +2 -2
- package/node_modules/@turf/helpers/dist/js/lib/geojson.d.ts +0 -0
- package/node_modules/@turf/helpers/dist/js/lib/geojson.js +0 -0
- package/node_modules/@turf/helpers/package.json +22 -18
- package/node_modules/@turf/invariant/dist/es/index.js +0 -0
- package/node_modules/@turf/invariant/dist/js/index.d.ts +0 -0
- package/node_modules/@turf/invariant/dist/js/index.js +0 -0
- package/node_modules/@turf/invariant/package.json +22 -18
- package/node_modules/accepts/package.json +13 -10
- package/node_modules/array-flatten/package.json +8 -5
- package/node_modules/body-parser/node_modules/bytes/package.json +8 -5
- package/node_modules/body-parser/package.json +8 -5
- package/node_modules/bufferjs/package.json +13 -10
- package/node_modules/bufferlist/package.json +13 -13
- package/node_modules/cgi/package.json +7 -4
- package/node_modules/compressible/package.json +4 -4
- package/node_modules/compression/node_modules/bytes/package.json +4 -4
- package/node_modules/compression/package.json +12 -9
- package/node_modules/content-disposition/package.json +8 -5
- package/node_modules/content-type/package.json +13 -10
- package/node_modules/cookie/package.json +8 -5
- package/node_modules/cookie-signature/package.json +8 -5
- package/node_modules/debug/package.json +13 -10
- package/node_modules/depd/package.json +13 -10
- package/node_modules/destroy/package.json +13 -10
- package/node_modules/ee-first/package.json +8 -5
- package/node_modules/encodeurl/package.json +13 -10
- package/node_modules/escape-html/package.json +13 -10
- package/node_modules/etag/package.json +13 -10
- package/node_modules/express/package.json +12 -9
- package/node_modules/extend/package.json +13 -10
- package/node_modules/faye-websocket/package.json +13 -10
- package/node_modules/finalhandler/package.json +13 -10
- package/node_modules/forwarded/package.json +13 -10
- package/node_modules/fresh/package.json +8 -5
- package/node_modules/header-stack/package.json +13 -10
- package/node_modules/header-stack/parser.js +2 -2
- package/node_modules/http-errors/package.json +8 -5
- package/node_modules/iconv-lite/package.json +8 -5
- package/node_modules/inherits/package.json +8 -5
- package/node_modules/ipaddr.js/package.json +4 -4
- package/node_modules/media-typer/package.json +8 -5
- package/node_modules/merge-descriptors/package.json +8 -5
- package/node_modules/methods/package.json +13 -10
- package/node_modules/mime/package.json +8 -5
- package/node_modules/mime-db/package.json +5 -5
- package/node_modules/mime-types/package.json +5 -5
- package/node_modules/ms/package.json +8 -5
- package/node_modules/negotiator/package.json +8 -5
- package/node_modules/on-finished/package.json +13 -10
- package/node_modules/on-headers/package.json +13 -10
- package/node_modules/parseurl/package.json +13 -10
- package/node_modules/path-to-regexp/package.json +8 -5
- package/node_modules/proxy-addr/package.json +4 -4
- package/node_modules/qs/package.json +8 -5
- package/node_modules/range-parser/package.json +13 -10
- package/node_modules/raw-body/node_modules/bytes/package.json +8 -5
- package/node_modules/raw-body/package.json +8 -5
- package/node_modules/safe-buffer/package.json +8 -5
- package/node_modules/safer-buffer/package.json +13 -10
- package/node_modules/send/node_modules/ms/package.json +8 -5
- package/node_modules/send/package.json +8 -5
- package/node_modules/serve-static/package.json +8 -5
- package/node_modules/setprototypeof/package.json +8 -5
- package/node_modules/sockjs/package.json +12 -9
- package/node_modules/statuses/package.json +13 -10
- package/node_modules/stream-stack/package.json +13 -10
- package/node_modules/toidentifier/package.json +8 -5
- package/node_modules/type-is/package.json +13 -10
- package/node_modules/unpipe/package.json +8 -5
- package/node_modules/utils-merge/package.json +8 -5
- package/node_modules/uuid/package.json +13 -10
- package/node_modules/vary/package.json +13 -10
- package/node_modules/websocket-driver/node_modules/http-parser-js/package.json +4 -4
- package/node_modules/websocket-driver/package.json +13 -10
- package/node_modules/websocket-extensions/package.json +13 -10
- package/package.json +3 -3
- package/worldmap/leaflet/leaflet.css +2 -2
- package/worldmap/leaflet/leaflet.js.map +1 -0
- package/worldmap/leaflet/leaflet.latlng-graticule.js +23 -21
- package/worldmap/worldmap.js +420 -333
- package/worldmap.html +208 -109
- package/worldmap.js +24 -8
package/worldmap.html
CHANGED
|
@@ -10,24 +10,13 @@
|
|
|
10
10
|
</tr>
|
|
11
11
|
</table>
|
|
12
12
|
</div>
|
|
13
|
+
<div class="form-row">
|
|
14
|
+
<label for="node-input-maplist"><i class="fa fa-list"></i> Map list</label>
|
|
15
|
+
<input type="text" id="node-input-maplist" placeholder="List of Maps">
|
|
16
|
+
</div>
|
|
13
17
|
<div class="form-row">
|
|
14
18
|
<label for="node-input-layer"><i class="fa fa-map"></i> Base map</label>
|
|
15
|
-
<
|
|
16
|
-
<option value="OSM grey">OpenStreetMap Greyscale</option>
|
|
17
|
-
<option value="OSM">OpenStreetMap</option>
|
|
18
|
-
<option value="Esri">ESRI Streetmap</option>
|
|
19
|
-
<option value="Esri Satellite">ESRI Satellite</option>
|
|
20
|
-
<option value="Esri Topography">ESRI Topography</option>
|
|
21
|
-
<option value="Esri Ocean">ESRI Ocean</option>
|
|
22
|
-
<option value="Esri Dark Grey">ESRI Dark Grey</option>
|
|
23
|
-
<option value="Nat Geo">National Geographic</option>
|
|
24
|
-
<option value="UK OS Opendata">UK OS Opendata</option>
|
|
25
|
-
<option value="Open Topo Map">Open Topo Map</option>
|
|
26
|
-
<option value="Hike Bike">Hike Bike OSM</option>
|
|
27
|
-
<option value="Terrain">Terrain</option>
|
|
28
|
-
<option value="Watercolor">Stamen Watercolor</option>
|
|
29
|
-
<option value="Custom">Custom Map Provider</option>
|
|
30
|
-
</select>
|
|
19
|
+
<input type="text" id="node-input-layer" placeholder="Initial Map">
|
|
31
20
|
</div>
|
|
32
21
|
<div class="form-row" id="customMap">
|
|
33
22
|
<label for="node-input-mapname"> Map name</label>
|
|
@@ -40,6 +29,10 @@
|
|
|
40
29
|
<input type="checkbox" id="node-input-mapwms" style="display:inline-block; width:20px; vertical-align:baseline;">
|
|
41
30
|
Map server uses WMS
|
|
42
31
|
</div>
|
|
32
|
+
<div class="form-row">
|
|
33
|
+
<label for="node-input-overlist"><i class="fa fa-map-o"></i> Overlays</label>
|
|
34
|
+
<input type="text" id="node-input-overlist" placeholder="Initial Overlays">
|
|
35
|
+
</div>
|
|
43
36
|
<div class="form-row">
|
|
44
37
|
<label for="node-input-cluster"><i class="fa fa-dot-circle-o"></i>Cluster when</label>
|
|
45
38
|
zoom level is less than <input type="text" id="node-input-cluster" placeholder="0 (0,off - 19)" style="width:100px;">
|
|
@@ -54,7 +47,7 @@
|
|
|
54
47
|
<option value="show">Show</option>
|
|
55
48
|
<option value="hide">Hide</option>
|
|
56
49
|
</select>
|
|
57
|
-
<i class="fa fa-bars" style="margin-left:
|
|
50
|
+
<i class="fa fa-bars" style="margin-left:53px;"></i> Layer menu
|
|
58
51
|
<select id="node-input-layers" style="width:70px;">
|
|
59
52
|
<option value="show">Show</option>
|
|
60
53
|
<option value="hide">Hide</option>
|
|
@@ -66,7 +59,7 @@
|
|
|
66
59
|
<option value="false">False</option>
|
|
67
60
|
<option value="true">True</option>
|
|
68
61
|
</select>
|
|
69
|
-
<i class="fa fa-lock" style="margin-left:
|
|
62
|
+
<i class="fa fa-lock" style="margin-left:54px;"></i> Lock zoom
|
|
70
63
|
<select id="node-input-zoomlock" style="width:70px;">
|
|
71
64
|
<option value="false">False</option>
|
|
72
65
|
<option value="true">True</option>
|
|
@@ -78,7 +71,7 @@
|
|
|
78
71
|
<option value="true">Enable</option>
|
|
79
72
|
<option value="false">Disable</option>
|
|
80
73
|
</select>
|
|
81
|
-
<i class="fa fa-hand-o-right" style="margin-left:
|
|
74
|
+
<i class="fa fa-hand-o-right" style="margin-left:43px;"></i> Right click
|
|
82
75
|
<select id="node-input-hiderightclick" style="width:80px;">
|
|
83
76
|
<option value="false">Enable</option>
|
|
84
77
|
<option value="true">Disable</option>
|
|
@@ -173,24 +166,13 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
173
166
|
</tr>
|
|
174
167
|
</table>
|
|
175
168
|
</div>
|
|
169
|
+
<div class="form-row">
|
|
170
|
+
<label for="node-input-maplist"><i class="fa fa-list"></i> Map list</label>
|
|
171
|
+
<input type="text" id="node-input-maplist" placeholder="List of Maps">
|
|
172
|
+
</div>
|
|
176
173
|
<div class="form-row">
|
|
177
174
|
<label for="node-input-layer"><i class="fa fa-map"></i> Base map</label>
|
|
178
|
-
<
|
|
179
|
-
<option value="OSM grey">OpenStreetMap Greyscale</option>
|
|
180
|
-
<option value="OSM">OpenStreetMap</option>
|
|
181
|
-
<option value="Esri">ESRI Streetmap</option>
|
|
182
|
-
<option value="Esri Satellite">ESRI Satellite</option>
|
|
183
|
-
<option value="Esri Topography">ESRI Topography</option>
|
|
184
|
-
<option value="Esri Ocean">ESRI Ocean</option>
|
|
185
|
-
<option value="Esri Dark Grey">ESRI Dark Grey</option>
|
|
186
|
-
<option value="Nat Geo">National Geographic</option>
|
|
187
|
-
<option value="UK OS Opendata">UK OS Opendata</option>
|
|
188
|
-
<option value="Open Topo Map">Open Topo Map</option>
|
|
189
|
-
<option value="Hike Bike">Hike Bike OSM</option>
|
|
190
|
-
<option value="Terrain">Terrain</option>
|
|
191
|
-
<option value="Watercolor">Stamen Watercolor</option>
|
|
192
|
-
<option value="Custom">Custom Map Provider</option>
|
|
193
|
-
</select>
|
|
175
|
+
<input type="text" id="node-input-layer" placeholder="Initial Map">
|
|
194
176
|
</div>
|
|
195
177
|
<div class="form-row" id="customMap">
|
|
196
178
|
<label for="node-input-mapname"> Map name</label>
|
|
@@ -203,6 +185,10 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
203
185
|
<input type="checkbox" id="node-input-mapwms" style="display:inline-block; width:20px; vertical-align:baseline;">
|
|
204
186
|
Map server uses WMS
|
|
205
187
|
</div>
|
|
188
|
+
<div class="form-row">
|
|
189
|
+
<label for="node-input-overlist"><i class="fa fa-map-o"></i> Overlays</label>
|
|
190
|
+
<input type="text" id="node-input-overlist" placeholder="Initial Overlays">
|
|
191
|
+
</div>
|
|
206
192
|
<div class="form-row">
|
|
207
193
|
<label for="node-input-cluster"><i class="fa fa-dot-circle-o"></i>Cluster when</label>
|
|
208
194
|
zoom level is less than <input type="text" id="node-input-cluster" placeholder="0 (0,off - 19)" style="width:100px;">
|
|
@@ -217,7 +203,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
217
203
|
<option value="show">Show</option>
|
|
218
204
|
<option value="hide">Hide</option>
|
|
219
205
|
</select>
|
|
220
|
-
<i class="fa fa-bars" style="margin-left:
|
|
206
|
+
<i class="fa fa-bars" style="margin-left:53px;"></i> Layer menu
|
|
221
207
|
<select id="node-input-layers" style="width:70px;">
|
|
222
208
|
<option value="show">Show</option>
|
|
223
209
|
<option value="hide">Hide</option>
|
|
@@ -229,7 +215,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
229
215
|
<option value="false">False</option>
|
|
230
216
|
<option value="true">True</option>
|
|
231
217
|
</select>
|
|
232
|
-
<i class="fa fa-lock" style="margin-left:
|
|
218
|
+
<i class="fa fa-lock" style="margin-left:54px;"></i> Lock zoom
|
|
233
219
|
<select id="node-input-zoomlock" style="width:70px;">
|
|
234
220
|
<option value="false">False</option>
|
|
235
221
|
<option value="true">True</option>
|
|
@@ -241,7 +227,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
241
227
|
<option value="true">Enable</option>
|
|
242
228
|
<option value="false">Disable</option>
|
|
243
229
|
</select>
|
|
244
|
-
<i class="fa fa-hand-o-right" style="margin-left:
|
|
230
|
+
<i class="fa fa-hand-o-right" style="margin-left:43px;"></i> Right click
|
|
245
231
|
<select id="node-input-hiderightclick" style="width:80px;">
|
|
246
232
|
<option value="false">Enable</option>
|
|
247
233
|
<option value="true">Disable</option>
|
|
@@ -307,7 +293,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
307
293
|
<p>Icons of type <i>plane</i>, <i>ship</i>, <i>car</i>, <i>uav</i> or <i>arrow</i> will use built in SVG icons that align to the
|
|
308
294
|
<code>bearing</code> value.</p>
|
|
309
295
|
<p>Font Awesome (<a href="https://fontawesome.com/v4.7.0/icons/" target="_new">fa-icons 4.7</a>) can also be used, as can
|
|
310
|
-
NATO symbology codes (SIDC), or <a href="https://github.com/dceejay/RedMap/blob/master/emojilist.md" target="_new">:emoji name:</a>,
|
|
296
|
+
NATO symbology codes (<a href="https://spatialillusions.com/unitgenerator/">SIDC</a>), or <a href="https://github.com/dceejay/RedMap/blob/master/emojilist.md" target="_new">:emoji name:</a>,
|
|
311
297
|
or the url of a small icon image (32x32)</p>
|
|
312
298
|
<p>See the <a href="https://www.npmjs.com/package/node-red-contrib-web-worldmap" target="_new">README</a> for further
|
|
313
299
|
details and examples of icons and commands for drawing <b>lines</b> and <b>areas</b>, and to <b>add layers</b> and
|
|
@@ -315,6 +301,37 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
315
301
|
</script>
|
|
316
302
|
|
|
317
303
|
<script type="text/javascript">
|
|
304
|
+
var mlist = [
|
|
305
|
+
{ value: "OSMG", label: "OpenStreetMap Greyscale" },
|
|
306
|
+
{ value: "OSMC", label: "OpenStreetMap" },
|
|
307
|
+
{ value: "OSMH", label: "OpenStreetMap Humanitarian" },
|
|
308
|
+
{ value: "EsriC", label: "ESRI Streetmap" },
|
|
309
|
+
{ value: "EsriS", label: "ESRI Satellite" },
|
|
310
|
+
{ value: "EsriT", label: "ESRI Topography" },
|
|
311
|
+
{ value: "EsriO", label: "ESRI Ocean" },
|
|
312
|
+
{ value: "EsriDG", label: "ESRI Dark Grey" },
|
|
313
|
+
{ value: "NatGeo", label: "National Geographic" },
|
|
314
|
+
{ value: "UKOS", label: "UK OS Opendata" },
|
|
315
|
+
{ value: "OS45", label: "UK OS 1919-47" },
|
|
316
|
+
{ value: "OS00", label: "UK OS 1900" },
|
|
317
|
+
{ value: "OpTop", label: "Open Topo Map" },
|
|
318
|
+
{ value: "HB", label: "Hike Bike OSM" },
|
|
319
|
+
{ value: "AN", label: "Autonavi (Chinese)" },
|
|
320
|
+
{ value: "ST", label: "Stamen Terrain" },
|
|
321
|
+
{ value: "SW", label: "Stamen Watercolor" }
|
|
322
|
+
]
|
|
323
|
+
var olist = [
|
|
324
|
+
{ value: "DR", label: "Drawing" },
|
|
325
|
+
{ value: "CO", label: "Countries" },
|
|
326
|
+
{ value: "RA", label: "Rainfall" },
|
|
327
|
+
{ value: "DN", label: "Day/Night" },
|
|
328
|
+
{ value: "BU", label: "Buildings" },
|
|
329
|
+
{ value: "RW", label: "Railways" },
|
|
330
|
+
{ value: "SN", label: "Ship Navigation" },
|
|
331
|
+
{ value: "AC", label: "Air Corridors" },
|
|
332
|
+
{ value: "TL", label: "Place Labels" },
|
|
333
|
+
{ value: "HM", label: "Heatmap" }
|
|
334
|
+
]
|
|
318
335
|
var lnk = document.location.host+RED.settings.httpNodeRoot+"/worldmap";
|
|
319
336
|
lnk = lnk.replace(new RegExp('\/{1,}','g'),'/');
|
|
320
337
|
if (!RED.hasOwnProperty("actions")) {
|
|
@@ -345,6 +362,8 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
345
362
|
showgrid: {value:"false"},
|
|
346
363
|
allowFileDrop: {value:"false"},
|
|
347
364
|
path: {value:"/worldmap"},
|
|
365
|
+
overlist: {value:"DR,CO,RA,DN,HM"},
|
|
366
|
+
maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW"},
|
|
348
367
|
mapname: {value:""},
|
|
349
368
|
mapurl: {value:""},
|
|
350
369
|
mapopt: {value:"", validate:function(v) {try{ v.length===0 || JSON.parse(v); return true;} catch(e) {return false;}}},
|
|
@@ -364,6 +383,36 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
364
383
|
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+this.path+').';
|
|
365
384
|
},
|
|
366
385
|
oneditprepare: function() {
|
|
386
|
+
if (this.maplist === undefined) {
|
|
387
|
+
$("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
|
|
388
|
+
this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
|
|
389
|
+
}
|
|
390
|
+
if (this.overlist === undefined) {
|
|
391
|
+
$("#node-input-overlist").val("DR,CO,RA,DN,HM");
|
|
392
|
+
this.overlist = "DR,CO,RA,DN,HM";
|
|
393
|
+
}
|
|
394
|
+
$("#node-input-maplist").typedInput({type:"mapitem", types:[{
|
|
395
|
+
value: "mapitem",
|
|
396
|
+
multiple: true,
|
|
397
|
+
options: mlist
|
|
398
|
+
}]});
|
|
399
|
+
$("#node-input-layer").typedInput({type:"laye", types:[{
|
|
400
|
+
value: "laye",
|
|
401
|
+
options: mlist
|
|
402
|
+
}]});
|
|
403
|
+
$("#node-input-overlist").typedInput({type:"overlay", types:[{
|
|
404
|
+
value: "overlay",
|
|
405
|
+
multiple: true,
|
|
406
|
+
options: olist
|
|
407
|
+
}]});
|
|
408
|
+
$("#node-input-maplist").on('change', function(event, type, value) {
|
|
409
|
+
var mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
|
|
410
|
+
mshort.push({ value:"Custom", label:"Custom Map Provider" });
|
|
411
|
+
$("#node-input-layer").typedInput("types", [{
|
|
412
|
+
value: "laye",
|
|
413
|
+
options: mshort
|
|
414
|
+
}]);
|
|
415
|
+
});
|
|
367
416
|
if ($("#node-input-path").val() === undefined) {
|
|
368
417
|
$("#node-input-path").val("worldmap");
|
|
369
418
|
this.path = "worldmap";
|
|
@@ -388,7 +437,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
388
437
|
}
|
|
389
438
|
});
|
|
390
439
|
|
|
391
|
-
$.get('
|
|
440
|
+
$.get('/-ui-worldmap', function (data) {
|
|
392
441
|
if (data === "true") {
|
|
393
442
|
RED.nodes.registerType('ui_worldmap',{
|
|
394
443
|
category: 'dashboard',
|
|
@@ -425,6 +474,8 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
425
474
|
showgrid: {value:"false"},
|
|
426
475
|
allowFileDrop: {value:"false"},
|
|
427
476
|
path: {value:"/worldmap"},
|
|
477
|
+
overlist: {value:"DR,CO,RA,DN,HM"},
|
|
478
|
+
maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW"},
|
|
428
479
|
mapname: {value:""},
|
|
429
480
|
mapurl: {value:""},
|
|
430
481
|
mapopt: {value:""},
|
|
@@ -442,6 +493,36 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
442
493
|
return this.name?"node_label_italic":"";
|
|
443
494
|
},
|
|
444
495
|
oneditprepare: function() {
|
|
496
|
+
if (this.maplist === undefined) {
|
|
497
|
+
$("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
|
|
498
|
+
this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
|
|
499
|
+
}
|
|
500
|
+
if (this.overlist === undefined) {
|
|
501
|
+
$("#node-input-overlist").val("DR,CO,RA,DN,HM");
|
|
502
|
+
this.overlist = "DR,CO,RA,DN,HM";
|
|
503
|
+
}
|
|
504
|
+
$("#node-input-maplist").typedInput({type:"mapitem", types:[{
|
|
505
|
+
value: "mapitem",
|
|
506
|
+
multiple: true,
|
|
507
|
+
options: mlist
|
|
508
|
+
}]});
|
|
509
|
+
$("#node-input-layer").typedInput({type:"laye", types:[{
|
|
510
|
+
value: "laye",
|
|
511
|
+
options: mlist
|
|
512
|
+
}]});
|
|
513
|
+
$("#node-input-overlist").typedInput({type:"overlay", types:[{
|
|
514
|
+
value: "overlay",
|
|
515
|
+
multiple: true,
|
|
516
|
+
options: olist
|
|
517
|
+
}]});
|
|
518
|
+
$("#node-input-maplist").on('change', function(event, type, value) {
|
|
519
|
+
var mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
|
|
520
|
+
mshort.push({ value:"Custom", label:"Custom Map Provider" });
|
|
521
|
+
$("#node-input-layer").typedInput("types", [{
|
|
522
|
+
value: "laye",
|
|
523
|
+
options: mshort
|
|
524
|
+
}]);
|
|
525
|
+
});
|
|
445
526
|
$("#node-input-size").elementSizer({
|
|
446
527
|
width: "#node-input-width",
|
|
447
528
|
height: "#node-input-height",
|
|
@@ -477,18 +558,15 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
477
558
|
});
|
|
478
559
|
</script>
|
|
479
560
|
|
|
561
|
+
|
|
480
562
|
<script type="text/html" data-template-name="worldmap in">
|
|
481
563
|
<div class="form-row">
|
|
482
564
|
<label for="node-input-path"><i class="fa fa-globe"></i> Web Path</label>
|
|
483
565
|
<input type="text" id="node-input-path" placeholder="worldmap">
|
|
484
566
|
</div>
|
|
485
567
|
<div class="form-row">
|
|
486
|
-
<label for="node-input-events"><i class="fa fa-sign-out"></i>
|
|
487
|
-
<
|
|
488
|
-
<option value="all">All action events</option>
|
|
489
|
-
<option value="connect">Connect events only</option>
|
|
490
|
-
<option value="files">File events only</option>
|
|
491
|
-
</select>
|
|
568
|
+
<label for="node-input-events"><i class="fa fa-sign-out"></i> Events</label>
|
|
569
|
+
<input type="text" id="node-input-events" placeholder="select events">
|
|
492
570
|
</div>
|
|
493
571
|
<div class="form-row">
|
|
494
572
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
@@ -526,7 +604,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
526
604
|
defaults: {
|
|
527
605
|
name: {value:""},
|
|
528
606
|
path: {value:"/worldmap"},
|
|
529
|
-
events: {value:"
|
|
607
|
+
events: {value:"connect,disconnect,point,bounds,files,draw,other"}
|
|
530
608
|
},
|
|
531
609
|
inputs:0,
|
|
532
610
|
outputs:1,
|
|
@@ -539,6 +617,27 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
539
617
|
},
|
|
540
618
|
info: function() {
|
|
541
619
|
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+this.path+').';
|
|
620
|
+
},
|
|
621
|
+
oneditprepare: function() {
|
|
622
|
+
if ($("#node-input-events").val() === "all") {
|
|
623
|
+
$("#node-input-events").val("connect,disconnect,point,bounds,files,draw,other");
|
|
624
|
+
}
|
|
625
|
+
$("#node-input-events").typedInput({type:"event", types:[{
|
|
626
|
+
value: "event",
|
|
627
|
+
multiple: true,
|
|
628
|
+
options: [
|
|
629
|
+
{ value: "connect", label: "Connect"},
|
|
630
|
+
{ value: "disconnect", label: "Disconnect"},
|
|
631
|
+
{ value: "point", label: "Add, move, delete point"},
|
|
632
|
+
{ value: "bounds", label: "Boundary change"},
|
|
633
|
+
{ value: "files", label: "File drop"},
|
|
634
|
+
{ value: "draw", label: "Drawing"},
|
|
635
|
+
{ value: "other", label: "All other"}
|
|
636
|
+
]
|
|
637
|
+
}]});
|
|
638
|
+
$("#node-input-events").on('change', function(event, type, value) {
|
|
639
|
+
this.events = value;
|
|
640
|
+
});
|
|
542
641
|
}
|
|
543
642
|
});
|
|
544
643
|
</script>
|
|
@@ -566,42 +665,42 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
566
665
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
567
666
|
<input type="text" id="node-input-name" placeholder="name">
|
|
568
667
|
</div>
|
|
569
|
-
|
|
668
|
+
</script>
|
|
570
669
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
670
|
+
<script type="text/html" data-help-name="worldmap-tracks">
|
|
671
|
+
<p>Creates tracks lines based on a specified number of previous locations.</p>
|
|
672
|
+
<p>The number of tracked points can be set per marker by specifying <code>msg.payload.trackpoints</code> as part of the update for a marker.</p>
|
|
673
|
+
<p>You can also specify the msg.payload.color, weight, opacity and dashArray properties for the track if required.</p>
|
|
674
|
+
<p>Holds all the points in memory, so if you have a lot of points held for a
|
|
675
|
+
large depth then memory usage may become excessive.</p>
|
|
676
|
+
<p>To delete a track send a msg.payload containing both the name of the object and
|
|
677
|
+
set deleted to true - for example <code>msg.payload = { "name":"Fred", "deleted":true }</code>.</p>
|
|
678
|
+
<p>This will also delete the point. If you just want to clear the track set the msg.payload to the
|
|
679
|
+
name+"_", for example <code>msg.payload = { "name":"Fred_", "deleted":true }</code></p>
|
|
680
|
+
</script>
|
|
582
681
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
682
|
+
<script type="text/javascript">
|
|
683
|
+
RED.nodes.registerType('worldmap-tracks',{
|
|
684
|
+
category: 'location',
|
|
685
|
+
color:"darksalmon",
|
|
686
|
+
defaults: {
|
|
687
|
+
name: {value:""},
|
|
688
|
+
depth: {value:20},
|
|
689
|
+
layer: {value:"combined"},
|
|
690
|
+
smooth: {value:false}
|
|
691
|
+
},
|
|
692
|
+
inputs:1,
|
|
693
|
+
outputs:1,
|
|
694
|
+
icon: "white-globe.png",
|
|
695
|
+
paletteLabel: "tracks",
|
|
696
|
+
label: function() {
|
|
697
|
+
return this.name||"tracks";
|
|
698
|
+
},
|
|
699
|
+
labelStyle: function() {
|
|
700
|
+
return this.name?"node_label_italic":"";
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
</script>
|
|
605
704
|
|
|
606
705
|
|
|
607
706
|
<script type="text/html" data-template-name="worldmap-hull">
|
|
@@ -613,33 +712,33 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|
|
613
712
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
614
713
|
<input type="text" id="node-input-name" placeholder="name">
|
|
615
714
|
</div>
|
|
616
|
-
|
|
715
|
+
</script>
|
|
617
716
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
717
|
+
<script type="text/html" data-help-name="worldmap-hull">
|
|
718
|
+
<p>Creates a convex-hull polygon around a set of supplied points.</p>
|
|
719
|
+
<p>Points can be made part of the same shape if they have the same <code>msg.payload.layer</code>
|
|
720
|
+
by default - this can be configured to another msg.payload property if desired.</p>
|
|
721
|
+
<p><b>Note</b>: the outgoing msg only contains the polygon to draw, so this node should be wired
|
|
722
|
+
in parallel to other paths going to the worldmap node.</p>
|
|
723
|
+
</script>
|
|
625
724
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
725
|
+
<script type="text/javascript">
|
|
726
|
+
RED.nodes.registerType('worldmap-hull',{
|
|
727
|
+
category: 'location',
|
|
728
|
+
color:"darksalmon",
|
|
729
|
+
defaults: {
|
|
730
|
+
name: {value:""},
|
|
731
|
+
prop: {value:"layer",required:true}
|
|
732
|
+
},
|
|
733
|
+
inputs:1,
|
|
734
|
+
outputs:1,
|
|
735
|
+
icon: "white-globe.png",
|
|
736
|
+
paletteLabel: "convex-hull",
|
|
737
|
+
label: function() {
|
|
738
|
+
return this.name||"convex-hull";
|
|
739
|
+
},
|
|
740
|
+
labelStyle: function() {
|
|
741
|
+
return this.name?"node_label_italic":"";
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
</script>
|
package/worldmap.js
CHANGED
|
@@ -32,10 +32,14 @@ module.exports = function(RED) {
|
|
|
32
32
|
node.showgrid = n.showgrid || "false";
|
|
33
33
|
node.allowFileDrop = n.allowFileDrop || "false";
|
|
34
34
|
node.path = n.path || "/worldmap";
|
|
35
|
+
node.maplist = n.maplist;
|
|
36
|
+
node.overlist = n.overlist;
|
|
35
37
|
node.mapname = n.mapname || "";
|
|
36
38
|
node.mapurl = n.mapurl || "";
|
|
37
39
|
node.mapopt = n.mapopt || "";
|
|
38
40
|
node.mapwms = n.mapwms || false;
|
|
41
|
+
if (n.maplist === undefined) { node.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW"; }
|
|
42
|
+
if (n.overlist === undefined) { node.overlist = "DR,CO,RA,DN,HM"; }
|
|
39
43
|
try { node.mapopt2 = JSON.parse(node.mapopt); }
|
|
40
44
|
catch(e) { node.mapopt2 = null; }
|
|
41
45
|
|
|
@@ -43,7 +47,7 @@ module.exports = function(RED) {
|
|
|
43
47
|
if (!sockets[node.path]) {
|
|
44
48
|
var libPath = path.posix.join(RED.settings.httpNodeRoot, node.path, 'leaflet', 'sockjs.min.js');
|
|
45
49
|
var sockPath = path.posix.join(RED.settings.httpNodeRoot,node.path,'socket');
|
|
46
|
-
sockets[node.path] = sockjs.createServer({prefix:sockPath, sockjs_url:libPath, log:function() { return; }});
|
|
50
|
+
sockets[node.path] = sockjs.createServer({prefix:sockPath, sockjs_url:libPath, log:function(s,e) { return; }});
|
|
47
51
|
sockets[node.path].installHandlers(RED.server);
|
|
48
52
|
sockets[node.path].on('error', function(e) { node.error("Socket Connection Error: "+e.stack); });
|
|
49
53
|
}
|
|
@@ -63,6 +67,8 @@ module.exports = function(RED) {
|
|
|
63
67
|
if (message.action === "connected") {
|
|
64
68
|
var m = {};
|
|
65
69
|
var c = {init:true};
|
|
70
|
+
c.maplist = node.maplist;
|
|
71
|
+
c.overlist = node.overlist;
|
|
66
72
|
if (node.layer && node.layer == "Custom") {
|
|
67
73
|
m.name = node.mapname;
|
|
68
74
|
m.url = node.mapurl;
|
|
@@ -88,7 +94,8 @@ module.exports = function(RED) {
|
|
|
88
94
|
c.hiderightclick = node.hiderightclick;
|
|
89
95
|
c.allowFileDrop = node.allowFileDrop;
|
|
90
96
|
c.coords = node.coords;
|
|
91
|
-
c.toptitle = node.name;
|
|
97
|
+
if (node.name) { c.toptitle = node.name; }
|
|
98
|
+
//console.log("INIT",c)
|
|
92
99
|
client.write(JSON.stringify({command:c}));
|
|
93
100
|
}
|
|
94
101
|
});
|
|
@@ -217,7 +224,7 @@ module.exports = function(RED) {
|
|
|
217
224
|
var WorldMapIn = function(n) {
|
|
218
225
|
RED.nodes.createNode(this,n);
|
|
219
226
|
this.path = n.path || "/worldmap";
|
|
220
|
-
this.events = n.events || "
|
|
227
|
+
this.events = n.events || "connect,disconnect,point,bounds,files,draw,other";
|
|
221
228
|
if (this.path.charAt(0) != "/") { this.path = "/" + this.path; }
|
|
222
229
|
if (!sockets[this.path]) {
|
|
223
230
|
var libPath = path.posix.join(RED.settings.httpNodeRoot, this.path, 'leaflet', 'sockjs.min.js');
|
|
@@ -237,14 +244,23 @@ module.exports = function(RED) {
|
|
|
237
244
|
client.on('data', function(message) {
|
|
238
245
|
message = JSON.parse(message);
|
|
239
246
|
if (message.hasOwnProperty("action")) {
|
|
240
|
-
if ((node.events
|
|
247
|
+
if ((node.events.indexOf("connect")!==-1) && (message.action === "connected")) {
|
|
248
|
+
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
249
|
+
}
|
|
250
|
+
if ((node.events.indexOf("bounds")!==-1) && (message.action === "bounds")) {
|
|
251
|
+
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
252
|
+
}
|
|
253
|
+
if ((node.events.indexOf("point")!==-1) && ((message.action === "point")||(message.action === "move")||(message.action === "delete") )) {
|
|
254
|
+
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
255
|
+
}
|
|
256
|
+
if ((node.events.indexOf("files")!==-1) && (message.action === "file")) {
|
|
241
257
|
message.content = Buffer.from(message.content.split('base64,')[1], 'base64');
|
|
242
258
|
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
243
259
|
}
|
|
244
|
-
|
|
260
|
+
if ((node.events.indexOf("draw")!==-1) && (message.action === "draw")) {
|
|
245
261
|
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
246
262
|
}
|
|
247
|
-
|
|
263
|
+
if (node.events.indexOf("other")!==-1 && "connected,point,delete,move,draw,files,bounds".indexOf(message.action) === -1) {
|
|
248
264
|
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
|
249
265
|
}
|
|
250
266
|
}
|
|
@@ -252,7 +268,7 @@ module.exports = function(RED) {
|
|
|
252
268
|
client.on('close', function() {
|
|
253
269
|
delete clients[client.id];
|
|
254
270
|
node.status({fill:"green",shape:"ring",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
|
|
255
|
-
if (node.events
|
|
271
|
+
if (node.events.indexOf("disconnect")!==-1) {
|
|
256
272
|
node.send({payload:{action:"disconnect", clients:Object.keys(clients).length}, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip});
|
|
257
273
|
}
|
|
258
274
|
});
|
|
@@ -505,7 +521,7 @@ module.exports = function(RED) {
|
|
|
505
521
|
}
|
|
506
522
|
RED.nodes.registerType("worldmap-hull",WorldMapHull);
|
|
507
523
|
|
|
508
|
-
RED.httpNode.get("
|
|
524
|
+
RED.httpNode.get("/-ui-worldmap", function(req, res) {
|
|
509
525
|
res.send(ui ? "true": "false");
|
|
510
526
|
});
|
|
511
527
|
}
|