node-red-contrib-web-worldmap 2.38.0 → 2.38.1

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
+ - v2.38.1 - Fix for geojson multipoint icons.
3
4
  - v2.38.0 - Return client headers as part of connect message.
4
5
  - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
5
6
  - v2.37.3 - Fix hang on layer change
@@ -17,7 +18,7 @@
17
18
  Delete marker now also removes from heatmap layer. Issue #218
18
19
 
19
20
  - v2.31.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
20
- - v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
21
+ - v2.31.2 - Fix more antimeridian crossing wrinkles. Issue #216
21
22
  - v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
22
23
  - v2.31.0 - Better handling of KML files. Issue #211
23
24
 
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
+ - v2.38.1 - Fix for geojson multipoint icons.
16
17
  - v2.38.0 - Return client headers as part of connect message.
17
18
  - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
18
19
  - v2.37.3 - Fix hang on layer change
@@ -20,22 +21,6 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
20
21
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
21
22
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
22
23
  - v2.36.0 - Add edge icons for SIDC markers just off the map.
23
- - v2.35.0 - Let clickable:false work for markers as well.
24
- - v2.34.0 - Let icon "url" be a local fixed path. PR #223
25
- - v2.33.0 - Let shapes create click event. from PR #221
26
- Fix heatmap delete point bug. Issue #222
27
- - v2.32.2 - Fix map split in iframe position
28
- - v2.32.1 - Let command.map.heatmap replace complete heatmap array.
29
- - v2.32.0 - Change || to nullish operator ?? to fix numerous dodgy assignments. Issue #219
30
- Delete marker now also removes from heatmap layer. Issue #218
31
- - v2.31.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
32
- - v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
33
- - v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
34
- - v2.31.0 - Better handling of KML files. Issue #211
35
- - v2.30.3 - Fix for iframe height. Issue #210
36
- - v2.30.2 - Fix for bad handling of mapbox id. Issue #208
37
- - v2.30.1 - Don't resend bounds if not changed. Issue #209
38
- - v2.30.0 - Add show/hide ruler option. PR #206
39
24
 
40
25
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
41
26
 
@@ -48,7 +33,7 @@ Either use the Manage Palette option in the Node-RED Editor menu, or run the fol
48
33
  ## Usage
49
34
 
50
35
  Plots "things" on a map. By default the map will be served from `{httpRoot}/worldmap`, but this
51
- can be configured in the configuration panel.
36
+ can be changed in the configuration panel.
52
37
 
53
38
  Use keyboard shortcut `⌘⇧m`, `ctrl-shift-m` to jump to the map.
54
39
 
@@ -61,13 +46,13 @@ The minimum **msg.payload** must contain `name`, `lat` and `lon` properties, for
61
46
  Optional properties include
62
47
 
63
48
  - **deleted** : set to <i>true</i> to remove the named marker. (default <i>false</i>)
64
- - **draggable** : set to <i>true</i> to allow marker to be moved. (default <i>false</i>)
49
+ - **draggable** : set to <i>true</i> to allow marker to be moved by the mouse. (default <i>false</i>)
65
50
  - **layer** : specify a layer on the map to add marker to. (default <i>"unknown"</i>)
66
51
  - **track | hdg | heading | bearing** : when combined with speed, draws a vector. (only first will be used)
67
- - **speed** : when combined with heading, draws a vector.
68
- - **accuracy** : when combined with heading vector, draws a polygon of possible direction.
69
- - **color** : CSS color name or #rrggbb value for heading vector line or accuracy polygon
70
- - **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://
52
+ - **speed** : when combined with track, hdg, heading, or bearing, draws a leader line vector.
53
+ - **accuracy** : when combined with heading vector, draws an arc of possible direction.
54
+ - **color** : CSS color name or #rrggbb value for heading vector line or accuracy polygon.
55
+ - **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.
71
56
  - **iconColor** : Standard CSS colour name or #rrggbb hex value.
72
57
  - **SIDC** : NATO symbology code (can be used instead of icon). See below.
73
58
  - **building** : OSMbulding GeoJSON feature set to add 2.5D buildings to buildings layer. See below.
@@ -96,7 +81,7 @@ If you use the name without the fa- prefix (eg `male`) you will get the icon ins
96
81
 
97
82
  You can also specify an emoji as the icon by using the :emoji name: syntax - for example `:smile:`. Here is a **[list of emojis](https://github.com/dceejay/RedMap/blob/master/emojilist.md)**.
98
83
 
99
- Or you can specify an image to load as an icon by setting the icon to http(s)://... By default will be scaled to 32x32 pixels. You can change the size by setting **iconSize** to a number - eg 64. Example icon - `"https://img.icons8.com/windows/32/000000/bird.png"`
84
+ Or you can specify an image to load as an icon by setting the icon to http(s)://... By default it will be scaled to 32x32 pixels. You can change the size by setting **iconSize** to a number - eg 64. Example icon - `"https://img.icons8.com/windows/32/000000/bird.png"`
100
85
 
101
86
  There are also several special icons...
102
87
 
@@ -112,7 +97,7 @@ There are also several special icons...
112
97
  - **satellite** : a small satellite icon.
113
98
  - **iss** : a slightly larger icon for the ISS.
114
99
  - **locate** : a 4 corner outline to locate a point without obscuring it.
115
- - **friend** : pseudo NATO style blue rectangle. (see NATO SIDC option below)
100
+ - **friend** : pseudo NATO style blue rectangle. (but see NATO SIDC option below)
116
101
  - **hostile** : pseudo NATO style red circle.
117
102
  - **neutral** : pseudo NATO style green square.
118
103
  - **unknown** : pseudo NATO style yellow square.
@@ -145,7 +130,8 @@ then rather than draw a point and icon it draws the polygon. If the "area" array
145
130
  elements, then it assumes this is a bounding box for a rectangle and draws a rectangle.
146
131
 
147
132
  Likewise if it contains a **line** property it will draw the polyline.
148
- If the payload also includes a property `fit:true` the map will zoom to fit the line or area. You can also optionally use `fly:true` instead of fit if required for a more animated look.
133
+
134
+ If the payload also includes a property `fit:true` the map will zoom to fit the line or area. Alternatively you can use `fly:true` instead of fit for a more animated look.
149
135
 
150
136
  Finally if a **greatcircle** property is set containing an array of two coordinates then an arc
151
137
  following the great circle between the two co-ordinates is plotted.
@@ -339,7 +325,7 @@ in addition existing male, female, fa-male and fa-female icons are all represent
339
325
 
340
326
  **NOTES**
341
327
 
342
- - There is currently no way to add labels, popups, or make the icons clickable.
328
+ - There is currently no way to add labels, popups, or to make the icons clickable.
343
329
  - The 3D only really works at zoomed in scales 16+ due to the small size of the icons. They are not scale independent like icons on the normal map.
344
330
  - As this uses the mapbox api you may wish to edit the index3d.html code to include your api key to remove any usage restrictions.
345
331
  - This view is a side project to the Node-RED Worldmap project so I'm happy to take PRs but it probably won't be actively developed.
@@ -374,9 +360,9 @@ If File Drop is enabled - then the map can accept files of type gpx, kml, nvg, j
374
360
 
375
361
  All actions also include a:
376
362
  `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.
377
- 'msg._sessionip' property that shows the ip of the client that is connected to the session.
363
+ `msg._sessionip` property that shows the ip of the client that is connected to the session.
378
364
 
379
- Only actions "connected" include a msg._clientheaders property that shows the headers sent by the client to make a connection to the session.
365
+ The "connected" action also include a `msg._clientheaders` property that shows the headers sent by the client to make a connection to the session.
380
366
 
381
367
 
382
368
  ### Utility functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.38.0",
3
+ "version": "2.38.1",
4
4
  "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
5
5
  "dependencies": {
6
6
  "@turf/bezier-spline": "~6.5.0",
@@ -2795,7 +2795,7 @@ function doCommand(cmd) {
2795
2795
 
2796
2796
  // handle any incoming GEOJSON directly - may style badly
2797
2797
  function doGeojson(n,g,l,o) {
2798
- //console.log("GEOJSON",n,g,l,o)
2798
+ // console.log("GEOJSON",n,g,l,o)
2799
2799
  var lay = l ?? g.name ?? "unknown";
2800
2800
  // if (!basemaps[lay]) {
2801
2801
  var opt = { style: function(feature) {
@@ -2867,9 +2867,11 @@ function doGeojson(n,g,l,o) {
2867
2867
  if (feature.properties.hasOwnProperty("url")) {
2868
2868
  feature.properties.url = "<a target='_new' href='"+feature.properties.url+"'>"+feature.properties.url+"</a>";
2869
2869
  }
2870
- delete feature.properties["marker-symbol"];
2871
- delete feature.properties["marker-color"];
2872
- delete feature.properties["marker-size"];
2870
+ if (feature.geometry.hasOwnProperty("type") && feature.geometry.type !== "MultiPoint") {
2871
+ delete feature.properties["marker-symbol"];
2872
+ delete feature.properties["marker-color"];
2873
+ delete feature.properties["marker-size"];
2874
+ }
2873
2875
  var nf = {title:feature.properties.title, name:feature.properties.name};
2874
2876
  feature.properties = Object.assign(nf, feature.properties);
2875
2877
  return L.marker(latlng, {title:feature.properties.title ?? "", icon:myMarker});