node-red-contrib-web-worldmap 2.38.3 → 2.39.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 CHANGED
@@ -1,5 +1,6 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.39.0 - Add client timezone to connect message. PR #245
3
4
  - v2.38.3 - Better fix for geojson multipoint icons.
4
5
  - v2.38.1 - Fix for geojson multipoint icons.
5
6
  - v2.38.0 - Return client headers as part of connect message.
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.39.0 - Add client timezone to connect message. PR #245
16
17
  - v2.38.3 - Better fix for geojson multipoint icons.
17
18
  - v2.38.1 - Fix for geojson multipoint icons.
18
19
  - v2.38.0 - Return client headers as part of connect message.
@@ -363,7 +364,10 @@ All actions also include a:
363
364
  `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.
364
365
  `msg._sessionip` property that shows the ip of the client that is connected to the session.
365
366
 
366
- The "connected" action also include a `msg._clientheaders` property that shows the headers sent by the client to make a connection to the session.
367
+ The "connected" action additionally includes a:
368
+ `msg.payload.parameters` property object that lists the parameters sent in the url.
369
+ `msg.payload.clientTimezone` property string showing the clients local Timezone. Returns bool of `false` if unable to retrive clients local Timezone.
370
+ `msg._clientheaders` property that shows the headers sent by the client to make a connection to the session.
367
371
 
368
372
 
369
373
  ### Utility functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.38.3",
3
+ "version": "2.39.0",
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",
@@ -63,7 +63,7 @@ var connect = function() {
63
63
  if (!inIframe) {
64
64
  document.getElementById("footer").innerHTML = "<font color='#494'>"+pagefoot+"</font>";
65
65
  }
66
- ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams)}));
66
+ ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams),clientTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone || false}));
67
67
  onoffline();
68
68
  };
69
69
  ws.onclose = function() {
@@ -2854,19 +2854,16 @@ function doGeojson(n,g,l,o) {
2854
2854
  });
2855
2855
  }
2856
2856
  else if (feature.properties.hasOwnProperty("marker-symbol") && feature.properties["marker-symbol"].substr(0,3) === "fa-") {
2857
- try {
2858
- var col = feature.properties["marker-color"] ?? "#910000";
2859
- var imod = "";
2860
- if (feature.properties["marker-symbol"].indexOf(" ") === -1) { imod = "fa-2x "; }
2861
- myMarker = L.divIcon({
2862
- className:"faicon",
2863
- html: '<center><i class="fa fa-fw '+imod+feature.properties["marker-symbol"]+'" style="color:'+col+'"></i></center>',
2864
- iconSize: [32, 32],
2865
- iconAnchor: [16, 12],
2866
- popupAnchor: [0, -16]
2867
- });
2868
- }
2869
- catch(e) { console.log(e); }
2857
+ var col = feature.properties["marker-color"] ?? "#910000";
2858
+ var imod = "";
2859
+ if (feature.properties["marker-symbol"].indexOf(" ") === -1) { imod = "fa-2x "; }
2860
+ myMarker = L.divIcon({
2861
+ className:"faicon",
2862
+ html: '<center><i class="fa fa-fw '+imod+feature.properties["marker-symbol"]+'" style="color:'+col+'"></i></center>',
2863
+ iconSize: [32, 32],
2864
+ iconAnchor: [16, 12],
2865
+ popupAnchor: [0, -16]
2866
+ });
2870
2867
  }
2871
2868
  else {
2872
2869
  myMarker = L.VectorMarkers.icon({