node-red-contrib-web-worldmap 5.0.8 → 5.0.9
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/.github/dependabot.yml +11 -0
- package/CHANGELOG.md +1 -0
- package/README.md +1 -0
- package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bezier-spline/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bezier-spline/package.json +10 -10
- package/node_modules/@turf/helpers/README.md +199 -154
- package/node_modules/@turf/helpers/dist/cjs/index.cjs +10 -7
- package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/helpers/dist/cjs/index.d.cts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.d.ts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.js +10 -7
- package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/helpers/package.json +8 -8
- package/node_modules/@turf/invariant/README.md +4 -0
- package/node_modules/@turf/invariant/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/invariant/dist/cjs/index.d.cts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.d.ts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/invariant/package.json +9 -9
- package/node_modules/@types/geojson/README.md +1 -1
- package/node_modules/@types/geojson/index.d.ts +4 -1
- package/node_modules/@types/geojson/package.json +4 -3
- package/node_modules/express/History.md +10 -1
- package/node_modules/express/package.json +6 -2
- package/node_modules/path-to-regexp/index.js +13 -3
- package/node_modules/path-to-regexp/package.json +1 -1
- package/package.json +3 -3
- package/worldmap/index.html +2 -2
- package/worldmap/leaflet/leaflet-side-by-side.js +148 -147
- package/worldmap/worldmap.js +55 -50
- package/worldmap.js +8 -7
- package/worldmap/leaflet/dialog-polyfill.css +0 -37
- package/worldmap/leaflet/dialog-polyfill.js +0 -736
package/worldmap/worldmap.js
CHANGED
|
@@ -118,17 +118,17 @@ console.log("CONNECT TO",location.pathname + 'socket');
|
|
|
118
118
|
var handleData = function(data) {
|
|
119
119
|
if (Array.isArray(data)) {
|
|
120
120
|
// console.log("ARRAY:",data.length);
|
|
121
|
-
for (var prop
|
|
122
|
-
if (
|
|
123
|
-
if (
|
|
124
|
-
setMarker(
|
|
125
|
-
// bnds.extend(markers[
|
|
126
|
-
}
|
|
127
|
-
else if (
|
|
128
|
-
data = {command:{map:{overlay:"KML", kml:
|
|
121
|
+
for (var prop of data) {
|
|
122
|
+
if (prop.command) { doCommand(prop.command); delete prop.command; }
|
|
123
|
+
if (prop.hasOwnProperty("name")) {
|
|
124
|
+
setMarker(prop);
|
|
125
|
+
// bnds.extend(markers[prop.name].getLatLng());
|
|
126
|
+
}
|
|
127
|
+
else if (prop.hasOwnProperty("filename") && prop.filename === "doc.kml") {
|
|
128
|
+
data = {command:{map:{overlay:"KML", kml:prop.payload}}};
|
|
129
129
|
doCommand(data.command); return;
|
|
130
130
|
}
|
|
131
|
-
else { console.log("SKIP array item",
|
|
131
|
+
else { console.log("SKIP array item",prop); }
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
@@ -146,25 +146,25 @@ var handleData = function(data) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// handle any commands in the data
|
|
149
|
-
if (data
|
|
149
|
+
if (data?.command) { doCommand(data.command); delete data.command; }
|
|
150
150
|
|
|
151
151
|
// handle raw geojson type msg
|
|
152
|
-
if (data
|
|
152
|
+
if (data?.type && data.type.indexOf("Feature") === 0) {
|
|
153
153
|
if (data?.properties?.title) {
|
|
154
154
|
doGeojson(data.properties.title,data,data?.layer,data?.options,data?.icon) // name, geojson, layer, options, icon
|
|
155
155
|
}
|
|
156
156
|
else { doGeojson("geojson",data,data?.layer,data?.options,data?.icon); }
|
|
157
157
|
}
|
|
158
158
|
// handle TAK json (from tak-ingest node or fastxml node)
|
|
159
|
-
else if (data
|
|
159
|
+
else if (data?.event?.point) {
|
|
160
160
|
doTAKjson(data.event);
|
|
161
161
|
}
|
|
162
162
|
// handle TAK json (from multicast Protobuf via tak-ingest node)
|
|
163
|
-
else if (data
|
|
163
|
+
else if (data?.cotEvent && data.cotEvent.hasOwnProperty("lat") && data.cotEvent.hasOwnProperty("lon")) {
|
|
164
164
|
doTAKMCjson(data.cotEvent);
|
|
165
165
|
}
|
|
166
166
|
// handle default worldmap json msg
|
|
167
|
-
else if (data
|
|
167
|
+
else if (data?.name) { setMarker(data); }
|
|
168
168
|
else {
|
|
169
169
|
if (JSON.stringify(data) !== '{}') {
|
|
170
170
|
console.log("SKIP",data);
|
|
@@ -329,7 +329,7 @@ var errRing;
|
|
|
329
329
|
function onLocationFound(e) {
|
|
330
330
|
if (followState === true) { map.panTo(e.latlng); }
|
|
331
331
|
if (followMode.icon) {
|
|
332
|
-
var self = {name:followMode.name || "self", lat:e.latlng.lat, lon:e.latlng.lng, hdg:e
|
|
332
|
+
var self = {name:followMode.name || "self", lat:e.latlng.lat, lon:e.latlng.lng, hdg:isNaN(e?.heading * 1) ? undefined : e?.heading * 1, speed:isNaN(e?.speed * 1) ? undefined : e?.speed * 1, layer:followMode.layer, icon:followMode.icon, iconColor:followMode.iconColor ?? "#910000" };
|
|
333
333
|
setMarker(self);
|
|
334
334
|
}
|
|
335
335
|
if (e.heading !== null) { map.setBearing(e.heading); }
|
|
@@ -344,7 +344,7 @@ function onLocationFound(e) {
|
|
|
344
344
|
// L.polygon([ e.latlng, lla ], {color:"00ffff", weight:3, opacity:0.5, clickable:false}).addTo(map);
|
|
345
345
|
// }
|
|
346
346
|
}
|
|
347
|
-
ws.send(JSON.stringify({action:"point", lat:e.latlng.lat.toFixed(5), lon:e.latlng.lng.toFixed(5), point:"self", hdg:e
|
|
347
|
+
ws.send(JSON.stringify({action:"point", lat:e.latlng.lat.toFixed(5), lon:e.latlng.lng.toFixed(5), point:"self", hdg:isNaN(e?.heading * 1) ? undefined : e?.heading * 1, speed:isNaN(e?.speed * 1) ? undefined : e?.speed * 1}));
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
function onLocationError(e) { console.log(e.message); }
|
|
@@ -452,8 +452,9 @@ var edgeAware = function () {
|
|
|
452
452
|
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()) );
|
|
453
453
|
for (var id in markers) {
|
|
454
454
|
if (allData[id] && allData[id].hasOwnProperty("SIDC")) {
|
|
455
|
-
markerLatLng = markers[id].getLatLng();
|
|
455
|
+
var markerLatLng = markers[id].getLatLng();
|
|
456
456
|
if ( viewBounds.contains(markerLatLng) && !mapBounds.contains(markerLatLng) ) {
|
|
457
|
+
var x,y;
|
|
457
458
|
var k = (markerLatLng.lat - mapBoundsCenter.lat) / (markerLatLng.lng - mapBoundsCenter.lng);
|
|
458
459
|
|
|
459
460
|
if (markerLatLng.lng > mapBoundsCenter.lng) { x = mapBounds.getEast() - mapBoundsCenter.lng; }
|
|
@@ -726,12 +727,12 @@ function clearSearch() {
|
|
|
726
727
|
}
|
|
727
728
|
}
|
|
728
729
|
removeMarks();
|
|
729
|
-
if (lockit) {
|
|
730
|
+
// if (lockit) {
|
|
730
731
|
document.getElementById('searchResult').innerHTML = "";
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
|
|
734
|
-
}
|
|
732
|
+
// }
|
|
733
|
+
// else {
|
|
734
|
+
// document.getElementById('searchResult').innerHTML = "";
|
|
735
|
+
// }
|
|
735
736
|
}
|
|
736
737
|
|
|
737
738
|
function removeMarks() {
|
|
@@ -902,7 +903,7 @@ var addThing = function() {
|
|
|
902
903
|
colo = colorKeywordToRGB(colo);
|
|
903
904
|
var hdg = parseFloat(bits[4] || 0);
|
|
904
905
|
var drag = true;
|
|
905
|
-
var regi = /^[
|
|
906
|
+
var regi = /^[SGEIO][A-Z]{3}.*/i; // if it looks like a SIDC code
|
|
906
907
|
var d = {action:"point", name:bits[0].trim(), layer:lay, draggable:drag, lat:rclk.lat, lon:rclk.lng, hdg:hdg, ttl:0 };
|
|
907
908
|
if (regi.test(icon)) {
|
|
908
909
|
d.SIDC = (icon.toUpperCase()+"------------").substr(0,12);
|
|
@@ -1266,7 +1267,7 @@ var addOverlays = function(overlist) {
|
|
|
1266
1267
|
};
|
|
1267
1268
|
|
|
1268
1269
|
var decode = function (encoded, options) {
|
|
1269
|
-
options = defaultOptions(
|
|
1270
|
+
options = defaultOptions();
|
|
1270
1271
|
var flatPoints = decodeDeltas(encoded);
|
|
1271
1272
|
var points = [];
|
|
1272
1273
|
for (var i = 0, len = flatPoints.length; i + (options.dimension - 1) < len;) {
|
|
@@ -1280,7 +1281,7 @@ var addOverlays = function(overlist) {
|
|
|
1280
1281
|
}
|
|
1281
1282
|
|
|
1282
1283
|
var decodeDeltas = function (encoded, options) {
|
|
1283
|
-
options = defaultOptions(
|
|
1284
|
+
options = defaultOptions();
|
|
1284
1285
|
var lastNumbers = [];
|
|
1285
1286
|
var numbers = decodeFloats(encoded, options);
|
|
1286
1287
|
for (var i = 0, len = numbers.length; i < len;) {
|
|
@@ -1292,7 +1293,7 @@ var addOverlays = function(overlist) {
|
|
|
1292
1293
|
}
|
|
1293
1294
|
|
|
1294
1295
|
var decodeFloats = function (encoded, options) {
|
|
1295
|
-
options = defaultOptions(
|
|
1296
|
+
options = defaultOptions();
|
|
1296
1297
|
var numbers = decodeSignedIntegers(encoded);
|
|
1297
1298
|
for (var i = 0, len = numbers.length; i < len; ++i) {
|
|
1298
1299
|
numbers[i] /= options.factor;
|
|
@@ -1564,6 +1565,7 @@ var rangerings = function(latlng, options) {
|
|
|
1564
1565
|
|
|
1565
1566
|
// the MAIN add marker or shape to map function
|
|
1566
1567
|
function setMarker(data) {
|
|
1568
|
+
if (!data) { return; }
|
|
1567
1569
|
var rightmenu = function(m) {
|
|
1568
1570
|
m.on('click', function(e) {
|
|
1569
1571
|
var fb = allData[data["name"]];
|
|
@@ -1756,7 +1758,7 @@ function setMarker(data) {
|
|
|
1756
1758
|
polygons[data["name"]].lay = lay;
|
|
1757
1759
|
// if clickable then add popup
|
|
1758
1760
|
if (opt.clickable === true) {
|
|
1759
|
-
|
|
1761
|
+
let words = "<b>"+data["name"]+"</b>";
|
|
1760
1762
|
if (data.popup) { words = words + "<br/>" + data.popup.replace(/\${name}/g,data["name"]); }
|
|
1761
1763
|
polygons[data["name"]].bindPopup(words, {autoClose:false, closeButton:true, closeOnClick:true, minWidth:200});
|
|
1762
1764
|
}
|
|
@@ -1852,11 +1854,11 @@ function setMarker(data) {
|
|
|
1852
1854
|
data.iconColor = data.iconColor ?? "black";
|
|
1853
1855
|
icon = '<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="20" height="20">';
|
|
1854
1856
|
icon += '<path d="M15.388 4.781c.068.068.061.154-.171.656-.028.06-.18.277-.18.277s.102.113.13.14c.054.055.078.175.056.27-.068.295-.89 1.47-1.35 1.93-.285.286-.432.481-.422.56.009.068.117.356.24.64.219.5.3.599 2.762 3.339 1.95 2.169 2.546 2.87 2.582 3.028.098.439-.282.847-1.264 1.356l-.507.263-7.389-5.29-4.43 3.365.102.18c.056.099.519.676 1.029 1.283.51.607.933 1.161.94 1.232.026.284-1.111 1.177-1.282 1.006-.27-.27-1.399-1.131-1.494-1.14-.068-.007-1.04-.747-1.37-1.077-.329-.33-1.07-1.301-1.076-1.37-.01-.094-.871-1.224-1.14-1.493-.171-.171.722-1.308 1.006-1.282.07.007.625.43 1.231.94.607.51 1.185.973 1.283 1.029l.18.101 3.365-4.43-5.29-7.388.263-.507c.51-.982.918-1.362 1.357-1.264.158.035.859.632 3.028 2.581 2.74 2.462 2.838 2.544 3.339 2.762.284.124.572.232.639.24.08.01.274-.136.56-.422.46-.46 1.635-1.282 1.93-1.35.095-.022.216.003.27.057.028.028.139.129.139.129s.217-.153.277-.18c.502-.233.59-.238.657-.17z" fill="'+data.iconColor+'"/></svg>';
|
|
1855
|
-
var
|
|
1857
|
+
var svgsplane = "data:image/svg+xml;base64," + btoa(icon);
|
|
1856
1858
|
myMarker = L.divIcon({
|
|
1857
1859
|
className:"planeicon",
|
|
1858
1860
|
iconAnchor: [16, 16],
|
|
1859
|
-
html:'<img src="'+
|
|
1861
|
+
html:'<img src="'+svgsplane+'" style="width:32px; height:32px; -webkit-transform:rotate('+(dir - 45)+'deg); -moz-transform:rotate('+(dir - 45)+'deg);"/>'
|
|
1860
1862
|
});
|
|
1861
1863
|
marker = L.marker(ll, {title:data["name"], icon:myMarker, draggable:drag});
|
|
1862
1864
|
}
|
|
@@ -2052,7 +2054,7 @@ function setMarker(data) {
|
|
|
2052
2054
|
}
|
|
2053
2055
|
else if (data.icon.match(/^:.*:$/g)) { // emoji icon :smile:
|
|
2054
2056
|
var em = emojify(data.icon);
|
|
2055
|
-
|
|
2057
|
+
let col = data.iconColor ?? "#910000";
|
|
2056
2058
|
myMarker = L.divIcon({
|
|
2057
2059
|
className:"emicon",
|
|
2058
2060
|
html: '<center><span style="font-size:2em; color:'+col+'">'+em+'</span></center>',
|
|
@@ -2062,7 +2064,7 @@ function setMarker(data) {
|
|
|
2062
2064
|
labelOffset = [12,-4];
|
|
2063
2065
|
}
|
|
2064
2066
|
else if (data.icon.match(/^https?:.*$|^\/|^data:image\//)) { // web url icon https://...
|
|
2065
|
-
|
|
2067
|
+
let sz = data.iconSize ?? 32;
|
|
2066
2068
|
myMarker = L.icon({
|
|
2067
2069
|
iconUrl: data.icon,
|
|
2068
2070
|
iconSize: [sz, sz],
|
|
@@ -2074,8 +2076,8 @@ function setMarker(data) {
|
|
|
2074
2076
|
delete data.iconSize;
|
|
2075
2077
|
}
|
|
2076
2078
|
else if (data.icon.substr(0,3) === "fa-") { // fa icon
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
+
let col = data.iconColor ?? "#910000";
|
|
2080
|
+
let imod = "";
|
|
2079
2081
|
if (data.icon.indexOf(" ") === -1) { imod = "fa-2x "; }
|
|
2080
2082
|
myMarker = L.divIcon({
|
|
2081
2083
|
className:"faicon",
|
|
@@ -2088,8 +2090,8 @@ function setMarker(data) {
|
|
|
2088
2090
|
labelOffset = [8,-8];
|
|
2089
2091
|
}
|
|
2090
2092
|
else if (data.icon.substr(0,3) === "wi-") { // weather icon
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
+
let col = data.iconColor ?? "#910000";
|
|
2094
|
+
let imod = "";
|
|
2093
2095
|
if (data.icon.indexOf(" ") === -1) { imod = "wi-2x "; }
|
|
2094
2096
|
myMarker = L.divIcon({
|
|
2095
2097
|
className:"wiicon",
|
|
@@ -2123,12 +2125,15 @@ function setMarker(data) {
|
|
|
2123
2125
|
}
|
|
2124
2126
|
opts.size = opts.size || sz;
|
|
2125
2127
|
opts.size = opts.size * (opts.scale || 1);
|
|
2126
|
-
if (data.SIDC.length > 12 && /^[A-Za-z]{2}$/gm.test(data.SIDC.substr(12,2))) {
|
|
2128
|
+
if (!data.flag && data.SIDC.length > 12 && /^[A-Za-z]{2}$/gm.test(data.SIDC.substr(12,2))) {
|
|
2127
2129
|
var cc = data.SIDC.substr(12,2).toLowerCase();
|
|
2128
2130
|
opts.country = cc.toUpperCase();
|
|
2129
2131
|
opts.staffComments = emojify(":flag-"+cc+":") + " " + (opts?.staffComments || "");
|
|
2130
2132
|
data.flag = opts.country.toUpperCase() + " " + emojify(":flag-"+cc+":");
|
|
2131
2133
|
}
|
|
2134
|
+
else if(/\p{Emoji}/u.test(data.flag)) {
|
|
2135
|
+
opts.staffComments = data.flag + " " + (opts?.staffComments || "");
|
|
2136
|
+
}
|
|
2132
2137
|
if (data.SIDC.length == 12 && data?.flag && data.flag.length == 2) {
|
|
2133
2138
|
opts.staffComments = emojify(":flag-"+data.flag.toLowerCase()+":") + " " + (opts?.staffComments || "");
|
|
2134
2139
|
}
|
|
@@ -2141,7 +2146,7 @@ function setMarker(data) {
|
|
|
2141
2146
|
opts.country = data.flag.toUpperCase() + " " + emojify(":flag-"+data.flag.toLowerCase()+":");
|
|
2142
2147
|
}
|
|
2143
2148
|
}
|
|
2144
|
-
console.log("OPTS",opts)
|
|
2149
|
+
//console.log("OPTS",opts)
|
|
2145
2150
|
data.speed = opts?.speed || data?.speed; // If SIDC then options.speed can override the speed.
|
|
2146
2151
|
if (data?.speed && !opts?.direction) { opts.direction = data?.track || data?.hdg || data?.heading || data?.COG || data?.bearing }
|
|
2147
2152
|
if (data.speed == undefined) { delete data.speed; }
|
|
@@ -2195,9 +2200,9 @@ function setMarker(data) {
|
|
|
2195
2200
|
marker.on('dragend', function (e) {
|
|
2196
2201
|
var l = marker.getLatLng().toString().replace('LatLng(','lat, lon : ').replace(')','')
|
|
2197
2202
|
marker.setPopupContent(marker.getPopup().getContent().split("lat, lon")[0] + l);
|
|
2198
|
-
var b = marker.getPopup().getContent().split("heading : ");
|
|
2199
|
-
if (b.length === 2) { b = parseFloat(b[1].split("<br")[0]); }
|
|
2200
|
-
else { b = undefined; }
|
|
2203
|
+
// var b = marker.getPopup().getContent().split("heading : ");
|
|
2204
|
+
// if (b.length === 2) { b = parseFloat(b[1].split("<br")[0]); }
|
|
2205
|
+
// else { b = undefined; }
|
|
2201
2206
|
|
|
2202
2207
|
var fb = allData[marker.name];
|
|
2203
2208
|
fb.action = "move";
|
|
@@ -2304,7 +2309,7 @@ function setMarker(data) {
|
|
|
2304
2309
|
delete data.popped;
|
|
2305
2310
|
}
|
|
2306
2311
|
// If .label then use that rather than name tooltip
|
|
2307
|
-
if (data.label) {
|
|
2312
|
+
if (data.hasOwnProperty("label")) {
|
|
2308
2313
|
if (typeof data.label === "boolean" && data.label === true) {
|
|
2309
2314
|
marker.bindTooltip(data["name"], data.tooltipOptions || { permanent:true, direction:"right", offset:labelOffset });
|
|
2310
2315
|
}
|
|
@@ -2315,7 +2320,7 @@ function setMarker(data) {
|
|
|
2315
2320
|
delete data.label;
|
|
2316
2321
|
}
|
|
2317
2322
|
// otherwise check for .tooltip then use that rather than name tooltip
|
|
2318
|
-
else if (data.tooltip) {
|
|
2323
|
+
else if (data.hasOwnProperty("tooltip")) {
|
|
2319
2324
|
if (typeof data.tooltip === "string" && data.tooltip.length > 0) {
|
|
2320
2325
|
marker.bindTooltip(data.tooltip, data.tooltipOptions || { direction:"bottom", offset:[0,4] });
|
|
2321
2326
|
delete marker.options.title;
|
|
@@ -2447,7 +2452,7 @@ function setMarker(data) {
|
|
|
2447
2452
|
polygon.setStyle({opacity:0});
|
|
2448
2453
|
}
|
|
2449
2454
|
}
|
|
2450
|
-
polygon.name = data["name"];
|
|
2455
|
+
if (polygon !== null) { polygon.name = data["name"]; }
|
|
2451
2456
|
if (polygons[data["name"]] != null && polygons[data["name"]].hasOwnProperty("_layers")) {
|
|
2452
2457
|
polygons[data["name"]].addLayer(polygon);
|
|
2453
2458
|
}
|
|
@@ -2553,7 +2558,7 @@ function doCommand(cmd) {
|
|
|
2553
2558
|
}
|
|
2554
2559
|
if (cmd.hasOwnProperty("grid")) {
|
|
2555
2560
|
if (cmd.grid.hasOwnProperty("showgrid")) {
|
|
2556
|
-
|
|
2561
|
+
let changed = false;
|
|
2557
2562
|
if ((cmd.grid.showgrid == "true" || cmd.grid.showgrid == true ) && !showGrid) { changed = true; }
|
|
2558
2563
|
if ((cmd.grid.showgrid == "false" || cmd.grid.showgrid == false ) && showGrid) { changed = true; }
|
|
2559
2564
|
if (changed) {
|
|
@@ -2572,7 +2577,7 @@ function doCommand(cmd) {
|
|
|
2572
2577
|
}
|
|
2573
2578
|
if (cmd.hasOwnProperty("ruler")) {
|
|
2574
2579
|
if (cmd.ruler.hasOwnProperty("showruler")) {
|
|
2575
|
-
|
|
2580
|
+
let changed = false;
|
|
2576
2581
|
if ((cmd.ruler.showruler == "true" || cmd.ruler.showruler == true ) && !showRuler) { changed = true; }
|
|
2577
2582
|
if ((cmd.ruler.showruler == "false" || cmd.ruler.showruler == false ) && showRuler) { changed = true; }
|
|
2578
2583
|
if (changed) {
|
|
@@ -2702,7 +2707,7 @@ function doCommand(cmd) {
|
|
|
2702
2707
|
basemaps[cmd.map.name].removeFrom(map);
|
|
2703
2708
|
existsalready = true;
|
|
2704
2709
|
}
|
|
2705
|
-
|
|
2710
|
+
let opt = {};
|
|
2706
2711
|
if (cmd.map.hasOwnProperty("opt")) { opt = cmd.map.opt || {}; }
|
|
2707
2712
|
|
|
2708
2713
|
if (!opt.paintRules && !opt.labelRules && !opt.backgroundColor && !opt.theme) {
|
|
@@ -2758,7 +2763,7 @@ function doCommand(cmd) {
|
|
|
2758
2763
|
existsalready = true;
|
|
2759
2764
|
}
|
|
2760
2765
|
try {
|
|
2761
|
-
|
|
2766
|
+
let opt = cmd.map.opt || {};
|
|
2762
2767
|
if (opt.hasOwnProperty("style")) { opt.style = new Function('return ' + opt.style)(); }
|
|
2763
2768
|
else {
|
|
2764
2769
|
opt.style = function(feature) {
|
|
@@ -3225,7 +3230,7 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
|
|
|
3225
3230
|
opt.pointToLayer = function (feature, latlng) {
|
|
3226
3231
|
var myMarker;
|
|
3227
3232
|
if (feature.properties.hasOwnProperty("icon")) {
|
|
3228
|
-
var regi = /^[
|
|
3233
|
+
var regi = /^[SGEIO][A-Z]{3}.*/i; // if it looks like a SIDC code
|
|
3229
3234
|
if (regi.test(feature.properties.icon)) {
|
|
3230
3235
|
feature.properties.SIDC = (feature.properties.icon.toUpperCase()+"------------").substr(0,12);
|
|
3231
3236
|
delete feature.properties.icon;
|
|
@@ -3271,7 +3276,7 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
|
|
|
3271
3276
|
});
|
|
3272
3277
|
}
|
|
3273
3278
|
if (!feature.properties.hasOwnProperty("title") && feature.properties.hasOwnProperty("marker-symbol")) {
|
|
3274
|
-
if (
|
|
3279
|
+
if (feature.properties["marker-symbol"].indexOf('fa-') !== 0) {
|
|
3275
3280
|
feature.properties.title = feature.properties["marker-symbol"];
|
|
3276
3281
|
}
|
|
3277
3282
|
}
|
|
@@ -3422,7 +3427,7 @@ function doTAKMCjson(p) {
|
|
|
3422
3427
|
}
|
|
3423
3428
|
|
|
3424
3429
|
function convertCOTtoCIFColour(color) {
|
|
3425
|
-
const c = parseInt(color);
|
|
3430
|
+
// const c = parseInt(color);
|
|
3426
3431
|
const arr = new ArrayBuffer(4);
|
|
3427
3432
|
const view = new DataView(arr);
|
|
3428
3433
|
view.setUint32(0, color, false);
|
package/worldmap.js
CHANGED
|
@@ -201,7 +201,7 @@ module.exports = function(RED) {
|
|
|
201
201
|
if (msg.payload.ttl && msg.payload.ttl < t) { t = msg.payload.ttl; }
|
|
202
202
|
allPoints[msg.payload.name].tout = setTimeout( function() { delete allPoints[msg.payload.name] }, t * 1000 );
|
|
203
203
|
}
|
|
204
|
-
if (msg
|
|
204
|
+
if (msg.payload?.command?.map?.delete) {
|
|
205
205
|
var ddd = msg.payload.command.map.delete;
|
|
206
206
|
if (!Array.isArray(ddd)) { ddd = [cmd.map.delete]; }
|
|
207
207
|
for (let a=0; a < ddd.length; a++) {
|
|
@@ -227,7 +227,8 @@ module.exports = function(RED) {
|
|
|
227
227
|
for (var i=0; i < RED.httpNode._router.stack.length; i++) {
|
|
228
228
|
var r = RED.httpNode._router.stack[i];
|
|
229
229
|
if ((r.name === "serveStatic") && (r.regexp.test(node.path))) {
|
|
230
|
-
RED.httpNode._router.stack.splice(i, 1)
|
|
230
|
+
RED.httpNode._router.stack.splice(i, 1);
|
|
231
|
+
i = i-1;
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
node.status({});
|
|
@@ -479,7 +480,7 @@ module.exports = function(RED) {
|
|
|
479
480
|
node.send(newmsg); // send the track
|
|
480
481
|
}
|
|
481
482
|
}
|
|
482
|
-
if (msg
|
|
483
|
+
if (msg.payload?.command?.map?.delete) {
|
|
483
484
|
var ddd = msg.payload.command.map.delete;
|
|
484
485
|
if (!Array.isArray(ddd)) { ddd = [cmd.map.delete]; }
|
|
485
486
|
for (let a=0; a < ddd.length; a++) {
|
|
@@ -492,8 +493,8 @@ module.exports = function(RED) {
|
|
|
492
493
|
}
|
|
493
494
|
}
|
|
494
495
|
}
|
|
495
|
-
if (msg
|
|
496
|
-
if (!isArray(msg
|
|
496
|
+
if (msg.payload?.command?.clear) {
|
|
497
|
+
if (!isArray(msg.payload?.command?.clear)) {
|
|
497
498
|
msg.payload.command.clear = [ msg.payload.command.clear ]
|
|
498
499
|
}
|
|
499
500
|
msg.payload.command.clear.forEach(function(el) {
|
|
@@ -506,8 +507,8 @@ module.exports = function(RED) {
|
|
|
506
507
|
}
|
|
507
508
|
})
|
|
508
509
|
}
|
|
509
|
-
if (msg
|
|
510
|
-
if (!isArray(msg
|
|
510
|
+
if (msg.payload?.command?.clearlayer) {
|
|
511
|
+
if (!isArray(msg.payload?.command?.clearlayer)) {
|
|
511
512
|
msg.payload.command.clearlayer = [ msg.payload.command.clearlayer ]
|
|
512
513
|
}
|
|
513
514
|
msg.payload.command.clearlayer.forEach(function(el) {
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
dialog {
|
|
2
|
-
position: absolute;
|
|
3
|
-
left: 0; right: 0;
|
|
4
|
-
width: -moz-fit-content;
|
|
5
|
-
width: -webkit-fit-content;
|
|
6
|
-
width: fit-content;
|
|
7
|
-
height: -moz-fit-content;
|
|
8
|
-
height: -webkit-fit-content;
|
|
9
|
-
height: fit-content;
|
|
10
|
-
margin: auto;
|
|
11
|
-
border: solid;
|
|
12
|
-
padding: 1em;
|
|
13
|
-
background: white;
|
|
14
|
-
color: black;
|
|
15
|
-
display: block;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
dialog:not([open]) {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
dialog + .backdrop {
|
|
23
|
-
position: fixed;
|
|
24
|
-
top: 0; right: 0; bottom: 0; left: 0;
|
|
25
|
-
background: rgba(0,0,0,0.1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
._dialog_overlay {
|
|
29
|
-
position: fixed;
|
|
30
|
-
top: 0; right: 0; bottom: 0; left: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
dialog.fixed {
|
|
34
|
-
position: fixed;
|
|
35
|
-
top: 50%;
|
|
36
|
-
transform: translate(0, -50%);
|
|
37
|
-
}
|