@deck.gl/widgets 9.0.37 → 9.0.40
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/dist/compass-widget.d.ts.map +1 -1
- package/dist/compass-widget.js +16 -4
- package/dist/dist.dev.js +33 -17
- package/dist/fullscreen-widget.d.ts.map +1 -1
- package/dist/fullscreen-widget.js +4 -10
- package/dist/index.cjs +33 -15
- package/dist/index.cjs.map +3 -3
- package/dist/zoom-widget.d.ts.map +1 -1
- package/dist/zoom-widget.js +16 -4
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/src/compass-widget.tsx +23 -4
- package/src/fullscreen-widget.tsx +8 -12
- package/src/zoom-widget.tsx +21 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compass-widget.d.ts","sourceRoot":"","sources":["../src/compass-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compass-widget.d.ts","sourceRoot":"","sources":["../src/compass-widget.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAG3E,UAAU,kBAAkB;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,aAAc,YAAW,MAAM,CAAC,kBAAkB,CAAC;IAC9D,EAAE,SAAa;IACf,KAAK,EAAE,kBAAkB,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAc;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,SAAS,EAAE;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAC,CAAM;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;gBAEb,KAAK,EAAE,kBAAkB;IAUrC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAkB3C,gBAAgB,CAAC,QAAQ,EAAE,QAAQ;IAKnC,KAAK,CAAC,EAAC,IAAI,EAAC,EAAE;QAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;KAAC,GAAG,cAAc;IAYhD,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ;IAS/B,MAAM;IAsCN,QAAQ;IAKR,kBAAkB,CAAC,QAAQ,EAAE,QAAQ;CActC"}
|
package/dist/compass-widget.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
/* global document */
|
|
3
|
-
import { FlyToInterpolator, WebMercatorViewport, _GlobeViewport } from '@deck.gl/core';
|
|
3
|
+
import { FlyToInterpolator, WebMercatorViewport, _GlobeViewport, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';
|
|
4
4
|
import { render } from 'preact';
|
|
5
5
|
export class CompassWidget {
|
|
6
6
|
constructor(props) {
|
|
@@ -17,6 +17,20 @@ export class CompassWidget {
|
|
|
17
17
|
this.props = props;
|
|
18
18
|
}
|
|
19
19
|
setProps(props) {
|
|
20
|
+
const oldProps = this.props;
|
|
21
|
+
const el = this.element;
|
|
22
|
+
if (el) {
|
|
23
|
+
if (oldProps.className !== props.className) {
|
|
24
|
+
if (oldProps.className)
|
|
25
|
+
el.classList.remove(oldProps.className);
|
|
26
|
+
if (props.className)
|
|
27
|
+
el.classList.add(props.className);
|
|
28
|
+
}
|
|
29
|
+
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
30
|
+
removeStyles(el, oldProps.style);
|
|
31
|
+
applyStyles(el, props.style);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
20
34
|
Object.assign(this.props, props);
|
|
21
35
|
}
|
|
22
36
|
onViewportChange(viewport) {
|
|
@@ -29,9 +43,7 @@ export class CompassWidget {
|
|
|
29
43
|
element.classList.add('deck-widget', 'deck-widget-compass');
|
|
30
44
|
if (className)
|
|
31
45
|
element.classList.add(className);
|
|
32
|
-
|
|
33
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
34
|
-
}
|
|
46
|
+
applyStyles(element, style);
|
|
35
47
|
this.deck = deck;
|
|
36
48
|
this.element = element;
|
|
37
49
|
this.update();
|
package/dist/dist.dev.js
CHANGED
|
@@ -431,9 +431,7 @@ var __exports__ = (() => {
|
|
|
431
431
|
el.classList.add("deck-widget", "deck-widget-fullscreen");
|
|
432
432
|
if (className)
|
|
433
433
|
el.classList.add(className);
|
|
434
|
-
|
|
435
|
-
Object.entries(style).map(([key, value]) => el.style.setProperty(key, value));
|
|
436
|
-
}
|
|
434
|
+
(0, import_core2._applyStyles)(el, style);
|
|
437
435
|
this.deck = deck;
|
|
438
436
|
this.element = el;
|
|
439
437
|
this.update();
|
|
@@ -472,14 +470,8 @@ var __exports__ = (() => {
|
|
|
472
470
|
el.classList.add(props.className);
|
|
473
471
|
}
|
|
474
472
|
if (!(0, import_core2._deepEqual)(oldProps.style, props.style, 1)) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
if (props.style) {
|
|
479
|
-
Object.entries(props.style).map(
|
|
480
|
-
([key, value]) => el.style.setProperty(key, value)
|
|
481
|
-
);
|
|
482
|
-
}
|
|
473
|
+
(0, import_core2._removeStyles)(el, oldProps.style);
|
|
474
|
+
(0, import_core2._applyStyles)(el, props.style);
|
|
483
475
|
}
|
|
484
476
|
}
|
|
485
477
|
Object.assign(this.props, props);
|
|
@@ -540,6 +532,20 @@ var __exports__ = (() => {
|
|
|
540
532
|
this.props = props;
|
|
541
533
|
}
|
|
542
534
|
setProps(props) {
|
|
535
|
+
const oldProps = this.props;
|
|
536
|
+
const el = this.element;
|
|
537
|
+
if (el) {
|
|
538
|
+
if (oldProps.className !== props.className) {
|
|
539
|
+
if (oldProps.className)
|
|
540
|
+
el.classList.remove(oldProps.className);
|
|
541
|
+
if (props.className)
|
|
542
|
+
el.classList.add(props.className);
|
|
543
|
+
}
|
|
544
|
+
if (!(0, import_core3._deepEqual)(oldProps.style, props.style, 1)) {
|
|
545
|
+
(0, import_core3._removeStyles)(el, oldProps.style);
|
|
546
|
+
(0, import_core3._applyStyles)(el, props.style);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
543
549
|
Object.assign(this.props, props);
|
|
544
550
|
}
|
|
545
551
|
onViewportChange(viewport) {
|
|
@@ -552,9 +558,7 @@ var __exports__ = (() => {
|
|
|
552
558
|
element.classList.add("deck-widget", "deck-widget-compass");
|
|
553
559
|
if (className)
|
|
554
560
|
element.classList.add(className);
|
|
555
|
-
|
|
556
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
557
|
-
}
|
|
561
|
+
(0, import_core3._applyStyles)(element, style);
|
|
558
562
|
this.deck = deck;
|
|
559
563
|
this.element = element;
|
|
560
564
|
this.update();
|
|
@@ -651,9 +655,7 @@ var __exports__ = (() => {
|
|
|
651
655
|
element.classList.add("deck-widget", "deck-widget-zoom");
|
|
652
656
|
if (className)
|
|
653
657
|
element.classList.add(className);
|
|
654
|
-
|
|
655
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
656
|
-
}
|
|
658
|
+
(0, import_core4._applyStyles)(element, style);
|
|
657
659
|
const ui = /* @__PURE__ */ u2(ButtonGroup, { orientation: this.orientation, children: [
|
|
658
660
|
/* @__PURE__ */ u2(
|
|
659
661
|
GroupedIconButton,
|
|
@@ -682,6 +684,20 @@ var __exports__ = (() => {
|
|
|
682
684
|
this.element = void 0;
|
|
683
685
|
}
|
|
684
686
|
setProps(props) {
|
|
687
|
+
const oldProps = this.props;
|
|
688
|
+
const el = this.element;
|
|
689
|
+
if (el) {
|
|
690
|
+
if (oldProps.className !== props.className) {
|
|
691
|
+
if (oldProps.className)
|
|
692
|
+
el.classList.remove(oldProps.className);
|
|
693
|
+
if (props.className)
|
|
694
|
+
el.classList.add(props.className);
|
|
695
|
+
}
|
|
696
|
+
if (!(0, import_core4._deepEqual)(oldProps.style, props.style, 1)) {
|
|
697
|
+
(0, import_core4._removeStyles)(el, oldProps.style);
|
|
698
|
+
(0, import_core4._applyStyles)(el, props.style);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
685
701
|
Object.assign(this.props, props);
|
|
686
702
|
}
|
|
687
703
|
onViewportChange(viewport) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen-widget.d.ts","sourceRoot":"","sources":["../src/fullscreen-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fullscreen-widget.d.ts","sourceRoot":"","sources":["../src/fullscreen-widget.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAIjE,UAAU,qBAAqB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;OAGG;IAEH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAiB,YAAW,MAAM,CAAC,qBAAqB,CAAC;IACpE,EAAE,SAAgB;IAClB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,SAAS,EAAE,eAAe,CAAc;IAExC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,UAAU,EAAE,OAAO,CAAS;gBAEhB,KAAK,EAAE,qBAAqB;IASxC,KAAK,CAAC,EAAC,IAAI,EAAC,EAAE;QAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;KAAC,GAAG,cAAc;IAahD,QAAQ;IAMR,OAAO,CAAC,MAAM;IAiBd,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAkB9C,YAAY;IAIZ,kBAAkB;IASZ,WAAW;IASX,iBAAiB;IASjB,cAAc;IAQpB,sBAAsB;CAGvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
2
|
/* global document */
|
|
3
|
-
import { _deepEqual as deepEqual } from '@deck.gl/core';
|
|
3
|
+
import { _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';
|
|
4
4
|
import { render } from 'preact';
|
|
5
5
|
import { IconButton } from "./components.js";
|
|
6
6
|
export class FullscreenWidget {
|
|
@@ -21,9 +21,7 @@ export class FullscreenWidget {
|
|
|
21
21
|
el.classList.add('deck-widget', 'deck-widget-fullscreen');
|
|
22
22
|
if (className)
|
|
23
23
|
el.classList.add(className);
|
|
24
|
-
|
|
25
|
-
Object.entries(style).map(([key, value]) => el.style.setProperty(key, value));
|
|
26
|
-
}
|
|
24
|
+
applyStyles(el, style);
|
|
27
25
|
this.deck = deck;
|
|
28
26
|
this.element = el;
|
|
29
27
|
this.update();
|
|
@@ -55,12 +53,8 @@ export class FullscreenWidget {
|
|
|
55
53
|
el.classList.add(props.className);
|
|
56
54
|
}
|
|
57
55
|
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
if (props.style) {
|
|
62
|
-
Object.entries(props.style).map(([key, value]) => el.style.setProperty(key, value));
|
|
63
|
-
}
|
|
56
|
+
removeStyles(el, oldProps.style);
|
|
57
|
+
applyStyles(el, props.style);
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
Object.assign(this.props, props);
|
package/dist/index.cjs
CHANGED
|
@@ -69,9 +69,7 @@ var FullscreenWidget = class {
|
|
|
69
69
|
el.classList.add("deck-widget", "deck-widget-fullscreen");
|
|
70
70
|
if (className)
|
|
71
71
|
el.classList.add(className);
|
|
72
|
-
|
|
73
|
-
Object.entries(style).map(([key, value]) => el.style.setProperty(key, value));
|
|
74
|
-
}
|
|
72
|
+
(0, import_core._applyStyles)(el, style);
|
|
75
73
|
this.deck = deck;
|
|
76
74
|
this.element = el;
|
|
77
75
|
this.update();
|
|
@@ -103,12 +101,8 @@ var FullscreenWidget = class {
|
|
|
103
101
|
el.classList.add(props.className);
|
|
104
102
|
}
|
|
105
103
|
if (!(0, import_core._deepEqual)(oldProps.style, props.style, 1)) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
if (props.style) {
|
|
110
|
-
Object.entries(props.style).map(([key, value]) => el.style.setProperty(key, value));
|
|
111
|
-
}
|
|
104
|
+
(0, import_core._removeStyles)(el, oldProps.style);
|
|
105
|
+
(0, import_core._applyStyles)(el, props.style);
|
|
112
106
|
}
|
|
113
107
|
}
|
|
114
108
|
Object.assign(this.props, props);
|
|
@@ -173,6 +167,20 @@ var CompassWidget = class {
|
|
|
173
167
|
this.props = props;
|
|
174
168
|
}
|
|
175
169
|
setProps(props) {
|
|
170
|
+
const oldProps = this.props;
|
|
171
|
+
const el = this.element;
|
|
172
|
+
if (el) {
|
|
173
|
+
if (oldProps.className !== props.className) {
|
|
174
|
+
if (oldProps.className)
|
|
175
|
+
el.classList.remove(oldProps.className);
|
|
176
|
+
if (props.className)
|
|
177
|
+
el.classList.add(props.className);
|
|
178
|
+
}
|
|
179
|
+
if (!(0, import_core2._deepEqual)(oldProps.style, props.style, 1)) {
|
|
180
|
+
(0, import_core2._removeStyles)(el, oldProps.style);
|
|
181
|
+
(0, import_core2._applyStyles)(el, props.style);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
176
184
|
Object.assign(this.props, props);
|
|
177
185
|
}
|
|
178
186
|
onViewportChange(viewport) {
|
|
@@ -185,9 +193,7 @@ var CompassWidget = class {
|
|
|
185
193
|
element.classList.add("deck-widget", "deck-widget-compass");
|
|
186
194
|
if (className)
|
|
187
195
|
element.classList.add(className);
|
|
188
|
-
|
|
189
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
190
|
-
}
|
|
196
|
+
(0, import_core2._applyStyles)(element, style);
|
|
191
197
|
this.deck = deck;
|
|
192
198
|
this.element = element;
|
|
193
199
|
this.update();
|
|
@@ -263,9 +269,7 @@ var ZoomWidget = class {
|
|
|
263
269
|
element.classList.add("deck-widget", "deck-widget-zoom");
|
|
264
270
|
if (className)
|
|
265
271
|
element.classList.add(className);
|
|
266
|
-
|
|
267
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
268
|
-
}
|
|
272
|
+
(0, import_core3._applyStyles)(element, style);
|
|
269
273
|
const ui = (0, import_jsx_runtime4.jsxs)(ButtonGroup, { orientation: this.orientation, children: [(0, import_jsx_runtime4.jsx)(GroupedIconButton, { onClick: () => this.handleZoomIn(), label: this.props.zoomInLabel, className: "deck-widget-zoom-in" }), (0, import_jsx_runtime4.jsx)(GroupedIconButton, { onClick: () => this.handleZoomOut(), label: this.props.zoomOutLabel, className: "deck-widget-zoom-out" })] });
|
|
270
274
|
(0, import_preact3.render)(ui, element);
|
|
271
275
|
this.deck = deck;
|
|
@@ -277,6 +281,20 @@ var ZoomWidget = class {
|
|
|
277
281
|
this.element = void 0;
|
|
278
282
|
}
|
|
279
283
|
setProps(props) {
|
|
284
|
+
const oldProps = this.props;
|
|
285
|
+
const el = this.element;
|
|
286
|
+
if (el) {
|
|
287
|
+
if (oldProps.className !== props.className) {
|
|
288
|
+
if (oldProps.className)
|
|
289
|
+
el.classList.remove(oldProps.className);
|
|
290
|
+
if (props.className)
|
|
291
|
+
el.classList.add(props.className);
|
|
292
|
+
}
|
|
293
|
+
if (!(0, import_core3._deepEqual)(oldProps.style, props.style, 1)) {
|
|
294
|
+
(0, import_core3._removeStyles)(el, oldProps.style);
|
|
295
|
+
(0, import_core3._applyStyles)(el, props.style);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
280
298
|
Object.assign(this.props, props);
|
|
281
299
|
}
|
|
282
300
|
onViewportChange(viewport) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js", "fullscreen-widget.js", "components.js", "compass-widget.js", "zoom-widget.js", "themes.js"],
|
|
4
|
-
"sourcesContent": ["export { FullscreenWidget } from \"./fullscreen-widget.js\";\nexport { CompassWidget } from \"./compass-widget.js\";\nexport { ZoomWidget } from \"./zoom-widget.js\";\nexport * from \"./themes.js\";\n", "import { jsx as _jsx } from \"preact/jsx-runtime\";\n/* global document */\nimport { _deepEqual as deepEqual } from '@deck.gl/core';\nimport { render } from 'preact';\nimport { IconButton } from \"./components.js\";\nexport class FullscreenWidget {\n constructor(props) {\n this.id = 'fullscreen';\n this.placement = 'top-left';\n this.fullscreen = false;\n this.id = props.id || 'fullscreen';\n this.placement = props.placement || 'top-left';\n props.enterLabel = props.enterLabel || 'Enter Fullscreen';\n props.exitLabel = props.exitLabel || 'Exit Fullscreen';\n props.style = props.style || {};\n this.props = props;\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const el = document.createElement('div');\n el.classList.add('deck-widget', 'deck-widget-fullscreen');\n if (className)\n el.classList.add(className);\n if (style) {\n Object.entries(style).map(([key, value]) => el.style.setProperty(key, value));\n }\n this.deck = deck;\n this.element = el;\n this.update();\n document.addEventListener('fullscreenchange', this.onFullscreenChange.bind(this));\n return el;\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n document.removeEventListener('fullscreenchange', this.onFullscreenChange.bind(this));\n }\n update() {\n const { enterLabel, exitLabel } = this.props;\n const el = this.element;\n if (!el) {\n return;\n }\n const ui = (_jsx(IconButton, { onClick: this.handleClick.bind(this), label: this.fullscreen ? exitLabel : enterLabel, className: this.fullscreen ? 'deck-widget-fullscreen-exit' : 'deck-widget-fullscreen-enter' }));\n render(ui, el);\n }\n setProps(props) {\n const oldProps = this.props;\n const el = this.element;\n if (el) {\n if (oldProps.className !== props.className) {\n if (oldProps.className)\n el.classList.remove(oldProps.className);\n if (props.className)\n el.classList.add(props.className);\n }\n if (!deepEqual(oldProps.style, props.style, 1)) {\n if (oldProps.style) {\n Object.entries(oldProps.style).map(([key]) => el.style.removeProperty(key));\n }\n if (props.style) {\n Object.entries(props.style).map(([key, value]) => el.style.setProperty(key, value));\n }\n }\n }\n Object.assign(this.props, props);\n }\n getContainer() {\n return this.props.container || this.deck?.getCanvas()?.parentElement;\n }\n onFullscreenChange() {\n const prevFullscreen = this.fullscreen;\n const fullscreen = document.fullscreenElement === this.getContainer();\n if (prevFullscreen !== fullscreen) {\n this.fullscreen = !this.fullscreen;\n }\n this.update();\n }\n async handleClick() {\n if (this.fullscreen) {\n await this.exitFullscreen();\n }\n else {\n await this.requestFullscreen();\n }\n this.update();\n }\n async requestFullscreen() {\n const container = this.getContainer();\n if (container?.requestFullscreen) {\n await container.requestFullscreen({ navigationUI: 'hide' });\n }\n else {\n this.togglePseudoFullscreen();\n }\n }\n async exitFullscreen() {\n if (document.exitFullscreen) {\n await document.exitFullscreen();\n }\n else {\n this.togglePseudoFullscreen();\n }\n }\n togglePseudoFullscreen() {\n this.getContainer()?.classList.toggle('deck-pseudo-fullscreen');\n }\n}\n", "import { jsx as _jsx } from \"preact/jsx-runtime\";\nexport const IconButton = props => {\n const { className, label, onClick } = props;\n return (_jsx(\"div\", { className: \"deck-widget-button\", children: _jsx(\"button\", { className: `deck-widget-icon-button ${className}`, type: \"button\", onClick: onClick, title: label, children: _jsx(\"div\", { className: \"deck-widget-icon\" }) }) }));\n};\nexport const ButtonGroup = props => {\n const { children, orientation } = props;\n return _jsx(\"div\", { className: `deck-widget-button-group ${orientation}`, children: children });\n};\nexport const GroupedIconButton = props => {\n const { className, label, onClick } = props;\n return (_jsx(\"button\", { className: `deck-widget-icon-button ${className}`, type: \"button\", onClick: onClick, title: label, children: _jsx(\"div\", { className: \"deck-widget-icon\" }) }));\n};\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\n/* global document */\nimport { FlyToInterpolator, WebMercatorViewport, _GlobeViewport } from '@deck.gl/core';\nimport { render } from 'preact';\nexport class CompassWidget {\n constructor(props) {\n this.id = 'compass';\n this.placement = 'top-left';\n this.viewId = null;\n this.viewports = {};\n this.id = props.id || 'compass';\n this.viewId = props.viewId || null;\n this.placement = props.placement || 'top-left';\n props.transitionDuration = props.transitionDuration || 200;\n props.label = props.label || 'Compass';\n props.style = props.style || {};\n this.props = props;\n }\n setProps(props) {\n Object.assign(this.props, props);\n }\n onViewportChange(viewport) {\n this.viewports[viewport.id] = viewport;\n this.update();\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const element = document.createElement('div');\n element.classList.add('deck-widget', 'deck-widget-compass');\n if (className)\n element.classList.add(className);\n if (style) {\n Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));\n }\n this.deck = deck;\n this.element = element;\n this.update();\n return element;\n }\n getRotation(viewport) {\n if (viewport instanceof WebMercatorViewport) {\n return [-viewport.bearing, viewport.pitch];\n }\n else if (viewport instanceof _GlobeViewport) {\n return [0, Math.max(-80, Math.min(80, viewport.latitude))];\n }\n return [0, 0];\n }\n update() {\n const viewId = this.viewId || Object.values(this.viewports)[0]?.id || 'default-view';\n const viewport = this.viewports[viewId];\n const [rz, rx] = this.getRotation(viewport);\n const element = this.element;\n if (!element) {\n return;\n }\n const ui = (_jsx(\"div\", { className: \"deck-widget-button\", style: { perspective: 100 }, children: _jsx(\"button\", { type: \"button\", onClick: () => {\n for (const viewport of Object.values(this.viewports)) {\n this.handleCompassReset(viewport);\n }\n }, label: this.props.label, style: { transform: `rotateX(${rx}deg)` }, children: _jsx(\"svg\", { fill: \"none\", width: \"100%\", height: \"100%\", viewBox: \"0 0 26 26\", children: _jsxs(\"g\", { transform: `rotate(${rz},13,13)`, children: [_jsx(\"path\", { d: \"M10 13.0001L12.9999 5L15.9997 13.0001H10Z\", fill: \"var(--icon-compass-north-color, #F05C44)\" }), _jsx(\"path\", { d: \"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z\", fill: \"var(--icon-compass-south-color, #C2C2CC)\" })] }) }) }) }));\n render(ui, element);\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n }\n handleCompassReset(viewport) {\n const viewId = this.viewId || viewport.id || 'default-view';\n if (viewport instanceof WebMercatorViewport) {\n const nextViewState = {\n ...viewport,\n bearing: 0,\n ...(this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {}),\n transitionDuration: this.props.transitionDuration,\n transitionInterpolator: new FlyToInterpolator()\n };\n // @ts-ignore Using private method temporary until there's a public one\n this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });\n }\n }\n}\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\n/* global document */\nimport { FlyToInterpolator } from '@deck.gl/core';\nimport { render } from 'preact';\nimport { ButtonGroup, GroupedIconButton } from \"./components.js\";\nexport class ZoomWidget {\n constructor(props) {\n this.id = 'zoom';\n this.placement = 'top-left';\n this.orientation = 'vertical';\n this.viewId = null;\n this.viewports = {};\n this.id = props.id || 'zoom';\n this.viewId = props.viewId || null;\n this.placement = props.placement || 'top-left';\n this.orientation = props.orientation || 'vertical';\n props.transitionDuration = props.transitionDuration || 200;\n props.zoomInLabel = props.zoomInLabel || 'Zoom In';\n props.zoomOutLabel = props.zoomOutLabel || 'Zoom Out';\n props.style = props.style || {};\n this.props = props;\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const element = document.createElement('div');\n element.classList.add('deck-widget', 'deck-widget-zoom');\n if (className)\n element.classList.add(className);\n if (style) {\n Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));\n }\n const ui = (_jsxs(ButtonGroup, { orientation: this.orientation, children: [_jsx(GroupedIconButton, { onClick: () => this.handleZoomIn(), label: this.props.zoomInLabel, className: \"deck-widget-zoom-in\" }), _jsx(GroupedIconButton, { onClick: () => this.handleZoomOut(), label: this.props.zoomOutLabel, className: \"deck-widget-zoom-out\" })] }));\n render(ui, element);\n this.deck = deck;\n this.element = element;\n return element;\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n }\n setProps(props) {\n Object.assign(this.props, props);\n }\n onViewportChange(viewport) {\n this.viewports[viewport.id] = viewport;\n }\n handleZoom(viewport, nextZoom) {\n const viewId = this.viewId || viewport?.id || 'default-view';\n const nextViewState = {\n ...viewport,\n zoom: nextZoom,\n transitionDuration: this.props.transitionDuration,\n transitionInterpolator: new FlyToInterpolator()\n };\n // @ts-ignore Using private method temporary until there's a public one\n this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });\n }\n handleZoomIn() {\n for (const viewport of Object.values(this.viewports)) {\n this.handleZoom(viewport, viewport.zoom + 1);\n }\n }\n handleZoomOut() {\n for (const viewport of Object.values(this.viewports)) {\n this.handleZoom(viewport, viewport.zoom - 1);\n }\n }\n}\n", "export const LightTheme = {\n '--button-background': '#fff',\n '--button-stroke': 'rgba(255, 255, 255, 0.3)',\n '--button-inner-stroke': 'unset',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25)',\n '--button-backdrop-filter': 'unset',\n '--button-icon-idle': 'rgba(97, 97, 102, 1)',\n '--button-icon-hover': 'rgba(24, 24, 26, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const DarkTheme = {\n '--button-background': 'rgba(18, 18, 20, 1)',\n '--button-stroke': 'rgba(18, 18, 20, 0.30)',\n '--button-inner-stroke': 'unset',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25)',\n '--button-backdrop-filter': 'unset',\n '--button-icon-idle': 'rgba(158, 157, 168, 1)',\n '--button-icon-hover': 'rgba(215, 214, 229, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const LightGlassTheme = {\n '--button-background': 'rgba(255, 255, 255, 0.6)',\n '--button-stroke': 'rgba(255, 255, 255, 0.3)',\n '--button-inner-stroke': '1px solid rgba(255, 255, 255, 0.6)',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset',\n '--button-backdrop-filter': 'blur(4px)',\n '--button-icon-idle': 'rgba(97, 97, 102, 1)',\n '--button-icon-hover': 'rgba(24, 24, 26, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const DarkGlassTheme = {\n '--button-background': 'rgba(18, 18, 20, 0.75)',\n '--button-stroke': 'rgba(18, 18, 20, 0.30)',\n '--button-inner-stroke': '1px solid rgba(18, 18, 20, 0.75)',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset',\n '--button-backdrop-filter': 'blur(4px)',\n '--button-icon-idle': 'rgba(158, 157, 168, 1)',\n '--button-icon-hover': 'rgba(215, 214, 229, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA4B;AAE5B,
|
|
6
|
-
"names": ["import_jsx_runtime", "_jsx", "_jsx", "deepEqual", "import_jsx_runtime", "import_core", "import_preact", "_jsx", "viewport", "_jsxs", "import_jsx_runtime", "import_core", "import_preact", "_jsxs", "_jsx"]
|
|
4
|
+
"sourcesContent": ["export { FullscreenWidget } from \"./fullscreen-widget.js\";\nexport { CompassWidget } from \"./compass-widget.js\";\nexport { ZoomWidget } from \"./zoom-widget.js\";\nexport * from \"./themes.js\";\n", "import { jsx as _jsx } from \"preact/jsx-runtime\";\n/* global document */\nimport { _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';\nimport { render } from 'preact';\nimport { IconButton } from \"./components.js\";\nexport class FullscreenWidget {\n constructor(props) {\n this.id = 'fullscreen';\n this.placement = 'top-left';\n this.fullscreen = false;\n this.id = props.id || 'fullscreen';\n this.placement = props.placement || 'top-left';\n props.enterLabel = props.enterLabel || 'Enter Fullscreen';\n props.exitLabel = props.exitLabel || 'Exit Fullscreen';\n props.style = props.style || {};\n this.props = props;\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const el = document.createElement('div');\n el.classList.add('deck-widget', 'deck-widget-fullscreen');\n if (className)\n el.classList.add(className);\n applyStyles(el, style);\n this.deck = deck;\n this.element = el;\n this.update();\n document.addEventListener('fullscreenchange', this.onFullscreenChange.bind(this));\n return el;\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n document.removeEventListener('fullscreenchange', this.onFullscreenChange.bind(this));\n }\n update() {\n const { enterLabel, exitLabel } = this.props;\n const el = this.element;\n if (!el) {\n return;\n }\n const ui = (_jsx(IconButton, { onClick: this.handleClick.bind(this), label: this.fullscreen ? exitLabel : enterLabel, className: this.fullscreen ? 'deck-widget-fullscreen-exit' : 'deck-widget-fullscreen-enter' }));\n render(ui, el);\n }\n setProps(props) {\n const oldProps = this.props;\n const el = this.element;\n if (el) {\n if (oldProps.className !== props.className) {\n if (oldProps.className)\n el.classList.remove(oldProps.className);\n if (props.className)\n el.classList.add(props.className);\n }\n if (!deepEqual(oldProps.style, props.style, 1)) {\n removeStyles(el, oldProps.style);\n applyStyles(el, props.style);\n }\n }\n Object.assign(this.props, props);\n }\n getContainer() {\n return this.props.container || this.deck?.getCanvas()?.parentElement;\n }\n onFullscreenChange() {\n const prevFullscreen = this.fullscreen;\n const fullscreen = document.fullscreenElement === this.getContainer();\n if (prevFullscreen !== fullscreen) {\n this.fullscreen = !this.fullscreen;\n }\n this.update();\n }\n async handleClick() {\n if (this.fullscreen) {\n await this.exitFullscreen();\n }\n else {\n await this.requestFullscreen();\n }\n this.update();\n }\n async requestFullscreen() {\n const container = this.getContainer();\n if (container?.requestFullscreen) {\n await container.requestFullscreen({ navigationUI: 'hide' });\n }\n else {\n this.togglePseudoFullscreen();\n }\n }\n async exitFullscreen() {\n if (document.exitFullscreen) {\n await document.exitFullscreen();\n }\n else {\n this.togglePseudoFullscreen();\n }\n }\n togglePseudoFullscreen() {\n this.getContainer()?.classList.toggle('deck-pseudo-fullscreen');\n }\n}\n", "import { jsx as _jsx } from \"preact/jsx-runtime\";\nexport const IconButton = props => {\n const { className, label, onClick } = props;\n return (_jsx(\"div\", { className: \"deck-widget-button\", children: _jsx(\"button\", { className: `deck-widget-icon-button ${className}`, type: \"button\", onClick: onClick, title: label, children: _jsx(\"div\", { className: \"deck-widget-icon\" }) }) }));\n};\nexport const ButtonGroup = props => {\n const { children, orientation } = props;\n return _jsx(\"div\", { className: `deck-widget-button-group ${orientation}`, children: children });\n};\nexport const GroupedIconButton = props => {\n const { className, label, onClick } = props;\n return (_jsx(\"button\", { className: `deck-widget-icon-button ${className}`, type: \"button\", onClick: onClick, title: label, children: _jsx(\"div\", { className: \"deck-widget-icon\" }) }));\n};\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\n/* global document */\nimport { FlyToInterpolator, WebMercatorViewport, _GlobeViewport, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';\nimport { render } from 'preact';\nexport class CompassWidget {\n constructor(props) {\n this.id = 'compass';\n this.placement = 'top-left';\n this.viewId = null;\n this.viewports = {};\n this.id = props.id || 'compass';\n this.viewId = props.viewId || null;\n this.placement = props.placement || 'top-left';\n props.transitionDuration = props.transitionDuration || 200;\n props.label = props.label || 'Compass';\n props.style = props.style || {};\n this.props = props;\n }\n setProps(props) {\n const oldProps = this.props;\n const el = this.element;\n if (el) {\n if (oldProps.className !== props.className) {\n if (oldProps.className)\n el.classList.remove(oldProps.className);\n if (props.className)\n el.classList.add(props.className);\n }\n if (!deepEqual(oldProps.style, props.style, 1)) {\n removeStyles(el, oldProps.style);\n applyStyles(el, props.style);\n }\n }\n Object.assign(this.props, props);\n }\n onViewportChange(viewport) {\n this.viewports[viewport.id] = viewport;\n this.update();\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const element = document.createElement('div');\n element.classList.add('deck-widget', 'deck-widget-compass');\n if (className)\n element.classList.add(className);\n applyStyles(element, style);\n this.deck = deck;\n this.element = element;\n this.update();\n return element;\n }\n getRotation(viewport) {\n if (viewport instanceof WebMercatorViewport) {\n return [-viewport.bearing, viewport.pitch];\n }\n else if (viewport instanceof _GlobeViewport) {\n return [0, Math.max(-80, Math.min(80, viewport.latitude))];\n }\n return [0, 0];\n }\n update() {\n const viewId = this.viewId || Object.values(this.viewports)[0]?.id || 'default-view';\n const viewport = this.viewports[viewId];\n const [rz, rx] = this.getRotation(viewport);\n const element = this.element;\n if (!element) {\n return;\n }\n const ui = (_jsx(\"div\", { className: \"deck-widget-button\", style: { perspective: 100 }, children: _jsx(\"button\", { type: \"button\", onClick: () => {\n for (const viewport of Object.values(this.viewports)) {\n this.handleCompassReset(viewport);\n }\n }, label: this.props.label, style: { transform: `rotateX(${rx}deg)` }, children: _jsx(\"svg\", { fill: \"none\", width: \"100%\", height: \"100%\", viewBox: \"0 0 26 26\", children: _jsxs(\"g\", { transform: `rotate(${rz},13,13)`, children: [_jsx(\"path\", { d: \"M10 13.0001L12.9999 5L15.9997 13.0001H10Z\", fill: \"var(--icon-compass-north-color, #F05C44)\" }), _jsx(\"path\", { d: \"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z\", fill: \"var(--icon-compass-south-color, #C2C2CC)\" })] }) }) }) }));\n render(ui, element);\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n }\n handleCompassReset(viewport) {\n const viewId = this.viewId || viewport.id || 'default-view';\n if (viewport instanceof WebMercatorViewport) {\n const nextViewState = {\n ...viewport,\n bearing: 0,\n ...(this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {}),\n transitionDuration: this.props.transitionDuration,\n transitionInterpolator: new FlyToInterpolator()\n };\n // @ts-ignore Using private method temporary until there's a public one\n this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });\n }\n }\n}\n", "import { jsx as _jsx, jsxs as _jsxs } from \"preact/jsx-runtime\";\n/* global document */\nimport { FlyToInterpolator, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';\nimport { render } from 'preact';\nimport { ButtonGroup, GroupedIconButton } from \"./components.js\";\nexport class ZoomWidget {\n constructor(props) {\n this.id = 'zoom';\n this.placement = 'top-left';\n this.orientation = 'vertical';\n this.viewId = null;\n this.viewports = {};\n this.id = props.id || 'zoom';\n this.viewId = props.viewId || null;\n this.placement = props.placement || 'top-left';\n this.orientation = props.orientation || 'vertical';\n props.transitionDuration = props.transitionDuration || 200;\n props.zoomInLabel = props.zoomInLabel || 'Zoom In';\n props.zoomOutLabel = props.zoomOutLabel || 'Zoom Out';\n props.style = props.style || {};\n this.props = props;\n }\n onAdd({ deck }) {\n const { style, className } = this.props;\n const element = document.createElement('div');\n element.classList.add('deck-widget', 'deck-widget-zoom');\n if (className)\n element.classList.add(className);\n applyStyles(element, style);\n const ui = (_jsxs(ButtonGroup, { orientation: this.orientation, children: [_jsx(GroupedIconButton, { onClick: () => this.handleZoomIn(), label: this.props.zoomInLabel, className: \"deck-widget-zoom-in\" }), _jsx(GroupedIconButton, { onClick: () => this.handleZoomOut(), label: this.props.zoomOutLabel, className: \"deck-widget-zoom-out\" })] }));\n render(ui, element);\n this.deck = deck;\n this.element = element;\n return element;\n }\n onRemove() {\n this.deck = undefined;\n this.element = undefined;\n }\n setProps(props) {\n const oldProps = this.props;\n const el = this.element;\n if (el) {\n if (oldProps.className !== props.className) {\n if (oldProps.className)\n el.classList.remove(oldProps.className);\n if (props.className)\n el.classList.add(props.className);\n }\n if (!deepEqual(oldProps.style, props.style, 1)) {\n removeStyles(el, oldProps.style);\n applyStyles(el, props.style);\n }\n }\n Object.assign(this.props, props);\n }\n onViewportChange(viewport) {\n this.viewports[viewport.id] = viewport;\n }\n handleZoom(viewport, nextZoom) {\n const viewId = this.viewId || viewport?.id || 'default-view';\n const nextViewState = {\n ...viewport,\n zoom: nextZoom,\n transitionDuration: this.props.transitionDuration,\n transitionInterpolator: new FlyToInterpolator()\n };\n // @ts-ignore Using private method temporary until there's a public one\n this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });\n }\n handleZoomIn() {\n for (const viewport of Object.values(this.viewports)) {\n this.handleZoom(viewport, viewport.zoom + 1);\n }\n }\n handleZoomOut() {\n for (const viewport of Object.values(this.viewports)) {\n this.handleZoom(viewport, viewport.zoom - 1);\n }\n }\n}\n", "export const LightTheme = {\n '--button-background': '#fff',\n '--button-stroke': 'rgba(255, 255, 255, 0.3)',\n '--button-inner-stroke': 'unset',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25)',\n '--button-backdrop-filter': 'unset',\n '--button-icon-idle': 'rgba(97, 97, 102, 1)',\n '--button-icon-hover': 'rgba(24, 24, 26, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const DarkTheme = {\n '--button-background': 'rgba(18, 18, 20, 1)',\n '--button-stroke': 'rgba(18, 18, 20, 0.30)',\n '--button-inner-stroke': 'unset',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25)',\n '--button-backdrop-filter': 'unset',\n '--button-icon-idle': 'rgba(158, 157, 168, 1)',\n '--button-icon-hover': 'rgba(215, 214, 229, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const LightGlassTheme = {\n '--button-background': 'rgba(255, 255, 255, 0.6)',\n '--button-stroke': 'rgba(255, 255, 255, 0.3)',\n '--button-inner-stroke': '1px solid rgba(255, 255, 255, 0.6)',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset',\n '--button-backdrop-filter': 'blur(4px)',\n '--button-icon-idle': 'rgba(97, 97, 102, 1)',\n '--button-icon-hover': 'rgba(24, 24, 26, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\nexport const DarkGlassTheme = {\n '--button-background': 'rgba(18, 18, 20, 0.75)',\n '--button-stroke': 'rgba(18, 18, 20, 0.30)',\n '--button-inner-stroke': '1px solid rgba(18, 18, 20, 0.75)',\n '--button-shadow': '0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset',\n '--button-backdrop-filter': 'blur(4px)',\n '--button-icon-idle': 'rgba(158, 157, 168, 1)',\n '--button-icon-hover': 'rgba(215, 214, 229, 1)',\n '--icon-compass-north-color': '#F05C44',\n '--icon-compass-south-color': '#C2C2CC'\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA4B;AAE5B,kBAAoG;AACpG,oBAAuB;;;ACHvB,yBAA4B;AACrB,IAAM,aAAa,WAAS;AAC/B,QAAM,EAAE,WAAW,OAAO,QAAQ,IAAI;AACtC,aAAQ,mBAAAC,KAAK,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AAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,8BAA8B;AAClC;AACO,IAAM,kBAAkB;AAAA,EAC3B,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,4BAA4B;AAAA,EAC5B,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,8BAA8B;AAClC;AACO,IAAM,iBAAiB;AAAA,EAC1B,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,4BAA4B;AAAA,EAC5B,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,8BAA8B;AAClC;",
|
|
6
|
+
"names": ["import_jsx_runtime", "_jsx", "applyStyles", "_jsx", "deepEqual", "removeStyles", "import_jsx_runtime", "import_core", "import_preact", "deepEqual", "removeStyles", "applyStyles", "_jsx", "viewport", "_jsxs", "import_jsx_runtime", "import_core", "import_preact", "applyStyles", "_jsxs", "_jsx", "deepEqual", "removeStyles"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom-widget.d.ts","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoom-widget.d.ts","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAI3E,UAAU,eAAe;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAW,YAAW,MAAM,CAAC,eAAe,CAAC;IACxD,EAAE,SAAU;IACZ,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,EAAE,eAAe,CAAc;IACxC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAc;IACpD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,SAAS,EAAE;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAC,CAAM;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;gBAEb,KAAK,EAAE,eAAe;IAYlC,KAAK,CAAC,EAAC,IAAI,EAAC,EAAE;QAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;KAAC,GAAG,cAAc;IA4BhD,QAAQ;IAKR,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC;IAkBxC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ;IAInC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM;IAY/C,YAAY;IAMZ,aAAa;CAKd"}
|
package/dist/zoom-widget.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
/* global document */
|
|
3
|
-
import { FlyToInterpolator } from '@deck.gl/core';
|
|
3
|
+
import { FlyToInterpolator, _deepEqual as deepEqual, _applyStyles as applyStyles, _removeStyles as removeStyles } from '@deck.gl/core';
|
|
4
4
|
import { render } from 'preact';
|
|
5
5
|
import { ButtonGroup, GroupedIconButton } from "./components.js";
|
|
6
6
|
export class ZoomWidget {
|
|
@@ -26,9 +26,7 @@ export class ZoomWidget {
|
|
|
26
26
|
element.classList.add('deck-widget', 'deck-widget-zoom');
|
|
27
27
|
if (className)
|
|
28
28
|
element.classList.add(className);
|
|
29
|
-
|
|
30
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
|
|
31
|
-
}
|
|
29
|
+
applyStyles(element, style);
|
|
32
30
|
const ui = (_jsxs(ButtonGroup, { orientation: this.orientation, children: [_jsx(GroupedIconButton, { onClick: () => this.handleZoomIn(), label: this.props.zoomInLabel, className: "deck-widget-zoom-in" }), _jsx(GroupedIconButton, { onClick: () => this.handleZoomOut(), label: this.props.zoomOutLabel, className: "deck-widget-zoom-out" })] }));
|
|
33
31
|
render(ui, element);
|
|
34
32
|
this.deck = deck;
|
|
@@ -40,6 +38,20 @@ export class ZoomWidget {
|
|
|
40
38
|
this.element = undefined;
|
|
41
39
|
}
|
|
42
40
|
setProps(props) {
|
|
41
|
+
const oldProps = this.props;
|
|
42
|
+
const el = this.element;
|
|
43
|
+
if (el) {
|
|
44
|
+
if (oldProps.className !== props.className) {
|
|
45
|
+
if (oldProps.className)
|
|
46
|
+
el.classList.remove(oldProps.className);
|
|
47
|
+
if (props.className)
|
|
48
|
+
el.classList.add(props.className);
|
|
49
|
+
}
|
|
50
|
+
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
51
|
+
removeStyles(el, oldProps.style);
|
|
52
|
+
applyStyles(el, props.style);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
43
55
|
Object.assign(this.props, props);
|
|
44
56
|
}
|
|
45
57
|
onViewportChange(viewport) {
|
package/dist.min.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
6
|
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var we=Object.create;var H=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var De=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),We=(t,e)=>{for(var n in e)H(t,n,{get:e[n],enumerable:!0})},j=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ce(e))!Le.call(t,o)&&o!==n&&H(t,o,{get:()=>e[o],enumerable:!(i=xe(e,o))||i.enumerable});return t},C=(t,e,n)=>(j(t,e,"default"),n&&j(n,e,"default")),N=(t,e,n)=>(n=t!=null?we(Pe(t)):{},j(e||!t||!t.__esModule?H(n,"default",{value:t,enumerable:!0}):n,t)),Fe=t=>j(H({},"__esModule",{value:!0}),t);var F=De(($e,oe)=>{oe.exports=globalThis.deck});var O={};We(O,{CompassWidget:()=>G,DarkGlassTheme:()=>Ae,DarkTheme:()=>He,FullscreenWidget:()=>B,LightGlassTheme:()=>Ze,LightTheme:()=>je,ZoomWidget:()=>q});var w={},ie=N(F(),1);C(w,N(F(),1));if(!ie.Layer)throw new Error("@deck.gl/core is not found");C(O,w);var ye=N(F(),1);var R,p,_e,Se,L,re,ue,J,Ee,T={},de=[],Ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function P(t,e){for(var n in e)t[n]=e[n];return t}function pe(t){var e=t.parentNode;e&&e.removeChild(t)}function Ne(t,e,n){var i,o,s,l={};for(s in e)s=="key"?i=e[s]:s=="ref"?o=e[s]:l[s]=e[s];if(arguments.length>2&&(l.children=arguments.length>3?R.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)l[s]===void 0&&(l[s]=t.defaultProps[s]);return A(t,l,i,o,null)}function A(t,e,n,i,o){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++_e,__i:-1,__u:0};return o==null&&p.vnode!=null&&p.vnode(s),s}function S(t){return t.children}function U(t,e){this.props=t,this.context=e}function D(t,e){if(e==null)return t.__?D(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?D(t):null}function fe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return fe(t)}}function se(t){(!t.__d&&(t.__d=!0)&&L.push(t)&&!$.__r++||re!==p.debounceRendering)&&((re=p.debounceRendering)||ue)($)}function $(){var t,e,n,i,o,s,l,a,_;for(L.sort(J);t=L.shift();)t.__d&&(e=L.length,i=void 0,s=(o=(n=t).__v).__e,a=[],_=[],(l=n.__P)&&((i=P({},o)).__v=o.__v+1,p.vnode&&p.vnode(i),Y(l,i,o,n.__n,l.ownerSVGElement!==void 0,32&o.__u?[s]:null,a,s??D(o),!!(32&o.__u),_),i.__v=o.__v,i.__.__k[i.__i]=i,ge(a,i,_),i.__e!=s&&fe(i)),L.length>e&&L.sort(J));$.__r=0}function he(t,e,n,i,o,s,l,a,_,c,d){var r,g,u,m,k,v=i&&i.__k||de,f=e.length;for(n.__d=_,Te(n,e,v),_=n.__d,r=0;r<f;r++)(u=n.__k[r])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?T:v[u.__i]||T,u.__i=r,Y(t,u,g,o,s,l,a,_,c,d),m=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&ee(g.ref,null,u),d.push(u.ref,u.__c||m,u)),k==null&&m!=null&&(k=m),65536&u.__u||g.__k===u.__k?(m||g.__e!=_||(_=D(g)),_=me(u,_,t)):typeof u.type=="function"&&u.__d!==void 0?_=u.__d:m&&(_=m.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=_,n.__e=k}function Te(t,e,n){var i,o,s,l,a,_=e.length,c=n.length,d=c,r=0;for(t.__k=[],i=0;i<_;i++)l=i+r,(o=t.__k[i]=(o=e[i])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?A(null,o,null,null,null):Q(o)?A(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?A(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=t,o.__b=t.__b+1,a=Oe(o,n,l,d),o.__i=a,s=null,a!==-1&&(d--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&r--,typeof o.type!="function"&&(o.__u|=65536)):a!==l&&(a===l+1?r++:a>l?d>_-l?r+=a-l:r--:a<l?a==l-1&&(r=a-l):r=0,a!==i+r&&(o.__u|=65536))):(s=n[l])&&s.key==null&&s.__e&&!(131072&s.__u)&&(s.__e==t.__d&&(t.__d=D(s)),K(s,s,!1),n[l]=null,d--);if(d)for(i=0;i<c;i++)(s=n[i])!=null&&!(131072&s.__u)&&(s.__e==t.__d&&(t.__d=D(s)),K(s,s))}function me(t,e,n){var i,o;if(typeof t.type=="function"){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,e=me(i[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Oe(t,e,n,i){var o=t.key,s=t.type,l=n-1,a=n+1,_=e[n];if(_===null||_&&o==_.key&&s===_.type&&!(131072&_.__u))return n;if(i>(_!=null&&!(131072&_.__u)?1:0))for(;l>=0||a<e.length;){if(l>=0){if((_=e[l])&&!(131072&_.__u)&&o==_.key&&s===_.type)return l;l--}if(a<e.length){if((_=e[a])&&!(131072&_.__u)&&o==_.key&&s===_.type)return a;a++}}return-1}function le(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Ie.test(e)?n:n+"px"}function Z(t,e,n,i,o){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||le(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||le(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n.u=i.u:(n.u=Date.now(),t.addEventListener(e,s?ce:ae,s)):t.removeEventListener(e,s?ce:ae,s);else{if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function ae(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(p.event?p.event(t):t)}}function ce(t){if(this.l)return this.l[t.type+!0](p.event?p.event(t):t)}function Y(t,e,n,i,o,s,l,a,_,c){var d,r,g,u,m,k,v,f,b,x,z,I,ne,M,X,y=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(_=!!(32&n.__u),s=[a=e.__e=n.__e]),(d=p.__b)&&d(e);e:if(typeof y=="function")try{if(f=e.props,b=(d=y.contextType)&&i[d.__c],x=d?b?b.props.value:d.__:i,n.__c?v=(r=e.__c=n.__c).__=r.__E:("prototype"in y&&y.prototype.render?e.__c=r=new y(f,x):(e.__c=r=new U(f,x),r.constructor=y,r.render=Me),b&&b.sub(r),r.props=f,r.state||(r.state={}),r.context=x,r.__n=i,g=r.__d=!0,r.__h=[],r._sb=[]),r.__s==null&&(r.__s=r.state),y.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=P({},r.__s)),P(r.__s,y.getDerivedStateFromProps(f,r.__s))),u=r.props,m=r.state,r.__v=e,g)y.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(y.getDerivedStateFromProps==null&&f!==u&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(f,x),!r.__e&&(r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(f,r.__s,x)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(r.props=f,r.state=r.__s,r.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),z=0;z<r._sb.length;z++)r.__h.push(r._sb[z]);r._sb=[],r.__h.length&&l.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(f,r.__s,x),r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(u,m,k)})}if(r.context=x,r.props=f,r.__P=t,r.__e=!1,I=p.__r,ne=0,"prototype"in y&&y.prototype.render){for(r.state=r.__s,r.__d=!1,I&&I(e),d=r.render(r.props,r.state,r.context),M=0;M<r._sb.length;M++)r.__h.push(r._sb[M]);r._sb=[]}else do r.__d=!1,I&&I(e),d=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++ne<25);r.state=r.__s,r.getChildContext!=null&&(i=P(P({},i),r.getChildContext())),g||r.getSnapshotBeforeUpdate==null||(k=r.getSnapshotBeforeUpdate(u,m)),he(t,Q(X=d!=null&&d.type===S&&d.key==null?d.props.children:d)?X:[X],e,n,i,o,s,l,a,_,c),r.base=e.__e,e.__u&=-161,r.__h.length&&l.push(r),v&&(r.__E=r.__=null)}catch(V){e.__v=null,_||s!=null?(e.__e=a,e.__u|=_?160:32,s[s.indexOf(a)]=null):(e.__e=n.__e,e.__k=n.__k),p.__e(V,e,n)}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=ze(n.__e,e,n,i,o,s,l,_,c);(d=p.diffed)&&d(e)}function ge(t,e,n){e.__d=void 0;for(var i=0;i<n.length;i++)ee(n[i],n[++i],n[++i]);p.__c&&p.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(s){s.call(o)})}catch(s){p.__e(s,o.__v)}})}function ze(t,e,n,i,o,s,l,a,_){var c,d,r,g,u,m,k,v=n.props,f=e.props,b=e.type;if(b==="svg"&&(o=!0),s!=null){for(c=0;c<s.length;c++)if((u=s[c])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){t=u,s[c]=null;break}}if(t==null){if(b===null)return document.createTextNode(f);t=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,f.is&&f),s=null,a=!1}if(b===null)v===f||a&&t.data===f||(t.data=f);else{if(s=s&&R.call(t.childNodes),v=n.props||T,!a&&s!=null)for(v={},c=0;c<t.attributes.length;c++)v[(u=t.attributes[c]).name]=u.value;for(c in v)u=v[c],c=="children"||(c=="dangerouslySetInnerHTML"?r=u:c==="key"||c in f||Z(t,c,null,u,o));for(c in f)u=f[c],c=="children"?g=u:c=="dangerouslySetInnerHTML"?d=u:c=="value"?m=u:c=="checked"?k=u:c==="key"||a&&typeof u!="function"||v[c]===u||Z(t,c,u,v[c],o);if(d)a||r&&(d.__html===r.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(r&&(t.innerHTML=""),he(t,Q(g)?g:[g],e,n,i,o&&b!=="foreignObject",s,l,s?s[0]:n.__k&&D(n,0),a,_),s!=null)for(c=s.length;c--;)s[c]!=null&&pe(s[c]);a||(c="value",m!==void 0&&(m!==t[c]||b==="progress"&&!m||b==="option"&&m!==v[c])&&Z(t,c,m,v[c],!1),c="checked",k!==void 0&&k!==t[c]&&Z(t,c,k,v[c],!1))}return t}function ee(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(i){p.__e(i,n)}}function K(t,e,n){var i,o;if(p.unmount&&p.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||ee(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){p.__e(s,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&K(i[o],e,n||typeof t.type!="function");n||t.__e==null||pe(t.__e),t.__=t.__e=t.__d=void 0}function Me(t,e,n){return this.constructor(t,n)}function E(t,e,n){var i,o,s,l;p.__&&p.__(t,e),o=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],l=[],Y(e,t=(!i&&n||e).__k=Ne(S,null,[t]),o||T,T,e.ownerSVGElement!==void 0,!i&&n?[n]:o?null:e.firstChild?R.call(e.childNodes):null,s,!i&&n?n:o?o.__e:e.firstChild,i,l),ge(s,t,l)}R=de.slice,p={__e:function(t,e,n,i){for(var o,s,l;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(t)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,i||{}),l=o.__d),l)return o.__E=o}catch(a){t=a}throw t}},_e=0,Se=function(t){return t!=null&&t.constructor==null},U.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=P({},this.state),typeof t=="function"&&(t=t(P({},n),this.props)),t&&P(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),se(this))},U.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),se(this))},U.prototype.render=S,L=[],ue=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ee=0;var Ve=0,qe=Array.isArray;function h(t,e,n,i,o,s){var l,a,_={};for(a in e)a=="ref"?l=e[a]:_[a]=e[a];var c={type:t,props:_,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ve,__i:-1,__u:0,__source:o,__self:s};if(typeof t=="function"&&(l=t.defaultProps))for(a in l)_[a]===void 0&&(_[a]=l[a]);return p.vnode&&p.vnode(c),c}var ve=t=>{let{className:e,label:n,onClick:i}=t;return h("div",{className:"deck-widget-button",children:h("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:i,title:n,children:h("div",{className:"deck-widget-icon"})})})},be=t=>{let{children:e,orientation:n}=t;return h("div",{className:`deck-widget-button-group ${n}`,children:e})},te=t=>{let{className:e,label:n,onClick:i}=t;return h("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:i,title:n,children:h("div",{className:"deck-widget-icon"})})};var B=class{constructor(e){this.id="fullscreen";this.placement="top-left";this.fullscreen=!1;this.id=e.id||"fullscreen",this.placement=e.placement||"top-left",e.enterLabel=e.enterLabel||"Enter Fullscreen",e.exitLabel=e.exitLabel||"Exit Fullscreen",e.style=e.style||{},this.props=e}onAdd({deck:e}){let{style:n,className:i}=this.props,o=document.createElement("div");return o.classList.add("deck-widget","deck-widget-fullscreen"),i&&o.classList.add(i),n&&Object.entries(n).map(([s,l])=>o.style.setProperty(s,l)),this.deck=e,this.element=o,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),o}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:n}=this.props,i=this.element;if(!i)return;let o=h(ve,{onClick:this.handleClick.bind(this),label:this.fullscreen?n:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});E(o,i)}setProps(e){let n=this.props,i=this.element;i&&(n.className!==e.className&&(n.className&&i.classList.remove(n.className),e.className&&i.classList.add(e.className)),(0,ye._deepEqual)(n.style,e.style,1)||(n.style&&Object.entries(n.style).map(([o])=>i.style.removeProperty(o)),e.style&&Object.entries(e.style).map(([o,s])=>i.style.setProperty(o,s)))),Object.assign(this.props,e)}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var W=N(F(),1);var G=class{constructor(e){this.id="compass";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id||"compass",this.viewId=e.viewId||null,this.placement=e.placement||"top-left",e.transitionDuration=e.transitionDuration||200,e.label=e.label||"Compass",e.style=e.style||{},this.props=e}setProps(e){Object.assign(this.props,e)}onViewportChange(e){this.viewports[e.id]=e,this.update()}onAdd({deck:e}){let{style:n,className:i}=this.props,o=document.createElement("div");return o.classList.add("deck-widget","deck-widget-compass"),i&&o.classList.add(i),n&&Object.entries(n).map(([s,l])=>o.style.setProperty(s,l)),this.deck=e,this.element=o,this.update(),o}getRotation(e){return e instanceof W.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof W._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",n=this.viewports[e],[i,o]=this.getRotation(n),s=this.element;if(!s)return;let l=h("div",{className:"deck-widget-button",style:{perspective:100},children:h("button",{type:"button",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},label:this.props.label,style:{transform:`rotateX(${o}deg)`},children:h("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:h("g",{transform:`rotate(${i},13,13)`,children:[h("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),h("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});E(l,s)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let n=this.viewId||e.id||"default-view";if(e instanceof W.WebMercatorViewport){let i={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new W.FlyToInterpolator};this.deck._onViewStateChange({viewId:n,viewState:i,interactionState:{}})}}};var ke=N(F(),1);var q=class{constructor(e){this.id="zoom";this.placement="top-left";this.orientation="vertical";this.viewId=null;this.viewports={};this.id=e.id||"zoom",this.viewId=e.viewId||null,this.placement=e.placement||"top-left",this.orientation=e.orientation||"vertical",e.transitionDuration=e.transitionDuration||200,e.zoomInLabel=e.zoomInLabel||"Zoom In",e.zoomOutLabel=e.zoomOutLabel||"Zoom Out",e.style=e.style||{},this.props=e}onAdd({deck:e}){let{style:n,className:i}=this.props,o=document.createElement("div");o.classList.add("deck-widget","deck-widget-zoom"),i&&o.classList.add(i),n&&Object.entries(n).map(([l,a])=>o.style.setProperty(l,a));let s=h(be,{orientation:this.orientation,children:[h(te,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),h(te,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});return E(s,o),this.deck=e,this.element=o,o}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){Object.assign(this.props,e)}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,n){let i=this.viewId||e?.id||"default-view",o={...e,zoom:n,transitionDuration:this.props.transitionDuration,transitionInterpolator:new ke.FlyToInterpolator};this.deck._onViewStateChange({viewId:i,viewState:o,interactionState:{}})}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}};var je={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},He={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ze={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ae={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};return Fe(O);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var we=Object.create;var U=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var Se=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),De=(t,e)=>{for(var n in e)U(t,n,{get:e[n],enumerable:!0})},A=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ce(e))!Le.call(t,i)&&i!==n&&U(t,i,{get:()=>e[i],enumerable:!(o=xe(e,i))||o.enumerable});return t},L=(t,e,n)=>(A(t,e,"default"),n&&A(n,e,"default")),z=(t,e,n)=>(n=t!=null?we(Pe(t)):{},A(e||!t||!t.__esModule?U(n,"default",{value:t,enumerable:!0}):n,t)),Ne=t=>A(U({},"__esModule",{value:!0}),t);var E=Se(($e,se)=>{se.exports=globalThis.deck});var V={};De(V,{CompassWidget:()=>X,DarkGlassTheme:()=>Ue,DarkTheme:()=>Ze,FullscreenWidget:()=>G,LightGlassTheme:()=>Ae,LightTheme:()=>He,ZoomWidget:()=>J});var x={},re=z(E(),1);L(x,z(E(),1));if(!re.Layer)throw new Error("@deck.gl/core is not found");L(V,x);var W=z(E(),1);var B,p,de,We,D,le,pe,Q,Ee,M={},fe=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ee=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function me(t){var e=t.parentNode;e&&e.removeChild(t)}function Ie(t,e,n){var o,i,r,l={};for(r in e)r=="key"?o=e[r]:r=="ref"?i=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?B.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)l[r]===void 0&&(l[r]=t.defaultProps[r]);return $(t,l,o,i,null)}function $(t,e,n,o,i){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++de,__i:-1,__u:0};return i==null&&p.vnode!=null&&p.vnode(r),r}function F(t){return t.children}function R(t,e){this.props=t,this.context=e}function N(t,e){if(e==null)return t.__?N(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?N(t):null}function he(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return he(t)}}function ae(t){(!t.__d&&(t.__d=!0)&&D.push(t)&&!q.__r++||le!==p.debounceRendering)&&((le=p.debounceRendering)||pe)(q)}function q(){var t,e,n,o,i,r,l,a,_;for(D.sort(Q);t=D.shift();)t.__d&&(e=D.length,o=void 0,r=(i=(n=t).__v).__e,a=[],_=[],(l=n.__P)&&((o=S({},i)).__v=i.__v+1,p.vnode&&p.vnode(o),te(l,o,i,n.__n,l.ownerSVGElement!==void 0,32&i.__u?[r]:null,a,r??N(i),!!(32&i.__u),_),o.__v=i.__v,o.__.__k[o.__i]=o,be(a,o,_),o.__e!=r&&he(o)),D.length>e&&D.sort(Q));q.__r=0}function ge(t,e,n,o,i,r,l,a,_,c,d){var s,g,u,h,w,v=o&&o.__k||fe,f=e.length;for(n.__d=_,Te(n,e,v),_=n.__d,s=0;s<f;s++)(u=n.__k[s])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?M:v[u.__i]||M,u.__i=s,te(t,u,g,i,r,l,a,_,c,d),h=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&ne(g.ref,null,u),d.push(u.ref,u.__c||h,u)),w==null&&h!=null&&(w=h),65536&u.__u||g.__k===u.__k?(h||g.__e!=_||(_=N(g)),_=ve(u,_,t)):typeof u.type=="function"&&u.__d!==void 0?_=u.__d:h&&(_=h.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=_,n.__e=w}function Te(t,e,n){var o,i,r,l,a,_=e.length,c=n.length,d=c,s=0;for(t.__k=[],o=0;o<_;o++)l=o+s,(i=t.__k[o]=(i=e[o])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?$(null,i,null,null,null):ee(i)?$(F,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?$(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=ze(i,n,l,d),i.__i=a,r=null,a!==-1&&(d--,(r=n[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):a!==l&&(a===l+1?s++:a>l?d>_-l?s+=a-l:s--:a<l?a==l-1&&(s=a-l):s=0,a!==o+s&&(i.__u|=65536))):(r=n[l])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=N(r)),Y(r,r,!1),n[l]=null,d--);if(d)for(o=0;o<c;o++)(r=n[o])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=N(r)),Y(r,r))}function ve(t,e,n){var o,i;if(typeof t.type=="function"){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=ve(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function ze(t,e,n,o){var i=t.key,r=t.type,l=n-1,a=n+1,_=e[n];if(_===null||_&&i==_.key&&r===_.type&&!(131072&_.__u))return n;if(o>(_!=null&&!(131072&_.__u)?1:0))for(;l>=0||a<e.length;){if(l>=0){if((_=e[l])&&!(131072&_.__u)&&i==_.key&&r===_.type)return l;l--}if(a<e.length){if((_=e[a])&&!(131072&_.__u)&&i==_.key&&r===_.type)return a;a++}}return-1}function ce(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Fe.test(e)?n:n+"px"}function j(t,e,n,o,i){var r;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ce(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||ce(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?ue:_e,r)):t.removeEventListener(e,r?ue:_e,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function _e(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(p.event?p.event(t):t)}}function ue(t){if(this.l)return this.l[t.type+!0](p.event?p.event(t):t)}function te(t,e,n,o,i,r,l,a,_,c){var d,s,g,u,h,w,v,f,b,P,O,T,ie,H,K,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(_=!!(32&n.__u),r=[a=e.__e=n.__e]),(d=p.__b)&&d(e);e:if(typeof k=="function")try{if(f=e.props,b=(d=k.contextType)&&o[d.__c],P=d?b?b.props.value:d.__:o,n.__c?v=(s=e.__c=n.__c).__=s.__E:("prototype"in k&&k.prototype.render?e.__c=s=new k(f,P):(e.__c=s=new R(f,P),s.constructor=k,s.render=Ve),b&&b.sub(s),s.props=f,s.state||(s.state={}),s.context=P,s.__n=o,g=s.__d=!0,s.__h=[],s._sb=[]),s.__s==null&&(s.__s=s.state),k.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=S({},s.__s)),S(s.__s,k.getDerivedStateFromProps(f,s.__s))),u=s.props,h=s.state,s.__v=e,g)k.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(k.getDerivedStateFromProps==null&&f!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(f,P),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(f,s.__s,P)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(s.props=f,s.state=s.__s,s.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(Z){Z&&(Z.__=e)}),O=0;O<s._sb.length;O++)s.__h.push(s._sb[O]);s._sb=[],s.__h.length&&l.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(f,s.__s,P),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,h,w)})}if(s.context=P,s.props=f,s.__P=t,s.__e=!1,T=p.__r,ie=0,"prototype"in k&&k.prototype.render){for(s.state=s.__s,s.__d=!1,T&&T(e),d=s.render(s.props,s.state,s.context),H=0;H<s._sb.length;H++)s.__h.push(s._sb[H]);s._sb=[]}else do s.__d=!1,T&&T(e),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++ie<25);s.state=s.__s,s.getChildContext!=null&&(o=S(S({},o),s.getChildContext())),g||s.getSnapshotBeforeUpdate==null||(w=s.getSnapshotBeforeUpdate(u,h)),ge(t,ee(K=d!=null&&d.type===F&&d.key==null?d.props.children:d)?K:[K],e,n,o,i,r,l,a,_,c),s.base=e.__e,e.__u&=-161,s.__h.length&&l.push(s),v&&(s.__E=s.__=null)}catch(Z){e.__v=null,_||r!=null?(e.__e=a,e.__u|=_?160:32,r[r.indexOf(a)]=null):(e.__e=n.__e,e.__k=n.__k),p.__e(Z,e,n)}else r==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Me(n.__e,e,n,o,i,r,l,_,c);(d=p.diffed)&&d(e)}function be(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)ne(n[o],n[++o],n[++o]);p.__c&&p.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){p.__e(r,i.__v)}})}function Me(t,e,n,o,i,r,l,a,_){var c,d,s,g,u,h,w,v=n.props,f=e.props,b=e.type;if(b==="svg"&&(i=!0),r!=null){for(c=0;c<r.length;c++)if((u=r[c])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){t=u,r[c]=null;break}}if(t==null){if(b===null)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,f.is&&f),r=null,a=!1}if(b===null)v===f||a&&t.data===f||(t.data=f);else{if(r=r&&B.call(t.childNodes),v=n.props||M,!a&&r!=null)for(v={},c=0;c<t.attributes.length;c++)v[(u=t.attributes[c]).name]=u.value;for(c in v)u=v[c],c=="children"||(c=="dangerouslySetInnerHTML"?s=u:c==="key"||c in f||j(t,c,null,u,i));for(c in f)u=f[c],c=="children"?g=u:c=="dangerouslySetInnerHTML"?d=u:c=="value"?h=u:c=="checked"?w=u:c==="key"||a&&typeof u!="function"||v[c]===u||j(t,c,u,v[c],i);if(d)a||s&&(d.__html===s.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(s&&(t.innerHTML=""),ge(t,ee(g)?g:[g],e,n,o,i&&b!=="foreignObject",r,l,r?r[0]:n.__k&&N(n,0),a,_),r!=null)for(c=r.length;c--;)r[c]!=null&&me(r[c]);a||(c="value",h!==void 0&&(h!==t[c]||b==="progress"&&!h||b==="option"&&h!==v[c])&&j(t,c,h,v[c],!1),c="checked",w!==void 0&&w!==t[c]&&j(t,c,w,v[c],!1))}return t}function ne(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(o){p.__e(o,n)}}function Y(t,e,n){var o,i;if(p.unmount&&p.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||ne(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){p.__e(r,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&Y(o[i],e,n||typeof t.type!="function");n||t.__e==null||me(t.__e),t.__=t.__e=t.__d=void 0}function Ve(t,e,n){return this.constructor(t,n)}function I(t,e,n){var o,i,r,l;p.__&&p.__(t,e),i=(o=typeof n=="function")?null:n&&n.__k||e.__k,r=[],l=[],te(e,t=(!o&&n||e).__k=Ie(F,null,[t]),i||M,M,e.ownerSVGElement!==void 0,!o&&n?[n]:i?null:e.firstChild?B.call(e.childNodes):null,r,!o&&n?n:i?i.__e:e.firstChild,o,l),be(r,t,l)}B=fe.slice,p={__e:function(t,e,n,o){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,o||{}),l=i.__d),l)return i.__E=i}catch(a){t=a}throw t}},de=0,We=function(t){return t!=null&&t.constructor==null},R.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=S({},this.state),typeof t=="function"&&(t=t(S({},n),this.props)),t&&S(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ae(this))},R.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ae(this))},R.prototype.render=F,D=[],pe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Q=function(t,e){return t.__v.__b-e.__v.__b},q.__r=0,Ee=0;var Oe=0,Ge=Array.isArray;function m(t,e,n,o,i,r){var l,a,_={};for(a in e)a=="ref"?l=e[a]:_[a]=e[a];var c={type:t,props:_,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Oe,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(l=t.defaultProps))for(a in l)_[a]===void 0&&(_[a]=l[a]);return p.vnode&&p.vnode(c),c}var ye=t=>{let{className:e,label:n,onClick:o}=t;return m("div",{className:"deck-widget-button",children:m("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:n,children:m("div",{className:"deck-widget-icon"})})})},ke=t=>{let{children:e,orientation:n}=t;return m("div",{className:`deck-widget-button-group ${n}`,children:e})},oe=t=>{let{className:e,label:n,onClick:o}=t;return m("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:o,title:n,children:m("div",{className:"deck-widget-icon"})})};var G=class{constructor(e){this.id="fullscreen";this.placement="top-left";this.fullscreen=!1;this.id=e.id||"fullscreen",this.placement=e.placement||"top-left",e.enterLabel=e.enterLabel||"Enter Fullscreen",e.exitLabel=e.exitLabel||"Exit Fullscreen",e.style=e.style||{},this.props=e}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-fullscreen"),o&&i.classList.add(o),(0,W._applyStyles)(i,n),this.deck=e,this.element=i,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),i}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:n}=this.props,o=this.element;if(!o)return;let i=m(ye,{onClick:this.handleClick.bind(this),label:this.fullscreen?n:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});I(i,o)}setProps(e){let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,W._deepEqual)(n.style,e.style,1)||((0,W._removeStyles)(o,n.style),(0,W._applyStyles)(o,e.style))),Object.assign(this.props,e)}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var y=z(E(),1);var X=class{constructor(e){this.id="compass";this.placement="top-left";this.viewId=null;this.viewports={};this.id=e.id||"compass",this.viewId=e.viewId||null,this.placement=e.placement||"top-left",e.transitionDuration=e.transitionDuration||200,e.label=e.label||"Compass",e.style=e.style||{},this.props=e}setProps(e){let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,y._deepEqual)(n.style,e.style,1)||((0,y._removeStyles)(o,n.style),(0,y._applyStyles)(o,e.style))),Object.assign(this.props,e)}onViewportChange(e){this.viewports[e.id]=e,this.update()}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-compass"),o&&i.classList.add(o),(0,y._applyStyles)(i,n),this.deck=e,this.element=i,this.update(),i}getRotation(e){return e instanceof y.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof y._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",n=this.viewports[e],[o,i]=this.getRotation(n),r=this.element;if(!r)return;let l=m("div",{className:"deck-widget-button",style:{perspective:100},children:m("button",{type:"button",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},label:this.props.label,style:{transform:`rotateX(${i}deg)`},children:m("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:m("g",{transform:`rotate(${o},13,13)`,children:[m("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),m("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});I(l,r)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let n=this.viewId||e.id||"default-view";if(e instanceof y.WebMercatorViewport){let o={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new y.FlyToInterpolator};this.deck._onViewStateChange({viewId:n,viewState:o,interactionState:{}})}}};var C=z(E(),1);var J=class{constructor(e){this.id="zoom";this.placement="top-left";this.orientation="vertical";this.viewId=null;this.viewports={};this.id=e.id||"zoom",this.viewId=e.viewId||null,this.placement=e.placement||"top-left",this.orientation=e.orientation||"vertical",e.transitionDuration=e.transitionDuration||200,e.zoomInLabel=e.zoomInLabel||"Zoom In",e.zoomOutLabel=e.zoomOutLabel||"Zoom Out",e.style=e.style||{},this.props=e}onAdd({deck:e}){let{style:n,className:o}=this.props,i=document.createElement("div");i.classList.add("deck-widget","deck-widget-zoom"),o&&i.classList.add(o),(0,C._applyStyles)(i,n);let r=m(ke,{orientation:this.orientation,children:[m(oe,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),m(oe,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});return I(r,i),this.deck=e,this.element=i,i}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){let n=this.props,o=this.element;o&&(n.className!==e.className&&(n.className&&o.classList.remove(n.className),e.className&&o.classList.add(e.className)),(0,C._deepEqual)(n.style,e.style,1)||((0,C._removeStyles)(o,n.style),(0,C._applyStyles)(o,e.style))),Object.assign(this.props,e)}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,n){let o=this.viewId||e?.id||"default-view",i={...e,zoom:n,transitionDuration:this.props.transitionDuration,transitionInterpolator:new C.FlyToInterpolator};this.deck._onViewStateChange({viewId:o,viewState:i,interactionState:{}})}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}};var He={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ze={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ae={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Ue={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};return Ne(V);})();
|
|
8
8
|
return __exports__;
|
|
9
9
|
});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "UI widgets for deck.gl",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.0.40",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@deck.gl/core": "^9.0.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "fe6e4763b3dcd5b602291e7732e9d30b0a4eaec1"
|
|
51
51
|
}
|
package/src/compass-widget.tsx
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/* global document */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
FlyToInterpolator,
|
|
4
|
+
WebMercatorViewport,
|
|
5
|
+
_GlobeViewport,
|
|
6
|
+
_deepEqual as deepEqual,
|
|
7
|
+
_applyStyles as applyStyles,
|
|
8
|
+
_removeStyles as removeStyles
|
|
9
|
+
} from '@deck.gl/core';
|
|
3
10
|
import type {Deck, Viewport, Widget, WidgetPlacement} from '@deck.gl/core';
|
|
4
11
|
import {render} from 'preact';
|
|
5
12
|
|
|
@@ -48,6 +55,20 @@ export class CompassWidget implements Widget<CompassWidgetProps> {
|
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
setProps(props: Partial<CompassWidgetProps>) {
|
|
58
|
+
const oldProps = this.props;
|
|
59
|
+
const el = this.element;
|
|
60
|
+
if (el) {
|
|
61
|
+
if (oldProps.className !== props.className) {
|
|
62
|
+
if (oldProps.className) el.classList.remove(oldProps.className);
|
|
63
|
+
if (props.className) el.classList.add(props.className);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
67
|
+
removeStyles(el, oldProps.style);
|
|
68
|
+
applyStyles(el, props.style);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
51
72
|
Object.assign(this.props, props);
|
|
52
73
|
}
|
|
53
74
|
|
|
@@ -61,9 +82,7 @@ export class CompassWidget implements Widget<CompassWidgetProps> {
|
|
|
61
82
|
const element = document.createElement('div');
|
|
62
83
|
element.classList.add('deck-widget', 'deck-widget-compass');
|
|
63
84
|
if (className) element.classList.add(className);
|
|
64
|
-
|
|
65
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value as string));
|
|
66
|
-
}
|
|
85
|
+
applyStyles(element, style);
|
|
67
86
|
this.deck = deck;
|
|
68
87
|
this.element = element;
|
|
69
88
|
this.update();
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* global document */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
_deepEqual as deepEqual,
|
|
4
|
+
_applyStyles as applyStyles,
|
|
5
|
+
_removeStyles as removeStyles
|
|
6
|
+
} from '@deck.gl/core';
|
|
3
7
|
import type {Deck, Widget, WidgetPlacement} from '@deck.gl/core';
|
|
4
8
|
import {render} from 'preact';
|
|
5
9
|
import {IconButton} from './components';
|
|
@@ -55,9 +59,7 @@ export class FullscreenWidget implements Widget<FullscreenWidgetProps> {
|
|
|
55
59
|
const el = document.createElement('div');
|
|
56
60
|
el.classList.add('deck-widget', 'deck-widget-fullscreen');
|
|
57
61
|
if (className) el.classList.add(className);
|
|
58
|
-
|
|
59
|
-
Object.entries(style).map(([key, value]) => el.style.setProperty(key, value as string));
|
|
60
|
-
}
|
|
62
|
+
applyStyles(el, style);
|
|
61
63
|
this.deck = deck;
|
|
62
64
|
this.element = el;
|
|
63
65
|
this.update();
|
|
@@ -98,14 +100,8 @@ export class FullscreenWidget implements Widget<FullscreenWidgetProps> {
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
if (props.style) {
|
|
105
|
-
Object.entries(props.style).map(([key, value]) =>
|
|
106
|
-
el.style.setProperty(key, value as string)
|
|
107
|
-
);
|
|
108
|
-
}
|
|
103
|
+
removeStyles(el, oldProps.style);
|
|
104
|
+
applyStyles(el, props.style);
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
|
package/src/zoom-widget.tsx
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/* global document */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
FlyToInterpolator,
|
|
4
|
+
_deepEqual as deepEqual,
|
|
5
|
+
_applyStyles as applyStyles,
|
|
6
|
+
_removeStyles as removeStyles
|
|
7
|
+
} from '@deck.gl/core';
|
|
3
8
|
import type {Deck, Viewport, Widget, WidgetPlacement} from '@deck.gl/core';
|
|
4
9
|
import {render} from 'preact';
|
|
5
10
|
import {ButtonGroup, GroupedIconButton} from './components';
|
|
@@ -64,9 +69,7 @@ export class ZoomWidget implements Widget<ZoomWidgetProps> {
|
|
|
64
69
|
const element = document.createElement('div');
|
|
65
70
|
element.classList.add('deck-widget', 'deck-widget-zoom');
|
|
66
71
|
if (className) element.classList.add(className);
|
|
67
|
-
|
|
68
|
-
Object.entries(style).map(([key, value]) => element.style.setProperty(key, value as string));
|
|
69
|
-
}
|
|
72
|
+
applyStyles(element, style);
|
|
70
73
|
const ui = (
|
|
71
74
|
<ButtonGroup orientation={this.orientation}>
|
|
72
75
|
<GroupedIconButton
|
|
@@ -95,6 +98,20 @@ export class ZoomWidget implements Widget<ZoomWidgetProps> {
|
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
setProps(props: Partial<ZoomWidgetProps>) {
|
|
101
|
+
const oldProps = this.props;
|
|
102
|
+
const el = this.element;
|
|
103
|
+
if (el) {
|
|
104
|
+
if (oldProps.className !== props.className) {
|
|
105
|
+
if (oldProps.className) el.classList.remove(oldProps.className);
|
|
106
|
+
if (props.className) el.classList.add(props.className);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!deepEqual(oldProps.style, props.style, 1)) {
|
|
110
|
+
removeStyles(el, oldProps.style);
|
|
111
|
+
applyStyles(el, props.style);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
98
115
|
Object.assign(this.props, props);
|
|
99
116
|
}
|
|
100
117
|
|