node-red-contrib-web-worldmap 5.6.0 → 5.6.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
+ - v5.6.1 - Also call autoswitch on initial connect to ensure map in view.
3
4
  - v5.6.0 - Autoswitch pmtiles basemaps based on zoom and/or coverage.
4
5
  - v5.5.8 - Bump qs dep for CVE
5
6
  - v5.5.7 - Fix COG handling for built in icons, bump various libs for CVEs
package/README.md CHANGED
@@ -10,6 +10,7 @@ A <a href="https://nodered.org" target="mapinfo">Node-RED</a> node to provide a
10
10
 
11
11
  ### Updates
12
12
 
13
+ - v5.6.1 - Also call autoswitch on initial connect to ensure map in view.
13
14
  - v5.6.0 - Autoswitch pmtiles basemaps based on zoom and/or coverage.
14
15
  - v5.5.8 - Bump qs dep for CVE
15
16
  - v5.5.7 - Fix COG handling for built in icons, bump various libs for CVEs
@@ -21,12 +22,6 @@ A <a href="https://nodered.org" target="mapinfo">Node-RED</a> node to provide a
21
22
  - v5.4.0 - Let msg.payload.command.zoomLevels set an array of acceptable zoom levels. Issue #312
22
23
  - v5.3.0 - Let msg.payload.popupOptions object set Leaflet popup options so it can be customised. Issue #311
23
24
  - v5.2.0 - Allow left click send back co-ords. Let Button be replaceable more easily and take value property. Issue #308 and #309
24
- - v5.1.6 - Let Cot __milsym set the SIDC if present.
25
- - v5.1.5 - Fix links to SIDC unitgenerator so it is now local.
26
- - v5.1.4 - Fix clearlayer for tracks node.
27
- - v5.1.2 - Fix for longer line msg properties.
28
- - v5.1.1 - Fix CoT inline image.
29
- - v5.1.0 - Let special icons be sizeable using iconSize property.
30
25
 
31
26
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
32
27
 
@@ -94,6 +94,7 @@ function pathToRegexp(path, keys, options) {
94
94
  pos = offset + match.length;
95
95
 
96
96
  if (match === '*') {
97
+ backtrack = '';
97
98
  extraOffset += 3;
98
99
  return '(.*)';
99
100
  }
@@ -123,6 +124,7 @@ function pathToRegexp(path, keys, options) {
123
124
  + ')'
124
125
  + optional;
125
126
 
127
+ backtrack = '';
126
128
  extraOffset += result.length - match.length;
127
129
 
128
130
  return result;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "path-to-regexp",
3
3
  "description": "Express style path to RegExp utility",
4
- "version": "0.1.12",
4
+ "version": "0.1.13",
5
5
  "files": [
6
6
  "index.js",
7
7
  "LICENSE"
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "5.6.0",
3
+ "version": "5.6.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
- "@turf/bezier-spline": "~7.3.4",
6
+ "@turf/bezier-spline": "7.3.4",
7
7
  "cgi": "0.3.1",
8
- "compression": "^1.8.1",
9
- "express": "^4.22.1",
10
- "sockjs": "~0.3.24"
8
+ "compression": "1.8.1",
9
+ "express": "4.22.1",
10
+ "sockjs": "0.3.24"
11
11
  },
12
12
  "overrides": {
13
13
  "express": {
14
14
  "body-parser": {
15
- "qs": "^6.14.2"
15
+ "qs": "6.14.2"
16
16
  }
17
17
  }
18
18
  },
@@ -94,7 +94,7 @@ var connect = function() {
94
94
  document.getElementById("footer").innerHTML = "<font color='#494'>"+pagefoot+"</font>";
95
95
  }
96
96
  ws.send(JSON.stringify({action:"connected",parameters:Object.fromEntries((new URL(location)).searchParams),clientTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone || false}));
97
- setTimeout(function() { onoffline(); }, 500);
97
+ setTimeout(function() { onoffline(); pickMapLayer();}, 500);
98
98
  };
99
99
  ws.onclose = function() {
100
100
  console.log("DISCONNECTED");
@@ -862,23 +862,7 @@ function showMapCurrentZoom() {
862
862
  },750);
863
863
  }
864
864
 
865
- map.on('zoomend', function() {
866
- showMapCurrentZoom();
867
- window.localStorage.setItem("lastzoom", map.getZoom());
868
- var b = map.getBounds();
869
- oldBounds = {sw:{lat:b._southWest.lat,lng:b._southWest.lng},ne:{lat:b._northEast.lat,lng:b._northEast.lng}};
870
- ws.send(JSON.stringify({action:"bounds", south:b._southWest.lat, west:b._southWest.lng, north:b._northEast.lat, east:b._northEast.lng, zoom:map.getZoom() }));
871
- edgeAware();
872
- });
873
- map.on('moveend', function() {
874
- window.localStorage.setItem("lastpos",JSON.stringify(map.getCenter()));
875
- var b = map.getBounds();
876
- if (b._southWest.lat !== oldBounds.sw.lat && b._southWest.lng !== oldBounds.sw.lng && b._northEast.lat !== oldBounds.ne.lat && b._northEast.lng !== oldBounds.ne.lng) {
877
- ws.send(JSON.stringify({action:"bounds", south:b._southWest.lat, west:b._southWest.lng, north:b._northEast.lat, east:b._northEast.lng, zoom:map.getZoom() }));
878
- oldBounds = {sw:{lat:b._southWest.lat,lng:b._southWest.lng},ne:{lat:b._northEast.lat,lng:b._northEast.lng}};
879
- }
880
- edgeAware();
881
-
865
+ function pickMapLayer() {
882
866
  // if we have bounds meta data for the current baselayer (usually pmtiles)
883
867
  if (basemaps[baselayername] && basemaps[baselayername].hasOwnProperty("meta")) {
884
868
  const m = basemaps[baselayername].meta
@@ -931,6 +915,25 @@ map.on('moveend', function() {
931
915
  }
932
916
  }
933
917
  }
918
+ }
919
+
920
+ map.on('zoomend', function() {
921
+ showMapCurrentZoom();
922
+ window.localStorage.setItem("lastzoom", map.getZoom());
923
+ var b = map.getBounds();
924
+ oldBounds = {sw:{lat:b._southWest.lat,lng:b._southWest.lng},ne:{lat:b._northEast.lat,lng:b._northEast.lng}};
925
+ ws.send(JSON.stringify({action:"bounds", south:b._southWest.lat, west:b._southWest.lng, north:b._northEast.lat, east:b._northEast.lng, zoom:map.getZoom() }));
926
+ edgeAware();
927
+ });
928
+ map.on('moveend', function() {
929
+ window.localStorage.setItem("lastpos",JSON.stringify(map.getCenter()));
930
+ var b = map.getBounds();
931
+ if (b._southWest.lat !== oldBounds.sw.lat && b._southWest.lng !== oldBounds.sw.lng && b._northEast.lat !== oldBounds.ne.lat && b._northEast.lng !== oldBounds.ne.lng) {
932
+ ws.send(JSON.stringify({action:"bounds", south:b._southWest.lat, west:b._southWest.lng, north:b._northEast.lat, east:b._northEast.lng, zoom:map.getZoom() }));
933
+ oldBounds = {sw:{lat:b._southWest.lat,lng:b._southWest.lng},ne:{lat:b._northEast.lat,lng:b._northEast.lng}};
934
+ }
935
+ edgeAware();
936
+ pickMapLayer();
934
937
  });
935
938
  map.on('locationfound', onLocationFound);
936
939
  map.on('locationerror', onLocationError);
package/worldmap.js CHANGED
@@ -270,7 +270,7 @@ module.exports = function(RED) {
270
270
  ui = RED.require("node-red-dashboard")(RED);
271
271
  }
272
272
  catch(e) {
273
- RED.log.info("Node-RED Dashboard 1 not found - ui_worldmap node not installed.");
273
+ // RED.log.info("Node-RED Dashboard 1 not found - ui_worldmap node not installed.");
274
274
  }
275
275
  setTimeout( function() {
276
276
  if (ui) {