node-red-contrib-web-worldmap 2.38.1 → 2.38.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
+ - v2.38.2 - Better fix for geojson multipoint icons.
3
4
  - v2.38.1 - Fix for geojson multipoint icons.
4
5
  - v2.38.0 - Return client headers as part of connect message.
5
6
  - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
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.2 - Better fix for geojson multipoint icons.
16
17
  - v2.38.1 - Fix for geojson multipoint icons.
17
18
  - v2.38.0 - Return client headers as part of connect message.
18
19
  - v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.38.1",
3
+ "version": "2.38.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": "~6.5.0",
@@ -2853,6 +2853,21 @@ function doGeojson(n,g,l,o) {
2853
2853
  className: "natoicon",
2854
2854
  });
2855
2855
  }
2856
+ else if (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); }
2870
+ }
2856
2871
  else {
2857
2872
  myMarker = L.VectorMarkers.icon({
2858
2873
  icon: feature.properties["marker-symbol"] ?? "circle",
@@ -2867,21 +2882,21 @@ function doGeojson(n,g,l,o) {
2867
2882
  if (feature.properties.hasOwnProperty("url")) {
2868
2883
  feature.properties.url = "<a target='_new' href='"+feature.properties.url+"'>"+feature.properties.url+"</a>";
2869
2884
  }
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
- }
2875
2885
  var nf = {title:feature.properties.title, name:feature.properties.name};
2876
2886
  feature.properties = Object.assign(nf, feature.properties);
2877
2887
  return L.marker(latlng, {title:feature.properties.title ?? "", icon:myMarker});
2878
2888
  }
2879
2889
  opt.onEachFeature = function (f,l) {
2880
2890
  if (f.properties && Object.keys(f.properties).length > 0) {
2881
- var tx = JSON.stringify(f.properties,null,' ');
2891
+ var tx = JSON.parse(JSON.stringify(f.properties,null,' '));
2892
+ delete tx["marker-symbol"];
2893
+ delete tx["marker-color"];
2894
+ delete tx["marker-size"];
2895
+ tx = JSON.stringify(tx,null,' ');
2882
2896
  if ( tx !== "{}") {
2883
- l.bindPopup('<pre style="overflow-x: scroll">'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>');
2897
+ l.bindPopup('<pre style="overflow-x: scroll">'+tx.replace(/[\{\}"]/g,'')+'</pre>');
2884
2898
  }
2899
+ console.log("TX",tx.replace(/[\{\}"]/g,''))
2885
2900
  }
2886
2901
  if (o && o.hasOwnProperty("clickable") && o.clickable === true) {
2887
2902
  l.on('click', function (e) {