Add greatcircle, fix httpRoot, drawing colours

bump packages
This commit is contained in:
Dave Conway-Jones 2021-12-30 12:29:05 +00:00
parent e9a2771bc7
commit 80e944afa8
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
9 changed files with 160 additions and 134 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193
- v2.23.5 - Fix addtoheatmap. Issue #192 - v2.23.5 - Fix addtoheatmap. Issue #192
- v2.23.4 - Fix opacity of area borders - v2.23.4 - Fix opacity of area borders
- v2.23.3 - Fix initial load of maps - v2.23.3 - Fix initial load of maps

View File

@ -11,6 +11,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193
- v2.23.5 - Fix addtoheatmap. Issue #192 - v2.23.5 - Fix addtoheatmap. Issue #192
- v2.23.4 - Fix opacity of area borders - v2.23.4 - Fix opacity of area borders
- v2.23.3 - Fix initial load of maps - v2.23.3 - Fix initial load of maps
@ -118,7 +119,7 @@ SIDC codes can be generated using the online tool - https://spatialillusions.com
There are lots of extra options you can specify as `msg.payload.options` - see the <a href="https://spatialillusions.com/milsymbol/documentation.html" target="mapinfo">milsymbol docs here</a>. There are lots of extra options you can specify as `msg.payload.options` - see the <a href="https://spatialillusions.com/milsymbol/documentation.html" target="mapinfo">milsymbol docs here</a>.
### Areas, Lines and Rectangles ### Areas, Rectangles, Lines, and GreatCircles
If the msg.payload contains an **area** property - that is an array of co-ordinates, e.g. If the msg.payload contains an **area** property - that is an array of co-ordinates, e.g.
@ -130,6 +131,11 @@ elements, then it assumes this is a bounding box for a rectangle and draws a rec
Likewise if it contains a **line** property it will draw the polyline. Likewise if it contains a **line** property it will draw the polyline.
If the payload also includes a property `fit:true` the map will zoom to fit the line or area. If the payload also includes a property `fit:true` the map will zoom to fit the line or area.
Finally if a **greatcircle** property is set containing an array of two coordinates then an arc
following the great circle between the two co-ordinates is plotted.
msg.payload = {name:"GC1", greatcircle:[ [51.464,0], [25.76,-80.18] ] }
There are extra optional properties you can specify - see Options below. There are extra optional properties you can specify - see Options below.

213
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.21.0-beta", "version": "2.24.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -41,27 +41,20 @@
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
}, },
"body-parser": { "body-parser": {
"version": "1.19.0", "version": "1.19.1",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz",
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==",
"requires": { "requires": {
"bytes": "3.1.0", "bytes": "3.1.1",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "~1.1.2",
"http-errors": "1.7.2", "http-errors": "1.8.1",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"on-finished": "~2.3.0", "on-finished": "~2.3.0",
"qs": "6.7.0", "qs": "6.9.6",
"raw-body": "2.4.0", "raw-body": "2.4.2",
"type-is": "~1.6.17" "type-is": "~1.6.18"
},
"dependencies": {
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
}
} }
}, },
"bufferjs": { "bufferjs": {
@ -74,6 +67,11 @@
"resolved": "https://registry.npmjs.org/bufferlist/-/bufferlist-0.1.0.tgz", "resolved": "https://registry.npmjs.org/bufferlist/-/bufferlist-0.1.0.tgz",
"integrity": "sha1-Qr7y2JVztA+hCGuzng9TEBcNHd0=" "integrity": "sha1-Qr7y2JVztA+hCGuzng9TEBcNHd0="
}, },
"bytes": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz",
"integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg=="
},
"cgi": { "cgi": {
"version": "0.3.1", "version": "0.3.1",
"resolved": "https://registry.npmjs.org/cgi/-/cgi-0.3.1.tgz", "resolved": "https://registry.npmjs.org/cgi/-/cgi-0.3.1.tgz",
@ -115,11 +113,18 @@
} }
}, },
"content-disposition": { "content-disposition": {
"version": "0.5.3", "version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"requires": { "requires": {
"safe-buffer": "5.1.2" "safe-buffer": "5.2.1"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
}
} }
}, },
"content-type": { "content-type": {
@ -128,9 +133,9 @@
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
}, },
"cookie": { "cookie": {
"version": "0.4.0", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
}, },
"cookie-signature": { "cookie-signature": {
"version": "1.0.6", "version": "1.0.6",
@ -176,16 +181,16 @@
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
}, },
"express": { "express": {
"version": "4.17.1", "version": "4.17.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==",
"requires": { "requires": {
"accepts": "~1.3.7", "accepts": "~1.3.7",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
"body-parser": "1.19.0", "body-parser": "1.19.1",
"content-disposition": "0.5.3", "content-disposition": "0.5.4",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"cookie": "0.4.0", "cookie": "0.4.1",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "~1.1.2",
@ -199,17 +204,24 @@
"on-finished": "~2.3.0", "on-finished": "~2.3.0",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"path-to-regexp": "0.1.7", "path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.5", "proxy-addr": "~2.0.7",
"qs": "6.7.0", "qs": "6.9.6",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"safe-buffer": "5.1.2", "safe-buffer": "5.2.1",
"send": "0.17.1", "send": "0.17.2",
"serve-static": "1.14.1", "serve-static": "1.14.2",
"setprototypeof": "1.1.1", "setprototypeof": "1.2.0",
"statuses": "~1.5.0", "statuses": "~1.5.0",
"type-is": "~1.6.18", "type-is": "~1.6.18",
"utils-merge": "1.0.1", "utils-merge": "1.0.1",
"vary": "~1.1.2" "vary": "~1.1.2"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
}
} }
}, },
"extend": { "extend": {
@ -218,9 +230,9 @@
"integrity": "sha512-AgFD4VU+lVLP6vjnlNfF7OeInLTyeyckCNPEsuxz1vi786UuK/nk6ynPuhn/h+Ju9++TQyr5EpLRI14fc1QtTQ==" "integrity": "sha512-AgFD4VU+lVLP6vjnlNfF7OeInLTyeyckCNPEsuxz1vi786UuK/nk6ynPuhn/h+Ju9++TQyr5EpLRI14fc1QtTQ=="
}, },
"faye-websocket": { "faye-websocket": {
"version": "0.11.3", "version": "0.11.4",
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
"integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
"requires": { "requires": {
"websocket-driver": ">=0.5.1" "websocket-driver": ">=0.5.1"
} }
@ -240,9 +252,9 @@
} }
}, },
"forwarded": { "forwarded": {
"version": "0.1.2", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
}, },
"fresh": { "fresh": {
"version": "0.5.2", "version": "0.5.2",
@ -260,17 +272,22 @@
} }
}, },
"http-errors": { "http-errors": {
"version": "1.7.2", "version": "1.8.1",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
"requires": { "requires": {
"depd": "~1.1.2", "depd": "~1.1.2",
"inherits": "2.0.3", "inherits": "2.0.4",
"setprototypeof": "1.1.1", "setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2", "statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0" "toidentifier": "1.0.1"
} }
}, },
"http-parser-js": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.5.tgz",
"integrity": "sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA=="
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -280,14 +297,14 @@
} }
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"ipaddr.js": { "ipaddr.js": {
"version": "1.9.0", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
}, },
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
@ -356,18 +373,18 @@
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
}, },
"proxy-addr": { "proxy-addr": {
"version": "2.0.5", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"requires": { "requires": {
"forwarded": "~0.1.2", "forwarded": "0.2.0",
"ipaddr.js": "1.9.0" "ipaddr.js": "1.9.1"
} }
}, },
"qs": { "qs": {
"version": "6.7.0", "version": "6.9.6",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ=="
}, },
"range-parser": { "range-parser": {
"version": "1.2.1", "version": "1.2.1",
@ -375,21 +392,14 @@
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
}, },
"raw-body": { "raw-body": {
"version": "2.4.0", "version": "2.4.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz",
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==",
"requires": { "requires": {
"bytes": "3.1.0", "bytes": "3.1.1",
"http-errors": "1.7.2", "http-errors": "1.8.1",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"unpipe": "1.0.0" "unpipe": "1.0.0"
},
"dependencies": {
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
}
} }
}, },
"safe-buffer": { "safe-buffer": {
@ -403,9 +413,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"send": { "send": {
"version": "0.17.1", "version": "0.17.2",
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz",
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==",
"requires": { "requires": {
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "~1.1.2",
@ -414,44 +424,44 @@
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "~1.7.2", "http-errors": "1.8.1",
"mime": "1.6.0", "mime": "1.6.0",
"ms": "2.1.1", "ms": "2.1.3",
"on-finished": "~2.3.0", "on-finished": "~2.3.0",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"statuses": "~1.5.0" "statuses": "~1.5.0"
}, },
"dependencies": { "dependencies": {
"ms": { "ms": {
"version": "2.1.1", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
} }
} }
}, },
"serve-static": { "serve-static": {
"version": "1.14.1", "version": "1.14.2",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==",
"requires": { "requires": {
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"send": "0.17.1" "send": "0.17.2"
} }
}, },
"setprototypeof": { "setprototypeof": {
"version": "1.1.1", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
}, },
"sockjs": { "sockjs": {
"version": "0.3.21", "version": "0.3.24",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
"integrity": "sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw==", "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==",
"requires": { "requires": {
"faye-websocket": "^0.11.3", "faye-websocket": "^0.11.3",
"uuid": "^3.4.0", "uuid": "^8.3.2",
"websocket-driver": "^0.7.4" "websocket-driver": "^0.7.4"
} }
}, },
@ -466,9 +476,9 @@
"integrity": "sha1-cIRgQrqwGFAI5Qnt/h93+TYcumk=" "integrity": "sha1-cIRgQrqwGFAI5Qnt/h93+TYcumk="
}, },
"toidentifier": { "toidentifier": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
}, },
"type-is": { "type-is": {
"version": "1.6.18", "version": "1.6.18",
@ -490,9 +500,9 @@
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
}, },
"uuid": { "uuid": {
"version": "3.4.0", "version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}, },
"vary": { "vary": {
"version": "1.1.2", "version": "1.1.2",
@ -507,13 +517,6 @@
"http-parser-js": ">=0.5.1", "http-parser-js": ">=0.5.1",
"safe-buffer": ">=5.1.0", "safe-buffer": ">=5.1.0",
"websocket-extensions": ">=0.1.1" "websocket-extensions": ">=0.1.1"
},
"dependencies": {
"http-parser-js": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.2.tgz",
"integrity": "sha512-opCO9ASqg5Wy2FNo7A0sxy71yGbbkJJXLdgMK04Tcypw9jr2MgWbyubb0+WdmDmGnFflO7fRbqbaihh/ENDlRQ=="
}
} }
}, },
"websocket-extensions": { "websocket-extensions": {

View File

@ -1,13 +1,13 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.23.5", "version": "2.24.0",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"@turf/bezier-spline": "~6.5.0", "@turf/bezier-spline": "~6.5.0",
"cgi": "0.3.1", "cgi": "0.3.1",
"compression": "^1.7.4", "compression": "^1.7.4",
"express": "^4.16.4", "express": "^4.17.2",
"sockjs": "~0.3.21" "sockjs": "~0.3.24"
}, },
"bundledDependencies": [ "bundledDependencies": [
"cgi", "cgi",

View File

@ -438,7 +438,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
} }
}); });
$.get('/-ui-worldmap', function (data) { $.get('-ui-worldmap', function (data) {
if (data === "true") { if (data === "true") {
RED.nodes.registerType('ui_worldmap',{ RED.nodes.registerType('ui_worldmap',{
category: 'dashboard', category: 'dashboard',

View File

@ -153,7 +153,7 @@ module.exports = function(RED) {
var size = ui.getSizes(); var size = ui.getSizes();
var frameWidth = (size.sx + size.cx) * width - size.cx; var frameWidth = (size.sx + size.cx) * width - size.cx;
var frameHeight = (size.sy + size.cy) * height - size.cy; var frameHeight = (size.sy + size.cy) * height - size.cy;
var url = encodeURI(config.path); var url = encodeURI(path.posix.join(RED.settings.httpNodeRoot||RED.settings.httpRoot,config.path));
var html = `<style>.nr-dashboard-ui_worldmap{padding:0;}</style><div style="overflow:hidden;"> var html = `<style>.nr-dashboard-ui_worldmap{padding:0;}</style><div style="overflow:hidden;">
<iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe></div>`; <iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe></div>`;
return html; return html;
@ -525,7 +525,7 @@ module.exports = function(RED) {
} }
RED.nodes.registerType("worldmap-hull",WorldMapHull); RED.nodes.registerType("worldmap-hull",WorldMapHull);
RED.httpNode.get("/-ui-worldmap", function(req, res) { RED.httpAdmin.get("/-ui-worldmap", RED.auth.needsPermission('rpi-ui-worldmap.read'), function(req, res) {
res.send(ui ? "true": "false"); res.send(ui ? "true": "false");
}); });
} }

View File

@ -72,6 +72,7 @@
<script src="leaflet/leaflet.latlng-graticule.js"></script> <script src="leaflet/leaflet.latlng-graticule.js"></script>
<script src="leaflet/VectorTileLayer.umd.min.js"></script> <script src="leaflet/VectorTileLayer.umd.min.js"></script>
<script src="leaflet/Semicircle.js"></script> <script src="leaflet/Semicircle.js"></script>
<script src='leaflet/leaflet-arc.min.js'></script>
<script src="leaflet/L.TileLayer.PixelFilter.js"></script> <script src="leaflet/L.TileLayer.PixelFilter.js"></script>
<script src="leaflet/dialog-polyfill.js"></script> <script src="leaflet/dialog-polyfill.js"></script>

1
worldmap/leaflet/leaflet-arc.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -30,8 +30,9 @@ var sidebyside;
var layercontrol; var layercontrol;
var drawControl; var drawControl;
var drawingColour = "#910000"; var drawingColour = "#910000";
var sendRoute;
var sendDrawing; var sendDrawing;
var colorControl;
var sendRoute;
var iconSz = { var iconSz = {
"Team/Crew": 24, "Team/Crew": 24,
@ -132,7 +133,7 @@ var handleData = function(data) {
window.onunload = function() { if (ws) ws.close(); } window.onunload = function() { if (ws) ws.close(); }
var onoffline = function() { if (!navigator.onLine) map.addLayer(layers["_countries"]); } var onoffline = function() { if (!navigator.onLine) { map.addLayer(layers["_countries"]); } }
document.addEventListener ("keydown", function (ev) { document.addEventListener ("keydown", function (ev) {
// Set Ctl-Alt-3 to switch to 3d view // Set Ctl-Alt-3 to switch to 3d view
@ -253,16 +254,6 @@ var menuButton = L.easyButton({states:[{icon:'fa-bars fa-lg', onClick:function()
var fullscreenButton = L.control.fullscreen(); var fullscreenButton = L.control.fullscreen();
var rulerButton = L.control.ruler({position:"topleft"}); var rulerButton = L.control.ruler({position:"topleft"});
//var colorPickButton = L.easyButton({states:[{icon:'fa-tint fa-lg', onClick:function() { console.log("PICK"); }, title:'Pick Colour'}]});
var redButton = L.easyButton('fa-square wm-red', function(btn) { changeDrawColour("#E7827F"); })
var blueButton = L.easyButton('fa-square wm-blue', function(btn) { changeDrawColour("#94CCE2"); })
var greenButton = L.easyButton('fa-square wm-green', function(btn) { changeDrawColour("#ACD6A4"); })
var yellowButton = L.easyButton('fa-square wm-yellow', function(btn) { changeDrawColour("#F5F08B"); })
var blackButton = L.easyButton('fa-square wm-black', function(btn) { changeDrawColour("#444444"); })
var whiteButton = L.easyButton('fa-square wm-white', function(btn) { changeDrawColour("#EEEEEE"); })
var colorControl = L.easyBar([redButton,blueButton,greenButton,yellowButton,blackButton,whiteButton]);
function onLocationFound(e) { function onLocationFound(e) {
var radius = e.accuracy; var radius = e.accuracy;
//L.marker(e.latlng).addTo(map).bindPopup("You are within " + radius + " meters from this point").openPopup(); //L.marker(e.latlng).addTo(map).bindPopup("You are within " + radius + " meters from this point").openPopup();
@ -658,7 +649,7 @@ map.on('moveend', function() {
// single right click to add a marker // single right click to add a marker
var addmenu = "<b>Add marker</b><br><input type='text' id='rinput' autofocus onkeydown='if (event.keyCode == 13) addThing();' placeholder='name (,icon/SIDC, layer, colour, heading)'/>"; var addmenu = "<b>Add marker</b><br><input type='text' id='rinput' autofocus onkeydown='if (event.keyCode == 13) addThing();' placeholder='name (,icon/SIDC, layer, colour, heading)'/>";
if (navigator.onLine) { addmenu += '<br/><a href="https://spatialillusions.com/unitgenerator/" target="_new">MilSymbol SIDC generator</a>'; } if (navigator.onLine) { addmenu += '<br/><a href="https://spatialillusions.com/unitgenerator/" target="_new">MilSymbol SIDC generator</a>'; }
var rightmenuMap = L.popup({keepInView:true, minWidth:250}).setContent(addmenu); var rightmenuMap = L.popup({keepInView:true, minWidth:260}).setContent(addmenu);
var rclk = {}; var rclk = {};
var hiderightclick = false; var hiderightclick = false;
@ -746,7 +737,8 @@ var addBaseMaps = function(maplist,first) {
var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite", var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite",
EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic", EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic",
UKOS:"UK OS OpenData", UKOS45:"UK OS 1919-1947", UKOS00:"UK OS 1900", OpTop:"Open Topo Map", UKOS:"UK OS OpenData", UKOS45:"UK OS 1919-1947", UKOS00:"UK OS 1900", OpTop:"Open Topo Map",
HB:"Hike Bike OSM", ST:"Stamen Topography", SW: "Stamen Watercolor", AN:"AutoNavi (Chinese)" } HB:"Hike Bike OSM", ST:"Stamen Topography", SW: "Stamen Watercolor", AN:"AutoNavi (Chinese)"
}
// Use this for OSM online maps // Use this for OSM online maps
var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
@ -929,6 +921,15 @@ var addOverlays = function(overlist) {
// Add the drawing layer... // Add the drawing layer...
if (overlist.indexOf("DR")!==-1) { if (overlist.indexOf("DR")!==-1) {
//var colorPickButton = L.easyButton({states:[{icon:'fa-tint fa-lg', onClick:function() { console.log("PICK"); }, title:'Pick Colour'}]});
var redButton = L.easyButton('fa-square wm-red', function(btn) { changeDrawColour("#E7827F"); })
var blueButton = L.easyButton('fa-square wm-blue', function(btn) { changeDrawColour("#94CCE2"); })
var greenButton = L.easyButton('fa-square wm-green', function(btn) { changeDrawColour("#ACD6A4"); })
var yellowButton = L.easyButton('fa-square wm-yellow', function(btn) { changeDrawColour("#F5F08B"); })
var blackButton = L.easyButton('fa-square wm-black', function(btn) { changeDrawColour("#444444"); })
var whiteButton = L.easyButton('fa-square wm-white', function(btn) { changeDrawColour("#EEEEEE"); })
colorControl = L.easyBar([redButton,blueButton,greenButton,yellowButton,blackButton,whiteButton]);
layers["_drawing"] = new L.FeatureGroup(); layers["_drawing"] = new L.FeatureGroup();
overlays["drawing"] = layers["_drawing"]; overlays["drawing"] = layers["_drawing"];
map.options.drawControlTooltips = false; map.options.drawControlTooltips = false;
@ -951,11 +952,13 @@ var addOverlays = function(overlist) {
// } // }
}); });
var changeDrawColour = function(col) { var changeDrawColour = function(col) {
drawingColour = col;
console.log("COL",col)
drawControl.setDrawingOptions({ drawControl.setDrawingOptions({
polyline: { shapeOptions: { color:col } }, polyline: { shapeOptions: { color:drawingColour } },
circle: { shapeOptions: { color:col } }, circle: { shapeOptions: { color:drawingColour } },
rectangle: { shapeOptions: { color:col } }, rectangle: { shapeOptions: { color:drawingColour } },
polygon: { shapeOptions: { color:col } } polygon: { shapeOptions: { color:drawingColour } }
}); });
} }
var shape; var shape;
@ -1188,7 +1191,7 @@ var addOverlays = function(overlist) {
// Layer control based on select box rather than radio buttons. // Layer control based on select box rather than radio buttons.
//var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map); //var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map);
var layercontrol = L.control.layers(basemaps, overlays); layercontrol = L.control.layers(basemaps, overlays);
// Add the layers control widget // Add the layers control widget
if (!inIframe) { layercontrol.addTo(map); } if (!inIframe) { layercontrol.addTo(map); }
@ -1441,6 +1444,17 @@ function setMarker(data) {
map.fitBounds(polygons[data.name].getBounds(),{padding:[50,50]}) map.fitBounds(polygons[data.name].getBounds(),{padding:[50,50]})
} }
} }
if (data.hasOwnProperty("greatcircle") && Array.isArray(data.greatcircle) && data.greatcircle.length === 2) {
delete opt.fill;
opt.vertices = 500;
if (!data.hasOwnProperty("weight")) { opt.weight = 3; } //Standard settings different for lines
if (!data.hasOwnProperty("opacity")) { opt.opacity = 0.8; }
var greatc = L.Polyline.Arc(data.greatcircle[0], data.greatcircle[1], opt);
polygons[data.name] = rightmenu(greatc);
if (data.hasOwnProperty("fit") && data.fit === true) {
map.fitBounds(polygons[data.name].getBounds(),{padding:[50,50]})
}
}
else if (data.hasOwnProperty("sdlat") && data.hasOwnProperty("sdlon")) { else if (data.hasOwnProperty("sdlat") && data.hasOwnProperty("sdlon")) {
if (!data.hasOwnProperty("iconColor")) { opt.color = "blue"; } //different standard Color Settings if (!data.hasOwnProperty("iconColor")) { opt.color = "blue"; } //different standard Color Settings
if (!data.hasOwnProperty("fillColor")) { opt.fillColor = "blue"; } if (!data.hasOwnProperty("fillColor")) { opt.fillColor = "blue"; }