node-red-contrib-web-worldmap 2.24.3 → 2.25.0
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 +1 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/worldmap/worldmap.js +5 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ map web page for plotting "things" on.
|
|
|
11
11
|
|
|
12
12
|
### Updates
|
|
13
13
|
|
|
14
|
+
- v2.25.0 - Add bounds command to set overall map bounds.
|
|
14
15
|
- v2.24.3 - Fix geojson incorrect fill.
|
|
15
16
|
- v2.24.2 - Changes to drawing colours to be more visible.
|
|
16
17
|
- v2.24.1 - Fix ellipse accuracy
|
|
@@ -388,6 +389,7 @@ Optional properties include
|
|
|
388
389
|
- **lat** - move map to specified latitude.
|
|
389
390
|
- **lon** - move map to specified longitude.
|
|
390
391
|
- **zoom** - move map to specified zoom level (1 - world, 13 to 20 max zoom depending on map).
|
|
392
|
+
- **bounds** - if set to an array `[ [ lat(S), lon(W) ], [lat(N), lon(E)] ]` - sets the overall map bounds.
|
|
391
393
|
- **layer** - set map to specified base layer name - `{"command":{"layer":"Esri"}}`
|
|
392
394
|
- **search** - search markers on map for name containing `string`. If not found in existing markers, will then try geocoding looking using Nominatim. An empty string `""` clears the search results. - `{"command":{"search":"Winchester"}}`
|
|
393
395
|
- **showlayer** - show the named overlay(s) - `{"command":{"showlayer":"foo"}}` or `{"command":{"showlayer":["foo","bar"]}}`
|
package/package.json
CHANGED
package/worldmap/worldmap.js
CHANGED
|
@@ -2622,6 +2622,11 @@ function doCommand(cmd) {
|
|
|
2622
2622
|
map.touchZoom.enable();
|
|
2623
2623
|
}
|
|
2624
2624
|
}
|
|
2625
|
+
if (cmd.hasOwnProperty("bounds")) { // Move/Zoom map to new bounds
|
|
2626
|
+
if (cmd.bounds.length === 2 && cmd.bounds[0].length === 2 && cmd.bounds[1].length === 2) {
|
|
2627
|
+
map.fitBounds(cmd.bounds);
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2625
2630
|
}
|
|
2626
2631
|
|
|
2627
2632
|
// handle any incoming GEOJSON directly - may style badly
|