node-red-contrib-web-worldmap 3.1.0 → 4.2.0
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 +6 -0
- package/README.md +40 -39
- package/examples/ESRI featurelayer overlay.json +1 -0
- package/package.json +1 -1
- package/worldmap/leaflet/leaflet.boatmarker.js +1 -1
- package/worldmap/worldmap.js +258 -145
- package/worldmap.html +2 -1
- package/worldmap.js +32 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
### Change Log for Node-RED Worldmap
|
|
2
2
|
|
|
3
|
+
- v4.2.0 - Let icons also be inline images data:image...
|
|
4
|
+
- v4.1.0 - Add optional SOG, COG, altft, altm input properties.
|
|
5
|
+
- v4.0.0 - Breaking - Better context menu variable substitution and retention
|
|
6
|
+
Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus.
|
|
7
|
+
|
|
8
|
+
- v3.2.0 - Sync up drawing sessions across browsers to same map
|
|
3
9
|
- v3.1.0 - Add esri overlay layers, and let geojson overlay rendering be customised
|
|
4
10
|
- v3.0.0 - Bump to Leaflet 1.9.4
|
|
5
11
|
Move to geoman for drawing shapes.
|
package/README.md
CHANGED
|
@@ -13,9 +13,14 @@ Feel free to [
|
|
27
32
|
- v2.40.1 - Fix missing countries overlay when starting disconnected.
|
|
28
33
|
- v2.40.0 - Add handling for TAK event points from TAK ingest node.
|
|
29
|
-
- v2.39.0 - Add client timezone to connect message. PR #245
|
|
30
|
-
- v2.38.3 - Better fix for geojson multipoint icons.
|
|
31
|
-
- v2.38.1 - Fix for geojson multipoint icons.
|
|
32
|
-
- v2.38.0 - Return client headers as part of connect message.
|
|
33
|
-
- v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
|
|
34
|
-
- v2.37.3 - Fix hang on layer change
|
|
35
|
-
- v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
|
|
36
|
-
- v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
|
|
37
|
-
- v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
|
|
38
|
-
- v2.36.0 - Add edge icons for SIDC markers just off the map.
|
|
39
34
|
|
|
40
35
|
- see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
|
|
41
36
|
|
|
@@ -56,15 +51,17 @@ The minimum **msg.payload** must contain `name`, `lat` and `lon` properties, for
|
|
|
56
51
|
|
|
57
52
|
msg.payload = { "name":"Jason", "lat":51.05, "lon":-1.35 }
|
|
58
53
|
|
|
59
|
-
`name` must be a unique identifier across the whole map. Repeated location updates to the same `name` move the marker.
|
|
54
|
+
`name` **must** be a unique identifier across the whole map. Repeated location updates to the same `name` move the marker.
|
|
60
55
|
|
|
61
56
|
Optional properties for **msg.payload** include
|
|
62
57
|
|
|
63
58
|
- **deleted** : set to <i>true</i> to remove the named marker. (default <i>false</i>)
|
|
64
59
|
- **draggable** : set to <i>true</i> to allow marker to be moved by the mouse. (default <i>false</i>)
|
|
65
60
|
- **layer** : specify a layer on the map to add marker to. (default <i>"unknown"</i>)
|
|
66
|
-
- **track | hdg | heading | bearing** : when combined with speed, draws a vector. (only first will be used)
|
|
67
|
-
- **speed** : when combined with track, hdg, heading, or bearing, draws a leader line vector.
|
|
61
|
+
- **track | hdg | heading | COG | bearing** : when combined with speed, draws a vector. (only first will be used)
|
|
62
|
+
- **speed** : when combined with track, hdg, heading, or bearing, draws a leader line vector - should be in m/s. Can also be specified as "20 kph", or "20 mph", or "20 kt". i.e a string with units.
|
|
63
|
+
- **SOG** : speed over ground - speed in knots.
|
|
64
|
+
- **alt | altitude | altft | altm** : Altitude in meters, but can use *altft* to specify feet instead.
|
|
68
65
|
- **accuracy** : when combined with heading vector, draws an arc of possible direction.
|
|
69
66
|
- **color** : CSS color name or #rrggbb value for heading vector line or accuracy polygon.
|
|
70
67
|
- **icon** : <a href="https://fontawesome.com/v4.7.0/icons/" target="mapinfo">font awesome</a> icon name, <a href="https://github.com/Paul-Reed/weather-icons-lite" target="mapinfo">weather-lite</a> icon, :emoji name:, or https:// uri.
|
|
@@ -82,12 +79,11 @@ Optional properties for **msg.payload** include
|
|
|
82
79
|
- **popup** : html to fill the popup if you don't want the automatic default of the properties list. Using this overrides photourl, videourl and weblink options.
|
|
83
80
|
- **label** : displays the contents as a permanent label next to the marker, or
|
|
84
81
|
- **tooltip** : displays the contents when you hover over the marker. (Mutually exclusive with label. Label has priority)
|
|
85
|
-
- **contextmenu** : an html fragment to display on right click of marker - defaults to delete marker. You can specify `$name` to
|
|
82
|
+
- **contextmenu** : an html fragment to display on right click of marker - defaults to delete marker. You can specify `${name}` to substitute in the name of the marker. Set to `""` to disable just this instance.
|
|
86
83
|
|
|
87
84
|
Any other `msg.payload` properties will be added to the icon popup text box. This can be
|
|
88
85
|
overridden by using the **popup** property to supply your own html content. If you use the
|
|
89
|
-
popup property it will completely replace the contents so photourl, videourl and weblink are
|
|
90
|
-
meaningless in this mode.
|
|
86
|
+
popup property it will completely replace the contents so photourl, videourl and weblink are meaningless in this mode.
|
|
91
87
|
|
|
92
88
|
### Icons
|
|
93
89
|
|
|
@@ -107,6 +103,7 @@ There are also several special icons...
|
|
|
107
103
|
- **bus** : a bus/coach icon that aligns with the heading of travel.
|
|
108
104
|
- **uav** : a small uav like icon that aligns with the heading of travel.
|
|
109
105
|
- **helicopter** : a small helicopter icon that aligns with the heading of travel.
|
|
106
|
+
- **sensor** : a camera icon that points to the heading angle.
|
|
110
107
|
- **arrow** : a map GPS arrow type pointer that aligns with the heading of travel.
|
|
111
108
|
- **wind** : a wind arrow that points in the direction the wind is coming FROM.
|
|
112
109
|
- **satellite** : a small satellite icon.
|
|
@@ -161,7 +158,7 @@ following the great circle between the two co-ordinates is plotted.
|
|
|
161
158
|
|
|
162
159
|
msg.payload = {name:"GC1", color:"#ff00ff", greatcircle:[ [51.464,0], [25.76,-80.18] ] }
|
|
163
160
|
|
|
164
|
-
Shapes can also have a **popup** property containing html, but you MUST also set a property `clickable:true` in order to allow it to be seen.
|
|
161
|
+
Shapes can also have a **popup** property containing html, but you MUST also set a property `clickable:true` in order to allow it to be seen. You can also set **tooltip** to create a label that appears when you hover the mouse over the shape.
|
|
165
162
|
|
|
166
163
|
There are extra optional properties you can specify - see Options below.
|
|
167
164
|
|
|
@@ -200,7 +197,7 @@ You can add supplemental arc(s) to a marker by adding an **arc** property as bel
|
|
|
200
197
|
Supplemental means that you can also specify a line using a **bearing** and **length** property.
|
|
201
198
|
|
|
202
199
|
```
|
|
203
|
-
msg.payload = { name:"Camera01", icon:"
|
|
200
|
+
msg.payload = { name:"Camera01", icon:"sensor", lat:51.05, lon:-1.35,
|
|
204
201
|
bearing: 235,
|
|
205
202
|
length: 2200,
|
|
206
203
|
arc: {
|
|
@@ -259,7 +256,7 @@ Often geojson may not have a `properties` or `style` property in which case you
|
|
|
259
256
|
|
|
260
257
|
2) You can just send a msg.payload containing the geojson itself - but obviously you then can't style it, set the name, layer, etc.
|
|
261
258
|
|
|
262
|
-
3) You can also add the geojson as a specific overlay, in which case you can also have more control of styles, and per feature customisations. See the section on overlays [below](#to-add-a-new-geojson-overlay). This is the most complex but customisable.
|
|
259
|
+
3) You can also add the geojson as a specific overlay, in which case you can also have more control of styles, and per feature customisations. See the section on overlays [below](#to-add-a-new-geojson-overlay). This is the most complex but also the most customisable.
|
|
263
260
|
|
|
264
261
|
|
|
265
262
|
### Options
|
|
@@ -275,6 +272,7 @@ Areas, Rectangles, Lines, Circles and Ellipses can also specify more optional pr
|
|
|
275
272
|
- **clickable** : boolean - set to true to allow click to show popup.
|
|
276
273
|
- **popup** : html string to display in popup (as well as name).
|
|
277
274
|
- **editable** : boolean - set to true to allow simple edit/delete right click contextmenu.
|
|
275
|
+
- **tooltip** : Text string to display on mouse hover over the shape.
|
|
278
276
|
- **contextmenu** : html string to display a more complex right click contextmenu.
|
|
279
277
|
- **weight** : the width of the line or outline.
|
|
280
278
|
|
|
@@ -282,6 +280,7 @@ Other properties can be found in the leaflet documentation.
|
|
|
282
280
|
|
|
283
281
|
Shapes can also have a **popup** property containing html, but you MUST also set a property `clickable:true` in order to allow it to be seen.
|
|
284
282
|
|
|
283
|
+
|
|
285
284
|
### Drawing
|
|
286
285
|
|
|
287
286
|
A single *right click* will allow you to add a point to the map - you must specify the `name` and optionally the `icon` and `layer`.
|
|
@@ -289,7 +288,9 @@ A single *right click* will allow you to add a point to the map - you must speci
|
|
|
289
288
|
Right-clicking on an icon will allow you to delete it.
|
|
290
289
|
|
|
291
290
|
If you select the **drawing** layer you can also add and edit polylines, polygons, rectangles and circles.
|
|
292
|
-
Once an item is drawn you can right click to edit or delete it.
|
|
291
|
+
Once an item is drawn you can right click to edit or delete it.
|
|
292
|
+
|
|
293
|
+
Double click the object to exit edit mode.
|
|
293
294
|
|
|
294
295
|
|
|
295
296
|
### Buildings
|
|
@@ -382,7 +383,7 @@ The **worldmap in** node can be used to receive various events from the map. Exa
|
|
|
382
383
|
|
|
383
384
|
{ "action": "feedback", "name": "some name", "value": "some value", "lat":51, "lon":0, "layer":"unknown" } // when a user calls the feedback function - see below
|
|
384
385
|
|
|
385
|
-
If File Drop is enabled - then the map can accept files of type gpx, kml, nvg, jpeg, png and geojson. The file content property will always be a binary buffer. The lat, lon of the cursor drop point will be included. Tracks will be locally rendered on the map. The node-red-node-exif node can be used to extract location information from a jpeg image and then geolocate it back on the map. Png images will be located where they are dropped but can then be dragged if required.
|
|
386
|
+
If File Drop is enabled - then the map can accept files of type gpx, kml, nvg, jpeg, png and geojson. The file content property will always be a binary buffer. The lat, lon of the cursor drop point will be included. Tracks will be locally rendered on the map. The `node-red-node-exif` node can be used to extract location information from a jpeg image and then geolocate it back on the map. Png images will be located where they are dropped but can then be dragged if required.
|
|
386
387
|
|
|
387
388
|
All actions also include a:
|
|
388
389
|
`msg._sessionid` property that indicates which client session they came from. Any msg sent out that includes this property will ONLY be sent to that session - so you can target map updates to specific sessions if required.
|
|
@@ -398,20 +399,22 @@ The "connected" action additionally includes a:
|
|
|
398
399
|
|
|
399
400
|
There are some internal functions available to make interacting with Node-RED easier (e.g. from inside a user defined popup., these include:
|
|
400
401
|
|
|
401
|
-
- **feedback()** : it takes 2, 3, or 4 parameters, name, value, and optionally an action name (defaults to "feedback"), and optional boolean to close the popup on calling this function, and can be used inside something like an input tag - `onchange='feedback(this.name,this.value,null,true)'`. Value can be a more complex object if required as long as it is serialisable. If used with a marker the name should be that of the marker - you can use `$name` to let it be substituted automatically.
|
|
402
|
+
- **feedback()** : it takes 2, 3, or 4 parameters, name, value, and optionally an action name (defaults to "feedback"), and optional boolean to close the popup on calling this function, and can be used inside something like an input tag - `onchange='feedback(this.name,this.value,null,true)'`. Value can be a more complex object if required as long as it is serialisable. If used with a marker the name should be that of the marker - you can use `${name}` to let it be substituted automatically.
|
|
403
|
+
|
|
404
|
+
- **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:
|
|
402
405
|
|
|
403
|
-
|
|
406
|
+
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.
|
|
404
407
|
|
|
405
408
|
```
|
|
406
|
-
var menu = 'Add some data <input name="foo" onchange=\'addToForm(this.name,this.value)\'></input><br/>'
|
|
407
|
-
menu += 'Add more data <input name="bar" onchange=\'addToForm(this.name,this.value)\'></input><br/>'
|
|
408
|
-
menu += '<button name="my_form" onclick=\'feedback(this.name,"
|
|
409
|
+
var menu = 'Add some data <input name="foo" value="${foo}" onchange=\'addToForm(this.name,this.value)\'></input><br/>'
|
|
410
|
+
menu += 'Add more data <input name="bar" value="${bar}" onchange=\'addToForm(this.name,this.value)\'></input><br/>'
|
|
411
|
+
menu += '<button name="my_form" onclick=\'feedback(this.name,"_form",null,true)\'>Submit</button>'
|
|
409
412
|
msg.payload = { command: { "contextmenu":menu } }
|
|
410
413
|
```
|
|
411
414
|
|
|
412
|
-
- **delMarker()** : takes the name of the marker as a parameter. In a popup this can be specified as `$name` for dynamic substitution.
|
|
415
|
+
- **delMarker()** : takes the name of the marker as a parameter. In a popup this can be specified as `${name}` for dynamic substitution.
|
|
413
416
|
|
|
414
|
-
- **editPoly()** : takes the name of the shape or line as a parameter. In a popup this can be specified as `$name` for dynamic substitution.
|
|
417
|
+
- **editPoly()** : takes the name of the shape or line as a parameter. In a popup this can be specified as `${name}` for dynamic substitution.
|
|
415
418
|
|
|
416
419
|
|
|
417
420
|
## Controlling the map
|
|
@@ -422,15 +425,15 @@ Optional properties for **msg.payload.command** include
|
|
|
422
425
|
|
|
423
426
|
- **lat** - move map to specified latitude.
|
|
424
427
|
- **lon** - move map to specified longitude.
|
|
425
|
-
- **rotation** - rotate the base map to the specified compass angle.
|
|
426
428
|
- **zoom** - move map to specified zoom level (1 - world, 13 to 20 max zoom depending on map).
|
|
427
429
|
- **bounds** - if set to an array `[ [ lat(S), lon(W) ], [lat(N), lon(E)] ]` - sets the overall map bounds.
|
|
430
|
+
- **rotation** - rotate the base map to the specified compass angle.
|
|
428
431
|
- **layer** - set map to specified base layer name - `{"command":{"layer":"Esri"}}`
|
|
429
432
|
- **search** - search markers on map for name containing `string`. If not found in existing markers, will then try geocoding looking using Nominatim. An empty string `""` clears the search results. - `{"command":{"search":"Winchester"}}`
|
|
430
433
|
- **showlayer** - show the named overlay(s) - `{"command":{"showlayer":"foo"}}` or `{"command":{"showlayer":["foo","bar"]}}`
|
|
431
434
|
- **hidelayer** - hide the named overlay(s) - `{"command":{"hidelayer":"bar"}}` or `{"command":{"hidelayer":["bar","another"]}}`
|
|
432
435
|
- **side** - add a second map alongside with slide between them. Use the name of a *baselayer* to add - or "none" to remove the control. - `{"command":{"side":"Esri Satellite"}}`
|
|
433
|
-
- **split** - once you have split the screen - the split value is the % across the screen of the split line. - `{"command":{"split":50}}`
|
|
436
|
+
- **split** - once you have split the screen with the *side* command - the split value is then the % across the screen of the split line. - `{"command":{"split":50}}`
|
|
434
437
|
- **map** - Object containing details of a new map layer:
|
|
435
438
|
- **name** - name of the map base layer OR **overlay** - name of overlay layer
|
|
436
439
|
- **url** - url of the map layer
|
|
@@ -451,7 +454,7 @@ Optional properties for **msg.payload.command** include
|
|
|
451
454
|
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.
|
|
452
455
|
- **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.
|
|
453
456
|
- **toptitle** - Words to replace title in title bar (if not in iframe)
|
|
454
|
-
- **toplogo** - URL to logo image for top
|
|
457
|
+
- **toplogo** - URL to logo image for top title bar (if not in iframe) - ideally 60px by 24px.
|
|
455
458
|
- **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.
|
|
456
459
|
- **showmenu** - Show or hide the display of the hamberger menu control in the top right . Values can be "show" or "hide". - `{"command":{"showmenu": "hide"}}`
|
|
457
460
|
- **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"}}`
|
|
@@ -487,11 +490,11 @@ careful escaping quotes, and that they remain matched.
|
|
|
487
490
|
|
|
488
491
|
For example a marker popup with a slider (note the \ escaping the internal ' )
|
|
489
492
|
|
|
490
|
-
popup: '<input name="slide1" type="range" min="1" max="100" value="50" onchange=\'feedback($name,this.value,this.name)\' style="width:250px;">'
|
|
493
|
+
popup: '<input name="slide1" type="range" min="1" max="100" value="50" onchange=\'feedback(${name},this.value,this.name)\' style="width:250px;">'
|
|
491
494
|
|
|
492
495
|
Or a marker contextmenu with an input box
|
|
493
496
|
|
|
494
|
-
contextmenu: '<input name="channel" type="text" value="5" onchange=\'feedback($name,{"name":this.name,"value":this.value},"myFeedback")\' />'
|
|
497
|
+
contextmenu: '<input name="channel" type="text" value="5" onchange=\'feedback(${name},{"name":this.name,"value":this.value},"myFeedback")\' />'
|
|
495
498
|
|
|
496
499
|
Or you can add a contextmenu to the map. Simple contextmenu with a button
|
|
497
500
|
|
|
@@ -511,7 +514,6 @@ Example simple form
|
|
|
511
514
|
[{"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"]]}]
|
|
512
515
|
```
|
|
513
516
|
|
|
514
|
-
|
|
515
517
|
See the section on **Utility Functions** for details of the feedback function.
|
|
516
518
|
|
|
517
519
|
#### To add and remove a legend
|
|
@@ -607,7 +609,7 @@ The `fit` property is optional, and you can also use `fly` if you wish. If boole
|
|
|
607
609
|
|
|
608
610
|
#### To add a new KML, GPX, or TOPOJSON overlay
|
|
609
611
|
|
|
610
|
-
As
|
|
612
|
+
As with the geojson overlay, you can also inject a KML layer, GPX layer or TOPOJSON layer. The syntax is the same but with either a `kml` property containing the KML string - a `gpx` property containing a GPX string - or a `topojson` property containing the topojson.
|
|
611
613
|
|
|
612
614
|
msg.payload.command.map = {
|
|
613
615
|
"overlay": "myKML",
|
|
@@ -703,7 +705,7 @@ Feeding this into the tracks node will also remove the tracks stored for that la
|
|
|
703
705
|
|
|
704
706
|
### Using a local Map Server (WMS server)
|
|
705
707
|
|
|
706
|
-
IMHO the easiest map server to make work is the <a href="http://www.mapserver.org/" target="mapinfo">mapserver</a> package in Ubuntu / Debian. Usually you will start with
|
|
708
|
+
IMHO the easiest WMS map server to make work is the <a href="http://www.mapserver.org/" target="mapinfo">mapserver</a> package in Ubuntu / Debian. Usually you will start with
|
|
707
709
|
|
|
708
710
|
sudo apt-get install mapserver-bin cgi-mapserver gdal-bin
|
|
709
711
|
|
|
@@ -733,7 +735,6 @@ You can then add a new WMS Base layer by injecting a message like
|
|
|
733
735
|
"wms": true // set to true for WMS type mapserver
|
|
734
736
|
}}}
|
|
735
737
|
|
|
736
|
-
|
|
737
738
|
#### Using a Docker Map Server
|
|
738
739
|
|
|
739
740
|
You can use a docker container like https://hub.docker.com/r/camptocamp/mapserver, then assuming you have the mapfile 'my-app.map' in the current working directory, you could mount it as:
|
|
@@ -771,7 +772,7 @@ The following example gets recent earthquakes from USGS, parses the result,
|
|
|
771
772
|
formats up the msg as per above and sends to the node to plot on the map.
|
|
772
773
|
It also shows how to zoom and move the map or add a new layer.
|
|
773
774
|
|
|
774
|
-
[{"id":"86457344.50e6b","type":"inject","z":"
|
|
775
|
+
[{"id":"86457344.50e6b","type":"inject","z":"cb7b09e3354afd4c","name":"","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"none","x":170,"y":500,"wires":[["9a142026.fa47f"]]},{"id":"9a142026.fa47f","type":"function","z":"cb7b09e3354afd4c","name":"add new layer","func":"msg.payload = {};\nmsg.payload.command = {};\n\nvar u = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';\nvar o = { maxZoom: 19, attribution: '© OpenStreetMap'};\n\nmsg.payload.command.map = {name:\"OSMhot\", url:u, opt:o};\nmsg.payload.command.layer = \"OSMhot\";\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":500,"wires":[["c643e022.1816c"]]},{"id":"c643e022.1816c","type":"worldmap","z":"cb7b09e3354afd4c","name":"","lat":"30","lon":"0","zoom":"3","layer":"OSMG","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"false","showruler":"false","allowFileDrop":"false","path":"worldmap","overlist":"CO,RA,DN","maplist":"OSMG,OSMH,EsriS","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":640,"y":540,"wires":[]},{"id":"2998e233.4ba64e","type":"function","z":"cb7b09e3354afd4c","name":"USGS Quake monitor csv re-parse","func":"msg.payload.lat = msg.payload.latitude;\nmsg.payload.lon = msg.payload.longitude;\nmsg.payload.layer = \"earthquake\";\nmsg.payload.name = msg.payload.id;\nmsg.payload.icon = \"globe\";\nmsg.payload.iconColor = \"orange\";\n\ndelete msg.payload.latitude;\ndelete msg.payload.longitude;\t\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":640,"wires":[["c643e022.1816c"]]},{"id":"e72c5732.9fa198","type":"function","z":"cb7b09e3354afd4c","name":"move and zoom","func":"msg.payload = { command:{layer:\"Esri Terrain\",lat:0,lon:-90,zoom:2} };\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":540,"wires":[["c643e022.1816c"]]},{"id":"12317723.589249","type":"csv","z":"cb7b09e3354afd4c","name":"","sep":",","hdrin":true,"hdrout":"","multi":"one","ret":"\\n","temp":"","x":370,"y":580,"wires":[["2998e233.4ba64e"]]},{"id":"10e5e5f0.8daeaa","type":"inject","z":"cb7b09e3354afd4c","name":"","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"none","x":170,"y":540,"wires":[["e72c5732.9fa198"]]},{"id":"b6917d83.d1bac","type":"http request","z":"cb7b09e3354afd4c","name":"","method":"GET","url":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv","x":250,"y":640,"wires":[["12317723.589249"]]},{"id":"3842171.4d487e8","type":"inject","z":"cb7b09e3354afd4c","name":"Quakes","repeat":"900","crontab":"","once":false,"topic":"","payload":"","payloadType":"none","x":180,"y":580,"wires":[["b6917d83.d1bac"]]}]
|
|
775
776
|
|
|
776
777
|
---
|
|
777
778
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"id":"573ef3eef64ca4c1","type":"worldmap","z":"70a15c4047f2ce55","name":"","lat":"34","lon":"-119","zoom":"10","layer":"OSMG","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"false","showruler":"false","allowFileDrop":"false","path":"/worldmap","overlist":"CO","maplist":"OSMG,OSMH,EsriC,EsriS","mapname":"LocalOSM","mapurl":"http://localhost:1885/styles/light/{z}/{x}/{y}.png","mapopt":"","mapwms":false,"x":680,"y":560,"wires":[]},{"id":"db4b02196f09bc6f","type":"inject","z":"70a15c4047f2ce55","name":"trailheads","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":560,"wires":[["8dbe012b2a894e9b"]]},{"id":"8dbe012b2a894e9b","type":"function","z":"70a15c4047f2ce55","name":"function 2","func":"\nconst style = function () {\n return { color: \"#000091\", weight: 2 };\n};\n\nconst pointToLayer = function (geojson, latlng) {\n console.log(\"Point geo\", latlng, geojson);\n return L.circleMarker(latlng).bindPopup(geojson.properties.TRL_NAME);\n};\n\nconst onEachFeature = function (geojson, layer) {\n console.log(\"Feature\", layer, geojson);\n};\n\nmsg.payload = {\n command : {\n map : {\n overlay : \"Trailheads\",\n esri: \"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0\",\n opt: {\n style: style.toString(),\n pointToLayer: pointToLayer.toString(),\n onEachFeature: onEachFeature.toString()\n }\n }\n }\n}\nreturn msg;","outputs":1,"noerr":5,"initialize":"","finalize":"","libs":[],"x":400,"y":560,"wires":[["573ef3eef64ca4c1"]]},{"id":"310aa5b8f88c225c","type":"inject","z":"70a15c4047f2ce55","name":"trails","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":600,"wires":[["ec8831289bfb117c"]]},{"id":"ec8831289bfb117c","type":"function","z":"70a15c4047f2ce55","name":"function 3","func":"\nconst style = function () {\n return { color: \"#009100\", weight: 3 };\n};\n\nconst onEachFeature = function (geojson, layer) {\n console.log(\"Feature\", layer, geojson);\n};\n\nmsg.payload = {\n command : {\n map : {\n overlay : \"Trails\",\n esri: \"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails_Styled/FeatureServer/0\",\n opt: {\n style: style.toString(),\n onEachFeature: onEachFeature.toString()\n }\n }\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":600,"wires":[["573ef3eef64ca4c1"]]},{"id":"55fb1ea255465f0e","type":"inject","z":"70a15c4047f2ce55","name":"parks","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":640,"wires":[["f23b7921618df33e"]]},{"id":"f23b7921618df33e","type":"function","z":"70a15c4047f2ce55","name":"function 4","func":"\nconst style = function () {\n return {\n color: \"#910000\", \n weight: 1,\n \"fillColor\": \"#808000\",\n \"fillOpacity\": 0.1 };\n};\n\nconst onEachFeature = function (feature, layer) {\n console.log(\"Feature\", feature);\n layer.bindPopup(feature.properties.PARK_NAME)\n};\n\nmsg.payload = {\n command : {\n map : {\n overlay : \"Parks\",\n esri: \"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space_Styled/FeatureServer/0\",\n opt: {\n maxZoom: 13,\n minZoom: 9,\n style: style.toString(),\n onEachFeature: onEachFeature.toString()\n }\n }\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":640,"wires":[["573ef3eef64ca4c1"]]}]
|
package/package.json
CHANGED