node-red-contrib-web-worldmap 2.37.1 → 2.37.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.37.2 - If custom layer is only layer then show it automatically. Issue #230
3
4
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
4
5
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
5
6
  - v2.36.0 - Add edge icons for SIDC markers just off the map.
package/README.md CHANGED
@@ -11,6 +11,7 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230
14
15
  - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229
15
16
  - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225)
16
17
  - 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.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",
@@ -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")) {