node-red-contrib-web-worldmap 4.8.0 → 4.8.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,6 +1,7 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
- - v4.8.0 - Merged PR for feedback functioanlity cleanup and example. PR #271 and #272
3
+ - v4.8.1 - Slight tidy of some of the geojson handling
4
+ - v4.8.0 - Merged PR for feedback functionality cleanup and example. PR #271 and #272
4
5
  - v4.7.0 - Update pmtiles library, fix feedback function inconsistency. Issue #270
5
6
  - v4.6.5 - Let geojson allow for generic overrides with .icon and .layer.
6
7
  - v4.6.4 - Fix deletion of layers logic to actually fully remove points.
package/README.md CHANGED
@@ -13,7 +13,8 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
13
13
 
14
14
  ### Updates
15
15
 
16
- - v4.8.0 - Merged PR for feedback functioanlity cleanup and example. PR #271 and #272
16
+ - v4.8.1 - Slight tidy of some of the geojson handling
17
+ - v4.8.0 - Merged PR for feedback functionality cleanup and example. PR #271 and #272
17
18
  - v4.7.0 - Update pmtiles library, fix feedback function inconsistency. Issue #270
18
19
  - v4.6.5 - Let geojson allow for generic overrides with .icon and .layer.
19
20
  - v4.6.4 - Fix deletion of layers logic to actually fully remove points.
@@ -397,7 +398,7 @@ Optional properties for **msg.payload.command** include
397
398
  - **panit** - auto pan to the latest marker updated. - `{"command":{"panit":true}}`
398
399
  - **zoomlock** - locks the zoom control to the current value and removes zoom control - `{"command":{"zoomlock":true}}`
399
400
  - **hiderightclick** - disables the right click that allows adding or deleting points on the map - `{"command":{"hiderightclick":true}}`
400
- - **coords** - turns on and off a display of the current mouse co-ordinates. Values can be "deg", "dms", or "none" (default). - `{"command":{"coords":"deg"}}`
401
+ - **coords** - turns on and off a display of the current mouse co-ordinates. Values can be "deg", "dms", "utm", "mgrs", "qth" or "none" (default). - `{"command":{"coords":"deg"}}` , `{"command":{"coords":"deg,dms,utm"}}`
401
402
  - **showruler** - turns on and off a display of the ruler control. Values can be "true" or "false". - `{"command": {"ruler": {"showruler": true}}}`
402
403
  - **button** - if supplied with a `name` and `icon` property - adds a button to provide user input - sends
403
404
  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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "4.8.0",
3
+ "version": "4.8.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",
@@ -868,7 +868,7 @@ var feedback = function(n,v,a,c) {
868
868
  /*
869
869
  // suggest to reove all the special handling for simplification, no reason to send information
870
870
  // about entities that the backend generaed, the need is only to get recognizable actions from the frontend
871
- //
871
+ //
872
872
  if (v === "_form") { v = form; }
873
873
  if (markers[n]) {
874
874
  console.log("FB1",n,v,a,c)
@@ -891,7 +891,7 @@ var feedback = function(n,v,a,c) {
891
891
  ws.send(JSON.stringify({action:a||"feedback", name:n, value:v, lat:rclk.lat, lon:rclk.lng}));
892
892
  }
893
893
  */
894
-
894
+
895
895
  const dataToSend = { "name": n, "action": a || "feedback", "value": v || null };
896
896
  ws.send(JSON.stringify(dataToSend));
897
897
  if (c === true) { map.closePopup(); }
@@ -2558,11 +2558,11 @@ function doCommand(cmd) {
2558
2558
  try { coords.removeFrom(map); }
2559
2559
  catch(e) {}
2560
2560
  var opts = {gps:false, gpsLong:false, utm:false, utmref:false, position:"bottomleft"}
2561
- if (cmd.coords == "deg") { opts.gps = true; }
2562
- if (cmd.coords == "dms") { opts.gpsLong = true; }
2563
- if (cmd.coords == "utm") { opts.utm = true; }
2564
- if (cmd.coords == "mgrs") { opts.utmref = true; }
2565
- if (cmd.coords == "qth") { opts.qth = true; }
2561
+ if (cmd.coords.includes("deg")) { opts.gps = true; }
2562
+ if (cmd.coords.includes("dms")) { opts.gpsLong = true; }
2563
+ if (cmd.coords.includes("utm")) { opts.utm = true; }
2564
+ if (cmd.coords.includes("mgrs")) { opts.utmref = true; }
2565
+ if (cmd.coords.includes("qth")) { opts.qth = true; }
2566
2566
  coords.options = opts;
2567
2567
  coords.addTo(map);
2568
2568
  }
@@ -3111,12 +3111,16 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
3111
3111
  st.weight = feature.properties["stroke-width"] ?? st.weight;
3112
3112
  st.fillColor = feature.properties["fill-color"] ?? feature.properties["fill"] ?? st.fillColor;
3113
3113
  st.fillOpacity = feature.properties["fill-opacity"] ?? st.fillOpacity;
3114
+ st.fontColor = feature.properties["font-color"] ?? st.fontColor ?? "#000000";
3115
+ st.fontOpacity = feature.properties["font-opacity"] ?? st.fontOpacity;
3114
3116
  delete feature.properties["stroke"];
3115
3117
  delete feature.properties["stroke-width"];
3116
- delete feature.properties["fill-color"];
3118
+ delete feature.properties["stroke-opacity"];
3117
3119
  delete feature.properties["fill"];
3120
+ delete feature.properties["fill-color"];
3118
3121
  delete feature.properties["fill-opacity"];
3119
- delete feature.properties["stroke-opacity"];
3122
+ delete feature.properties["font-color"];
3123
+ delete feature.properties["font-opacity"];
3120
3124
  }
3121
3125
  if (feature.hasOwnProperty("style")) {
3122
3126
  //console.log("GSTYLE", feature.style)
@@ -3141,17 +3145,17 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
3141
3145
  }
3142
3146
  if (feature.properties.hasOwnProperty("SIDC")) {
3143
3147
  myMarker = new ms.Symbol( feature.properties.SIDC.toUpperCase(), {
3144
- uniqueDesignation:unescape(encodeURIComponent(feature.properties.title||feature.properties.unit)),
3148
+ uniqueDesignation:unescape(encodeURIComponent(feature.properties.title||feature.properties.unit||'')),
3145
3149
  country:feature.properties.country,
3146
3150
  direction:feature.properties.bearing,
3147
3151
  additionalInformation:feature.properties.modifier,
3148
- size:25
3152
+ size:20
3149
3153
  });
3150
3154
  var anc = myMarker.getAnchor();
3151
- if (myMarker.hasOwnProperty("metadata") && myMarker.metadata.hasOwnProperty("echelon")) {
3152
- var sz = iconSz[myMarker.metadata.echelon];
3153
- myMarker.setOptions({size:sz});
3154
- }
3155
+ // if (myMarker.hasOwnProperty("metadata") && myMarker.metadata.hasOwnProperty("echelon")) {
3156
+ // var sz = iconSz[myMarker.metadata.echelon];
3157
+ // myMarker.setOptions({size:sz});
3158
+ // }
3155
3159
  myMarker = L.icon({
3156
3160
  iconUrl: myMarker.toDataURL(),
3157
3161
  iconAnchor: [anc.x, anc.y],
@@ -3178,8 +3182,10 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
3178
3182
  iconColor: 'white'
3179
3183
  });
3180
3184
  }
3181
- if (!feature.properties.hasOwnProperty("title")) {
3182
- feature.properties.title = feature.properties["marker-symbol"];
3185
+ if (!feature.properties.hasOwnProperty("title") && feature.properties.hasOwnProperty("marker-symbol")) {
3186
+ if (!feature.properties["marker-symbol"].indexOf('fa-') === 0) {
3187
+ feature.properties.title = feature.properties["marker-symbol"];
3188
+ }
3183
3189
  }
3184
3190
  if (feature.properties.hasOwnProperty("url")) {
3185
3191
  feature.properties.url = "<a target='_new' href='"+feature.properties.url+"'>"+feature.properties.url+"</a>";