node-red-contrib-web-worldmap 2.20.0 → 2.21.3
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 +4 -0
- package/README.md +5 -6
- package/node_modules/@turf/bezier-spline/dist/es/index.js +7 -3
- package/node_modules/@turf/bezier-spline/dist/es/lib/spline.js +0 -0
- package/node_modules/@turf/bezier-spline/dist/js/index.d.ts +0 -0
- package/node_modules/@turf/bezier-spline/dist/js/index.js +7 -3
- package/node_modules/@turf/bezier-spline/dist/js/lib/spline.d.ts +1 -1
- package/node_modules/@turf/bezier-spline/dist/js/lib/spline.js +0 -0
- package/node_modules/@turf/bezier-spline/package.json +23 -19
- package/node_modules/@turf/helpers/dist/es/index.js +2 -2
- package/node_modules/@turf/helpers/dist/es/lib/geojson.js +0 -0
- package/node_modules/@turf/helpers/dist/js/index.d.ts +1 -1
- package/node_modules/@turf/helpers/dist/js/index.js +2 -2
- package/node_modules/@turf/helpers/dist/js/lib/geojson.d.ts +0 -0
- package/node_modules/@turf/helpers/dist/js/lib/geojson.js +0 -0
- package/node_modules/@turf/helpers/package.json +22 -18
- package/node_modules/@turf/invariant/dist/es/index.js +0 -0
- package/node_modules/@turf/invariant/dist/js/index.d.ts +0 -0
- package/node_modules/@turf/invariant/dist/js/index.js +0 -0
- package/node_modules/@turf/invariant/package.json +22 -18
- package/node_modules/accepts/package.json +13 -10
- package/node_modules/array-flatten/package.json +8 -5
- package/node_modules/body-parser/node_modules/bytes/package.json +8 -5
- package/node_modules/body-parser/package.json +8 -5
- package/node_modules/bufferjs/package.json +13 -10
- package/node_modules/bufferlist/package.json +13 -13
- package/node_modules/cgi/package.json +7 -4
- package/node_modules/compressible/package.json +4 -4
- package/node_modules/compression/node_modules/bytes/package.json +4 -4
- package/node_modules/compression/package.json +12 -9
- package/node_modules/content-disposition/package.json +8 -5
- package/node_modules/content-type/package.json +13 -10
- package/node_modules/cookie/package.json +8 -5
- package/node_modules/cookie-signature/package.json +8 -5
- package/node_modules/debug/package.json +13 -10
- package/node_modules/depd/package.json +13 -10
- package/node_modules/destroy/package.json +13 -10
- package/node_modules/ee-first/package.json +8 -5
- package/node_modules/encodeurl/package.json +13 -10
- package/node_modules/escape-html/package.json +13 -10
- package/node_modules/etag/package.json +13 -10
- package/node_modules/express/package.json +12 -9
- package/node_modules/extend/package.json +13 -10
- package/node_modules/faye-websocket/package.json +13 -10
- package/node_modules/finalhandler/package.json +13 -10
- package/node_modules/forwarded/package.json +13 -10
- package/node_modules/fresh/package.json +8 -5
- package/node_modules/header-stack/package.json +13 -10
- package/node_modules/header-stack/parser.js +2 -2
- package/node_modules/http-errors/package.json +8 -5
- package/node_modules/iconv-lite/package.json +8 -5
- package/node_modules/inherits/package.json +8 -5
- package/node_modules/ipaddr.js/package.json +4 -4
- package/node_modules/media-typer/package.json +8 -5
- package/node_modules/merge-descriptors/package.json +8 -5
- package/node_modules/methods/package.json +13 -10
- package/node_modules/mime/package.json +8 -5
- package/node_modules/mime-db/package.json +5 -5
- package/node_modules/mime-types/package.json +5 -5
- package/node_modules/ms/package.json +8 -5
- package/node_modules/negotiator/package.json +8 -5
- package/node_modules/on-finished/package.json +13 -10
- package/node_modules/on-headers/package.json +13 -10
- package/node_modules/parseurl/package.json +13 -10
- package/node_modules/path-to-regexp/package.json +8 -5
- package/node_modules/proxy-addr/package.json +4 -4
- package/node_modules/qs/package.json +8 -5
- package/node_modules/range-parser/package.json +13 -10
- package/node_modules/raw-body/node_modules/bytes/package.json +8 -5
- package/node_modules/raw-body/package.json +8 -5
- package/node_modules/safe-buffer/package.json +8 -5
- package/node_modules/safer-buffer/package.json +13 -10
- package/node_modules/send/node_modules/ms/package.json +8 -5
- package/node_modules/send/package.json +8 -5
- package/node_modules/serve-static/package.json +8 -5
- package/node_modules/setprototypeof/package.json +8 -5
- package/node_modules/sockjs/package.json +12 -9
- package/node_modules/statuses/package.json +13 -10
- package/node_modules/stream-stack/package.json +13 -10
- package/node_modules/toidentifier/package.json +8 -5
- package/node_modules/type-is/package.json +13 -10
- package/node_modules/unpipe/package.json +8 -5
- package/node_modules/utils-merge/package.json +8 -5
- package/node_modules/uuid/package.json +13 -10
- package/node_modules/vary/package.json +13 -10
- package/node_modules/websocket-driver/node_modules/http-parser-js/package.json +4 -4
- package/node_modules/websocket-driver/package.json +13 -10
- package/node_modules/websocket-extensions/package.json +13 -10
- package/package.json +3 -3
- package/worldmap/leaflet/leaflet.css +2 -2
- package/worldmap/leaflet/leaflet.js.map +1 -0
- package/worldmap/leaflet/leaflet.latlng-graticule.js +23 -21
- package/worldmap/worldmap.js +420 -333
- package/worldmap.html +208 -109
- package/worldmap.js +24 -8
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Author: lanwei@cloudybay.com.tw
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
(function (window, document, undefined) {
|
|
8
|
+
(function (window, document, undefined) {
|
|
9
9
|
|
|
10
10
|
L.LatLngGraticule = L.Layer.extend({
|
|
11
|
-
includes: L.Mixin.Events,
|
|
12
|
-
|
|
11
|
+
includes: (L.Evented.prototype || L.Mixin.Events),
|
|
13
12
|
options: {
|
|
14
13
|
showLabel: true,
|
|
15
14
|
opacity: 1,
|
|
@@ -25,7 +24,8 @@
|
|
|
25
24
|
{start: 4, end: 4, interval: 10},
|
|
26
25
|
{start: 5, end: 7, interval: 5},
|
|
27
26
|
{start: 8, end: 20, interval: 1}
|
|
28
|
-
]
|
|
27
|
+
],
|
|
28
|
+
sides: ['N', 'S', 'E', 'W']
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
initialize: function (options) {
|
|
@@ -190,10 +190,10 @@
|
|
|
190
190
|
|
|
191
191
|
// todo: format type of float
|
|
192
192
|
if (lat < 0) {
|
|
193
|
-
return '' + (lat*-1) +
|
|
193
|
+
return '' + (lat*-1) + this.options.sides[1];
|
|
194
194
|
}
|
|
195
195
|
else if (lat > 0) {
|
|
196
|
-
return '' + lat +
|
|
196
|
+
return '' + lat + this.options.sides[0];
|
|
197
197
|
}
|
|
198
198
|
return '' + lat;
|
|
199
199
|
},
|
|
@@ -205,19 +205,19 @@
|
|
|
205
205
|
|
|
206
206
|
// todo: format type of float
|
|
207
207
|
if (lng > 180) {
|
|
208
|
-
return '' + (360 - lng) +
|
|
208
|
+
return '' + (360 - lng) + this.options.sides[3];
|
|
209
209
|
}
|
|
210
210
|
else if (lng > 0 && lng < 180) {
|
|
211
|
-
return '' + lng +
|
|
211
|
+
return '' + lng + this.options.sides[2];
|
|
212
212
|
}
|
|
213
213
|
else if (lng < 0 && lng > -180) {
|
|
214
|
-
return '' + (lng*-1) +
|
|
214
|
+
return '' + (lng*-1) + this.options.sides[3];
|
|
215
215
|
}
|
|
216
216
|
else if (lng == -180) {
|
|
217
217
|
return '' + (lng*-1);
|
|
218
218
|
}
|
|
219
219
|
else if (lng < -180) {
|
|
220
|
-
return '' + (360 + lng) +
|
|
220
|
+
return '' + (360 + lng) + this.options.sides[3];
|
|
221
221
|
}
|
|
222
222
|
return '' + lng;
|
|
223
223
|
},
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
var txtWidth = ctx.measureText('0').width;
|
|
309
309
|
var txtHeight = 12;
|
|
310
310
|
try {
|
|
311
|
-
var _font_size = ctx.font.split(' ')[0];
|
|
311
|
+
var _font_size = ctx.font.trim().split(' ')[0];
|
|
312
312
|
txtHeight = _parse_px_to_int(_font_size);
|
|
313
313
|
}
|
|
314
314
|
catch(e) {}
|
|
@@ -358,6 +358,7 @@
|
|
|
358
358
|
ll = self._latLngToCanvasPoint(L.latLng(lat_tick, _lon_l));
|
|
359
359
|
latstr = self.__format_lat(lat_tick);
|
|
360
360
|
txtWidth = ctx.measureText(latstr).width;
|
|
361
|
+
var spacer = self.options.showLabel && label ? txtWidth + 10 : 0;
|
|
361
362
|
|
|
362
363
|
if (curvedLat) {
|
|
363
364
|
if (typeof(curvedLat) == 'number') {
|
|
@@ -380,11 +381,11 @@
|
|
|
380
381
|
}
|
|
381
382
|
|
|
382
383
|
ctx.beginPath();
|
|
383
|
-
ctx.moveTo(ll.x, ll.y);
|
|
384
|
+
ctx.moveTo(ll.x + spacer, ll.y);
|
|
384
385
|
var _prev_p = null;
|
|
385
386
|
for (var j=__lon_left; j<=__lon_right; j+=_lon_delta) {
|
|
386
387
|
rr = self._latLngToCanvasPoint(L.latLng(lat_tick, j));
|
|
387
|
-
ctx.lineTo(rr.x, rr.y);
|
|
388
|
+
ctx.lineTo(rr.x - spacer, rr.y);
|
|
388
389
|
|
|
389
390
|
if (self.options.showLabel && label && _prev_p != null) {
|
|
390
391
|
if (_prev_p.x < 0 && rr.x >= 0) {
|
|
@@ -417,8 +418,8 @@
|
|
|
417
418
|
}
|
|
418
419
|
|
|
419
420
|
ctx.beginPath();
|
|
420
|
-
ctx.moveTo(
|
|
421
|
-
ctx.lineTo(rr.x-1, rr.y);
|
|
421
|
+
ctx.moveTo(1 + spacer, ll.y);
|
|
422
|
+
ctx.lineTo(rr.x-1 - spacer, rr.y);
|
|
422
423
|
ctx.stroke();
|
|
423
424
|
if (self.options.showLabel && label) {
|
|
424
425
|
var _yy = ll.y + (txtHeight/2)-2;
|
|
@@ -445,6 +446,7 @@
|
|
|
445
446
|
lngstr = self.__format_lng(lon_tick);
|
|
446
447
|
txtWidth = ctx.measureText(lngstr).width;
|
|
447
448
|
var bb = self._latLngToCanvasPoint(L.latLng(_lat_b, lon_tick));
|
|
449
|
+
var spacer = self.options.showLabel && label ? txtHeight + 5 : 0;
|
|
448
450
|
|
|
449
451
|
if (curvedLon) {
|
|
450
452
|
if (typeof(curvedLon) == 'number') {
|
|
@@ -452,15 +454,15 @@
|
|
|
452
454
|
}
|
|
453
455
|
|
|
454
456
|
ctx.beginPath();
|
|
455
|
-
ctx.moveTo(bb.x,
|
|
457
|
+
ctx.moveTo(bb.x, 5 + spacer);
|
|
456
458
|
var _prev_p = null;
|
|
457
459
|
for (var j=_lat_b; j<_lat_t; j+=_lat_delta) {
|
|
458
460
|
var tt = self._latLngToCanvasPoint(L.latLng(j, lon_tick));
|
|
459
|
-
ctx.lineTo(tt.x, tt.y);
|
|
461
|
+
ctx.lineTo(tt.x, tt.y - spacer);
|
|
460
462
|
|
|
461
463
|
if (self.options.showLabel && label && _prev_p != null) {
|
|
462
464
|
if (_prev_p.y > 8 && tt.y <= 8) {
|
|
463
|
-
ctx.fillText(lngstr, tt.x - (txtWidth/2), txtHeight);
|
|
465
|
+
ctx.fillText(lngstr, tt.x - (txtWidth/2), txtHeight + 5);
|
|
464
466
|
}
|
|
465
467
|
else if (_prev_p.y >= hh && tt.y < hh) {
|
|
466
468
|
ctx.fillText(lngstr, tt.x - (txtWidth/2), hh-2);
|
|
@@ -487,12 +489,12 @@
|
|
|
487
489
|
}
|
|
488
490
|
|
|
489
491
|
ctx.beginPath();
|
|
490
|
-
ctx.moveTo(tt.x,
|
|
491
|
-
ctx.lineTo(bb.x,
|
|
492
|
+
ctx.moveTo(tt.x, 5 + spacer);
|
|
493
|
+
ctx.lineTo(bb.x, hh-1 - spacer);
|
|
492
494
|
ctx.stroke();
|
|
493
495
|
|
|
494
496
|
if (self.options.showLabel && label) {
|
|
495
|
-
ctx.fillText(lngstr, tt.x - (txtWidth/2), txtHeight+
|
|
497
|
+
ctx.fillText(lngstr, tt.x - (txtWidth/2), txtHeight+5);
|
|
496
498
|
ctx.fillText(lngstr, bb.x - (txtWidth/2), hh-3);
|
|
497
499
|
}
|
|
498
500
|
}
|