node-red-contrib-web-worldmap 4.3.0 → 4.3.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 +1 -0
- package/README.md +1 -0
- package/package.json +5 -2
- package/worldmap/worldmap.js +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
### Change Log for Node-RED Worldmap
|
|
2
2
|
|
|
3
|
+
- v4.3.1 - Small fix to icon transparency, and routing detail.
|
|
3
4
|
- v4.3.0 - Add support for PMtiles files.
|
|
4
5
|
- v4.2.1 - Revert use of optional chaining to extend life slightly. Issue #252
|
|
5
6
|
- v4.2.0 - Let icons also be inline images data:image...
|
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Feel free to [ {
|
|
|
1278
1278
|
return x.lng+","+x.lat;
|
|
1279
1279
|
})).join(';');
|
|
1280
1280
|
|
|
1281
|
-
fetch('https://router.project-osrm.org/route/v1/driving/'+p)
|
|
1281
|
+
fetch('https://router.project-osrm.org/route/v1/driving/'+p+'?overview=full')
|
|
1282
1282
|
.then(response => response.json())
|
|
1283
1283
|
.then(data => {
|
|
1284
1284
|
if (data.code !== "Ok") { sendDrawing(n); }
|
|
@@ -1554,15 +1554,12 @@ function setMarker(data) {
|
|
|
1554
1554
|
opt.color = opt.color ?? data.color ?? data.lineColor ?? "#910000";
|
|
1555
1555
|
opt.fillColor = opt.fillColor ?? data.fillColor ?? "#910000";
|
|
1556
1556
|
opt.stroke = opt.stroke ?? (data.hasOwnProperty("stroke")) ? data.stroke : true;
|
|
1557
|
-
opt.weight = opt.weight ?? data.weight;
|
|
1558
|
-
opt.opacity = opt.opacity ?? data.opacity;
|
|
1559
|
-
opt.fillOpacity = opt.fillOpacity ?? data.fillOpacity;
|
|
1557
|
+
opt.weight = opt.weight ?? data.weight ?? 2;
|
|
1558
|
+
opt.opacity = opt.opacity ?? data.opacity ?? 1;
|
|
1559
|
+
if (!data.SIDC) { opt.fillOpacity = opt.fillOpacity ?? data.fillOpacity ?? 0.2; }
|
|
1560
1560
|
opt.clickable = (data.hasOwnProperty("clickable")) ? data.clickable : false;
|
|
1561
1561
|
opt.fill = opt.fill ?? (data.hasOwnProperty("fill")) ? data.fill : true;
|
|
1562
1562
|
if (data.hasOwnProperty("dashArray")) { opt.dashArray = data.dashArray; }
|
|
1563
|
-
if (opt.fillOpacity === undefined) { opt.fillOpacity = 0.2; }
|
|
1564
|
-
if (opt.opacity === undefined) { opt.opacity = 1; }
|
|
1565
|
-
if (opt.weight === undefined) { opt.weight = 2; }
|
|
1566
1563
|
|
|
1567
1564
|
// Replace building
|
|
1568
1565
|
if (data.hasOwnProperty("building")) {
|
|
@@ -2056,6 +2053,7 @@ function setMarker(data) {
|
|
|
2056
2053
|
});
|
|
2057
2054
|
marker = L.marker(ll, { title:data.name, icon:myicon, draggable:drag });
|
|
2058
2055
|
edgeAware();
|
|
2056
|
+
delete data.options;
|
|
2059
2057
|
}
|
|
2060
2058
|
else { // Otherwise just a generic map marker pin
|
|
2061
2059
|
myMarker = L.VectorMarkers.icon({
|
|
@@ -2567,7 +2565,7 @@ function doCommand(cmd) {
|
|
|
2567
2565
|
basemaps[baselayername].addTo(map);
|
|
2568
2566
|
}
|
|
2569
2567
|
}
|
|
2570
|
-
// Add a new PMtiles/PBF feature
|
|
2568
|
+
// Add a new PMtiles/PBF feature baselayer
|
|
2571
2569
|
if (cmd.map && cmd.map.hasOwnProperty("name") && cmd.map.hasOwnProperty("pmtiles") ) {
|
|
2572
2570
|
try {
|
|
2573
2571
|
if (basemaps.hasOwnProperty(cmd.map.name)) {
|
|
@@ -2865,7 +2863,7 @@ function doCommand(cmd) {
|
|
|
2865
2863
|
if (cmd.map.hasOwnProperty("fly") && cmd.map.fly === true) { map.flyToBounds(overlays[cmd.map.overlay].getBounds()); }
|
|
2866
2864
|
else if (cmd.map.hasOwnProperty("fit") && cmd.map.fit === true) { map.fitBounds(overlays[cmd.map.overlay].getBounds()); }
|
|
2867
2865
|
}
|
|
2868
|
-
// Add a new overlay layer
|
|
2866
|
+
// Add a new leaflet (or WMS) overlay layer
|
|
2869
2867
|
if (cmd.map && cmd.map.hasOwnProperty("overlay") && cmd.map.hasOwnProperty("url") && cmd.map.hasOwnProperty("opt")) {
|
|
2870
2868
|
console.log("New overlay:",cmd.map.overlay);
|
|
2871
2869
|
if (overlays.hasOwnProperty(cmd.map.overlay)) { existsalready = true; }
|