node-red-contrib-web-worldmap 2.37.1 → 2.37.3

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,7 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.37.3 - Fix hang on layer change
4
+ - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
3
5
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
4
6
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
5
7
  - v2.36.0 - Add edge icons for SIDC markers just off the map.
package/README.md CHANGED
@@ -11,6 +11,8 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.37.3 - Fix hang on layer change
15
+ - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
14
16
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
15
17
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
16
18
  - v2.36.0 - Add edge icons for SIDC markers just off the map.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.37.1",
3
+ "version": "2.37.3",
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",
@@ -389,7 +389,7 @@ var edgeAware = function() {
389
389
 
390
390
  var viewBounds = L.latLngBounds(map.options.crs.pointToLatLng(L.point(pSW.x - (pCenter.x - pSW.x ), pSW.y - (pCenter.y - pSW.y )), map.getZoom()) , map.options.crs.pointToLatLng(L.point(pNE.x + (pNE.x - pCenter.x) , pNE.y + (pNE.y - pCenter.y) ), map.getZoom()) );
391
391
  for (var id in markers) {
392
- if (allData[id].hasOwnProperty("SIDC")) {
392
+ if (allData[id] && allData[id].hasOwnProperty("SIDC")) {
393
393
  markerLatLng = markers[id].getLatLng();
394
394
  if ( viewBounds.contains(markerLatLng) && !mapBounds.contains(markerLatLng) ) {
395
395
  var k = (markerLatLng.lat - mapBoundsCenter.lat) / (markerLatLng.lng - mapBoundsCenter.lng);
@@ -2388,6 +2388,11 @@ function doCommand(cmd) {
2388
2388
  if (!existsalready) {
2389
2389
  layercontrol.addBaseLayer(basemaps[cmd.map.name],cmd.map.name);
2390
2390
  }
2391
+ // if new layer is only layer then show it.
2392
+ if (Object.keys(basemaps).length === 1) {
2393
+ baselayername = cmd.map.name;
2394
+ basemaps[baselayername].addTo(map);
2395
+ }
2391
2396
  }
2392
2397
  // Add or swap new minimap layer
2393
2398
  if (cmd.map && cmd.map.hasOwnProperty("minimap")) {