node-red-contrib-web-worldmap 2.24.0 → 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 +5 -1
- package/README.md +7 -2
- package/node_modules/{bytes → body-parser/node_modules/bytes}/History.md +0 -0
- package/node_modules/{bytes → body-parser/node_modules/bytes}/LICENSE +0 -0
- package/node_modules/{bytes → body-parser/node_modules/bytes}/Readme.md +0 -0
- package/node_modules/{bytes → body-parser/node_modules/bytes}/index.js +0 -0
- package/node_modules/{bytes → body-parser/node_modules/bytes}/package.json +2 -3
- package/node_modules/body-parser/package.json +2 -2
- package/node_modules/content-disposition/node_modules/safe-buffer/package.json +2 -2
- package/node_modules/content-disposition/package.json +2 -2
- package/node_modules/cookie/package.json +2 -2
- package/node_modules/express/node_modules/safe-buffer/package.json +2 -2
- package/node_modules/express/package.json +8 -9
- package/node_modules/faye-websocket/package.json +2 -2
- package/node_modules/forwarded/package.json +2 -2
- package/node_modules/http-errors/package.json +4 -4
- package/node_modules/inherits/package.json +2 -2
- package/node_modules/ipaddr.js/package.json +2 -2
- package/node_modules/proxy-addr/package.json +2 -2
- package/node_modules/qs/package.json +3 -3
- package/node_modules/raw-body/node_modules/bytes/History.md +92 -0
- package/node_modules/raw-body/node_modules/bytes/LICENSE +23 -0
- package/node_modules/raw-body/node_modules/bytes/Readme.md +152 -0
- package/node_modules/raw-body/node_modules/bytes/index.js +166 -0
- package/node_modules/raw-body/node_modules/bytes/package.json +84 -0
- package/node_modules/raw-body/package.json +2 -2
- package/node_modules/send/node_modules/ms/package.json +2 -2
- package/node_modules/send/package.json +3 -3
- package/node_modules/serve-static/package.json +2 -2
- package/node_modules/setprototypeof/package.json +3 -3
- package/node_modules/sockjs/package.json +8 -9
- package/node_modules/toidentifier/package.json +2 -2
- package/node_modules/uuid/package.json +2 -2
- package/node_modules/websocket-driver/node_modules/http-parser-js/CHANGELOG.md +14 -0
- package/node_modules/{http-parser-js → websocket-driver/node_modules/http-parser-js}/LICENSE.md +0 -0
- package/node_modules/websocket-driver/node_modules/http-parser-js/README.md +31 -0
- package/node_modules/{http-parser-js → websocket-driver/node_modules/http-parser-js}/http-parser.js +5 -8
- package/node_modules/{http-parser-js → websocket-driver/node_modules/http-parser-js}/package.json +20 -18
- package/package.json +1 -1
- package/worldmap/css/worldmap.css +7 -5
- package/worldmap/worldmap.js +21 -13
- package/node_modules/http-parser-js/README.md +0 -39
- package/node_modules/http-parser-js/http-parser.d.ts +0 -175
package/worldmap/worldmap.js
CHANGED
|
@@ -565,8 +565,8 @@ map.on('overlayadd', function(e) {
|
|
|
565
565
|
}
|
|
566
566
|
if (e.name == "drawing") {
|
|
567
567
|
overlays["drawing"].bringToFront();
|
|
568
|
-
map.addControl(drawControl);
|
|
569
568
|
map.addControl(colorControl);
|
|
569
|
+
map.addControl(drawControl);
|
|
570
570
|
}
|
|
571
571
|
ws.send(JSON.stringify({action:"addlayer", name:e.name}));
|
|
572
572
|
});
|
|
@@ -579,8 +579,8 @@ map.on('overlayremove', function(e) {
|
|
|
579
579
|
layers["_daynight"].clearLayers();
|
|
580
580
|
}
|
|
581
581
|
if (e.name == "drawing") {
|
|
582
|
-
map.removeControl(colorControl);
|
|
583
582
|
map.removeControl(drawControl);
|
|
583
|
+
map.removeControl(colorControl);
|
|
584
584
|
}
|
|
585
585
|
ws.send(JSON.stringify({action:"dellayer", name:e.name}));
|
|
586
586
|
});
|
|
@@ -922,13 +922,15 @@ var addOverlays = function(overlist) {
|
|
|
922
922
|
// Add the drawing layer...
|
|
923
923
|
if (overlist.indexOf("DR")!==-1) {
|
|
924
924
|
//var colorPickButton = L.easyButton({states:[{icon:'fa-tint fa-lg', onClick:function() { console.log("PICK"); }, title:'Pick Colour'}]});
|
|
925
|
-
var redButton = L.easyButton('fa-square wm-red', function(btn) { changeDrawColour("#
|
|
926
|
-
var blueButton = L.easyButton('fa-square wm-blue', function(btn) { changeDrawColour("#
|
|
927
|
-
var greenButton = L.easyButton('fa-square wm-green', function(btn) { changeDrawColour("#
|
|
928
|
-
var yellowButton = L.easyButton('fa-square wm-yellow', function(btn) { changeDrawColour("#
|
|
929
|
-
var
|
|
925
|
+
var redButton = L.easyButton('fa-square wm-red', function(btn) { changeDrawColour("#FF4040"); })
|
|
926
|
+
var blueButton = L.easyButton('fa-square wm-blue', function(btn) { changeDrawColour("#4040F0"); })
|
|
927
|
+
var greenButton = L.easyButton('fa-square wm-green', function(btn) { changeDrawColour("#40D040"); })
|
|
928
|
+
var yellowButton = L.easyButton('fa-square wm-yellow', function(btn) { changeDrawColour("#FFFF40"); })
|
|
929
|
+
var cyanButton = L.easyButton('fa-square wm-cyan', function(btn) { changeDrawColour("#40F0F0"); })
|
|
930
|
+
var magentaButton = L.easyButton('fa-square wm-magenta', function(btn) { changeDrawColour("#F040F0"); })
|
|
931
|
+
var blackButton = L.easyButton('fa-square wm-black', function(btn) { changeDrawColour("#000000"); })
|
|
930
932
|
var whiteButton = L.easyButton('fa-square wm-white', function(btn) { changeDrawColour("#EEEEEE"); })
|
|
931
|
-
colorControl = L.easyBar([redButton,blueButton,greenButton,yellowButton,blackButton,whiteButton]);
|
|
933
|
+
colorControl = L.easyBar([redButton,blueButton,greenButton,yellowButton,cyanButton,magentaButton,blackButton,whiteButton]);
|
|
932
934
|
|
|
933
935
|
layers["_drawing"] = new L.FeatureGroup();
|
|
934
936
|
overlays["drawing"] = layers["_drawing"];
|
|
@@ -953,7 +955,7 @@ var addOverlays = function(overlist) {
|
|
|
953
955
|
});
|
|
954
956
|
var changeDrawColour = function(col) {
|
|
955
957
|
drawingColour = col;
|
|
956
|
-
console.log("
|
|
958
|
+
console.log("COLOR",col)
|
|
957
959
|
drawControl.setDrawingOptions({
|
|
958
960
|
polyline: { shapeOptions: { color:drawingColour } },
|
|
959
961
|
circle: { shapeOptions: { color:drawingColour } },
|
|
@@ -1446,7 +1448,7 @@ function setMarker(data) {
|
|
|
1446
1448
|
}
|
|
1447
1449
|
if (data.hasOwnProperty("greatcircle") && Array.isArray(data.greatcircle) && data.greatcircle.length === 2) {
|
|
1448
1450
|
delete opt.fill;
|
|
1449
|
-
opt.vertices =
|
|
1451
|
+
opt.vertices = opt.vertices || 100;
|
|
1450
1452
|
if (!data.hasOwnProperty("weight")) { opt.weight = 3; } //Standard settings different for lines
|
|
1451
1453
|
if (!data.hasOwnProperty("opacity")) { opt.opacity = 0.8; }
|
|
1452
1454
|
var greatc = L.Polyline.Arc(data.greatcircle[0], data.greatcircle[1], opt);
|
|
@@ -1465,7 +1467,8 @@ function setMarker(data) {
|
|
|
1465
1467
|
if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon")) {
|
|
1466
1468
|
var polycirc;
|
|
1467
1469
|
if (Array.isArray(data.radius)) {
|
|
1468
|
-
polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0]*Math.cos(data.lat*Math.PI/180), data.radius[1]], data.tilt || 0, opt);
|
|
1470
|
+
//polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0]*Math.cos(data.lat*Math.PI/180), data.radius[1]], data.tilt || 0, opt);
|
|
1471
|
+
polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0], data.radius[1]], data.tilt || 0, opt);
|
|
1469
1472
|
}
|
|
1470
1473
|
else {
|
|
1471
1474
|
polycirc = L.circle(new L.LatLng((data.lat*1), (data.lon*1)), data.radius*1, opt);
|
|
@@ -2084,7 +2087,7 @@ function setMarker(data) {
|
|
|
2084
2087
|
function doCommand(cmd) {
|
|
2085
2088
|
// console.log("COMMAND",cmd);
|
|
2086
2089
|
if (cmd.init && cmd.hasOwnProperty("maplist")) {
|
|
2087
|
-
basemaps =
|
|
2090
|
+
//basemaps = {};
|
|
2088
2091
|
addBaseMaps(cmd.maplist,cmd.layer);
|
|
2089
2092
|
}
|
|
2090
2093
|
if (cmd.init && cmd.hasOwnProperty("overlist")) {
|
|
@@ -2619,6 +2622,11 @@ function doCommand(cmd) {
|
|
|
2619
2622
|
map.touchZoom.enable();
|
|
2620
2623
|
}
|
|
2621
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
|
+
}
|
|
2622
2630
|
}
|
|
2623
2631
|
|
|
2624
2632
|
// handle any incoming GEOJSON directly - may style badly
|
|
@@ -2649,7 +2657,7 @@ function doGeojson(n,g,l,o) {
|
|
|
2649
2657
|
st.fillColor = feature.style["fill-color"] || feature.style["fill"] || st.fillColor;
|
|
2650
2658
|
st.fillOpacity = feature.style["fill-opacity"] || st.fillOpacity;
|
|
2651
2659
|
}
|
|
2652
|
-
if (feature.hasOwnProperty("geometry") && feature.geometry.hasOwnProperty("type") && feature.geometry.type === "LineString") {
|
|
2660
|
+
if (feature.hasOwnProperty("geometry") && feature.geometry.hasOwnProperty("type") && (feature.geometry.type === "LineString" || feature.geometry.type === "MultiLineString") ) {
|
|
2653
2661
|
st.fill = false;
|
|
2654
2662
|
}
|
|
2655
2663
|
return st;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
# HTTP Parser
|
|
5
|
-
|
|
6
|
-
This library parses HTTP protocol for requests and responses.
|
|
7
|
-
It was created to replace `http_parser.c` since calling C++ functions from JS is really slow in V8.
|
|
8
|
-
However, it is now primarily useful in having a more flexible/tolerant HTTP parser when dealing with legacy services that do not meet the strict HTTP parsing rules Node's parser follows.
|
|
9
|
-
|
|
10
|
-
This is packaged as a standalone npm module.
|
|
11
|
-
To use in node, monkeypatch HTTPParser.
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
// Monkey patch before you require http for the first time.
|
|
15
|
-
process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;
|
|
16
|
-
|
|
17
|
-
var http = require('http');
|
|
18
|
-
// ...
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Testing
|
|
22
|
-
|
|
23
|
-
Simply run `npm test`.
|
|
24
|
-
The tests are copied from node and mscedex/io.js, with some modifcations.
|
|
25
|
-
|
|
26
|
-
## Status
|
|
27
|
-
|
|
28
|
-
This should now be usable in any node application, it now supports (nearly) everything `http_parser.c` does while still being tolerant with corrupted headers, and other kinds of malformed data.
|
|
29
|
-
|
|
30
|
-
### Node versions
|
|
31
|
-
|
|
32
|
-
`http-parser-js` should work via monkey-patching on Node v6-v11, and v13-14.
|
|
33
|
-
|
|
34
|
-
Node v12.x renamed the internal http parser, and did not expose it for monkey-patching, so to be able to monkey-patch on Node v12, you must run `node --http-parser=legacy file.js` to opt in to the old, monkey-patchable http_parser binding.
|
|
35
|
-
|
|
36
|
-
## License
|
|
37
|
-
|
|
38
|
-
MIT.
|
|
39
|
-
See [LICENSE.md](LICENSE.md)
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
type ParserType =
|
|
2
|
-
| 'REQUEST'
|
|
3
|
-
| 'RESPONSE'
|
|
4
|
-
|
|
5
|
-
type RequestMethod =
|
|
6
|
-
| 'DELETE'
|
|
7
|
-
| 'GET'
|
|
8
|
-
| 'HEAD'
|
|
9
|
-
| 'POST'
|
|
10
|
-
| 'PUT'
|
|
11
|
-
| 'CONNECT'
|
|
12
|
-
| 'OPTIONS'
|
|
13
|
-
| 'TRACE'
|
|
14
|
-
| 'COPY'
|
|
15
|
-
| 'LOCK'
|
|
16
|
-
| 'MKCOL'
|
|
17
|
-
| 'MOVE'
|
|
18
|
-
| 'PROPFIND'
|
|
19
|
-
| 'PROPPATCH'
|
|
20
|
-
| 'SEARCH'
|
|
21
|
-
| 'UNLOCK'
|
|
22
|
-
| 'BIND'
|
|
23
|
-
| 'REBIND'
|
|
24
|
-
| 'UNBIND'
|
|
25
|
-
| 'ACL'
|
|
26
|
-
| 'REPORT'
|
|
27
|
-
| 'MKACTIVITY'
|
|
28
|
-
| 'CHECKOUT'
|
|
29
|
-
| 'MERGE'
|
|
30
|
-
| 'M-SEARCH'
|
|
31
|
-
| 'NOTIFY'
|
|
32
|
-
| 'SUBSCRIBE'
|
|
33
|
-
| 'UNSUBSCRIBE'
|
|
34
|
-
| 'PATCH'
|
|
35
|
-
| 'PURGE'
|
|
36
|
-
| 'MKCALENDAR'
|
|
37
|
-
| 'LINK'
|
|
38
|
-
| 'UNLINK'
|
|
39
|
-
| string
|
|
40
|
-
|
|
41
|
-
type StateHeaderKey =
|
|
42
|
-
| 'REQUEST_LINE'
|
|
43
|
-
| 'RESPONSE_LINE'
|
|
44
|
-
| 'HEADER'
|
|
45
|
-
|
|
46
|
-
type StateFinishAllowedKey =
|
|
47
|
-
| 'REQUEST_LINE'
|
|
48
|
-
| 'RESPONSE_LINE'
|
|
49
|
-
| 'BODY_RAW'
|
|
50
|
-
|
|
51
|
-
type HeaderObject = Record<string, string>
|
|
52
|
-
type noop<T = void> = ()=> T
|
|
53
|
-
|
|
54
|
-
type HeaderInfo<HEADER = HeaderObject> = {
|
|
55
|
-
versionMajor: number
|
|
56
|
-
versionMinor: number
|
|
57
|
-
headers: HEADER
|
|
58
|
-
method: RequestMethod
|
|
59
|
-
url: string
|
|
60
|
-
statusCode: number
|
|
61
|
-
statusMessage: string
|
|
62
|
-
upgrade: boolean
|
|
63
|
-
shouldKeepAlive: boolean
|
|
64
|
-
}
|
|
65
|
-
export type OnHeadersCompleteParser<HEADER = HeaderObject, Mode_0_12 extends boolean = true> = Mode_0_12 extends true
|
|
66
|
-
? (info: HeaderInfo<HEADER>)=> number
|
|
67
|
-
: (
|
|
68
|
-
versionMajor: number,
|
|
69
|
-
versionMinor: number,
|
|
70
|
-
headers: HEADER,
|
|
71
|
-
method: RequestMethod,
|
|
72
|
-
url: string,
|
|
73
|
-
statusCode: number,
|
|
74
|
-
statusMessage: string,
|
|
75
|
-
upgrade: boolean,
|
|
76
|
-
shouldKeepAlive: boolean,
|
|
77
|
-
)=> number
|
|
78
|
-
export type OnBodyParser = (chunk: Buffer, offset: number, length: number)=> void
|
|
79
|
-
// Only called in the slow case where slow means
|
|
80
|
-
// that the request headers were either fragmented
|
|
81
|
-
// across multiple TCP packets or too large to be
|
|
82
|
-
// processed in a single run. This method is also
|
|
83
|
-
// called to process trailing HTTP headers.
|
|
84
|
-
export type OnHeadersParser = (headers: string[], url: string)=> void
|
|
85
|
-
|
|
86
|
-
declare class HTTPParserJS {
|
|
87
|
-
initialize(type: ParserType, async_resource?: unknown): void
|
|
88
|
-
|
|
89
|
-
// Some handler stubs, needed for compatibility
|
|
90
|
-
[HTTPParser.kOnHeaders]: OnHeadersParser
|
|
91
|
-
[HTTPParser.kOnHeadersComplete]: OnHeadersCompleteParser
|
|
92
|
-
[HTTPParser.kOnBody]: OnBodyParser
|
|
93
|
-
[HTTPParser.kOnMessageComplete]: noop
|
|
94
|
-
|
|
95
|
-
reinitialize: HTTPParserConstructor
|
|
96
|
-
close: noop
|
|
97
|
-
pause: noop
|
|
98
|
-
resume: noop
|
|
99
|
-
free: noop
|
|
100
|
-
private _compatMode0_11: false | boolean
|
|
101
|
-
getAsyncId: noop<0>
|
|
102
|
-
|
|
103
|
-
execute(chunk: Buffer, start?: number, length?: number): number | Error
|
|
104
|
-
finish(): void | Error
|
|
105
|
-
|
|
106
|
-
// These three methods are used for an internal speed optimization, and it also
|
|
107
|
-
// works if theses are noops. Basically consume() asks us to read the bytes
|
|
108
|
-
// ourselves, but if we don't do it we get them through execute().
|
|
109
|
-
consume: noop
|
|
110
|
-
unconsume: noop
|
|
111
|
-
getCurrentBuffer: noop
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* For correct error handling - see HTTPParser#execute
|
|
115
|
-
* @example this.userCall()(userFunction('arg'));
|
|
116
|
-
*/
|
|
117
|
-
userCall<T = unknown>(): (ret?: T)=> T
|
|
118
|
-
private nextRequest: noop
|
|
119
|
-
private consumeLine: noop<string|void>
|
|
120
|
-
parseHeader(line: string, headers: string[]): void
|
|
121
|
-
private REQUEST_LINE: noop
|
|
122
|
-
private RESPONSE_LINE: noop
|
|
123
|
-
shouldKeepAlive(): boolean
|
|
124
|
-
/**
|
|
125
|
-
* For older versions of node (v6.x and older?), that return `skipBody=1` or `skipBody=true`, need this `return true;` if it's an upgrade request.
|
|
126
|
-
*/
|
|
127
|
-
private HEADER(): void | boolean
|
|
128
|
-
private BODY_CHUNKHEAD(): void
|
|
129
|
-
private BODY_CHUNK(): void
|
|
130
|
-
private BODY_CHUNKEMPTYLINE(): void
|
|
131
|
-
private BODY_CHUNKTRAILERS(): void
|
|
132
|
-
private BODY_RAW(): void
|
|
133
|
-
private BODY_SIZED(): void
|
|
134
|
-
|
|
135
|
-
get onHeaders(): OnHeadersParser
|
|
136
|
-
set onHeaders(to: OnHeadersParser)
|
|
137
|
-
|
|
138
|
-
get onHeadersComplete(): OnHeadersCompleteParser
|
|
139
|
-
set onHeadersComplete(to: OnHeadersCompleteParser)
|
|
140
|
-
|
|
141
|
-
get onBody(): OnBodyParser
|
|
142
|
-
set onBody(to: OnBodyParser)
|
|
143
|
-
|
|
144
|
-
get onMessageComplete(): noop
|
|
145
|
-
set onMessageComplete(to: noop)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
interface HTTPParserConstructor extends Function {
|
|
149
|
-
new(type?: ParserType): HTTPParserJS
|
|
150
|
-
(type?: ParserType): void
|
|
151
|
-
|
|
152
|
-
readonly prototype: HTTPParserJS
|
|
153
|
-
|
|
154
|
-
readonly REQUEST: 'REQUEST'
|
|
155
|
-
readonly RESPONSE: 'RESPONSE'
|
|
156
|
-
readonly methods: RequestMethod[]
|
|
157
|
-
|
|
158
|
-
encoding: 'ascii'|string
|
|
159
|
-
/**
|
|
160
|
-
* maxHeaderSize (in bytes) is configurable, but 80kb by default;
|
|
161
|
-
* @default 80 * 1024 = 80kb
|
|
162
|
-
*/
|
|
163
|
-
maxHeaderSize: 81920|number
|
|
164
|
-
|
|
165
|
-
// Note: *not* starting with kOnHeaders=0 line the Node parser, because any
|
|
166
|
-
// newly added constants (kOnTimeout in Node v12.19.0) will overwrite 0!
|
|
167
|
-
readonly kOnHeaders: 1
|
|
168
|
-
readonly kOnHeadersComplete: 2
|
|
169
|
-
readonly kOnBody: 3
|
|
170
|
-
readonly kOnMessageComplete: 4
|
|
171
|
-
|
|
172
|
-
kOnExecute(): void
|
|
173
|
-
}
|
|
174
|
-
export const HTTPParser: HTTPParserConstructor
|
|
175
|
-
export const methods: RequestMethod[]
|