@edugis-org/webmapx 0.1.6 → 0.1.8
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-lib/{decorate-CWgUV1hU.js → decorate-DnZTfaod.js} +6 -6
- package/dist-lib/dist-BIbq3o-p.js +213 -0
- package/dist-lib/{dist-Dm6b7XCs.js → dist-CKAaoSoW.js} +2743 -2491
- package/dist-lib/{dist-kKlmcBXq.js → dist-CWCNMXMK.js} +1 -1
- package/dist-lib/{dist-Ha9LQCut.js → dist-D-5Gmgwo.js} +1 -1
- package/dist-lib/{layer-discovery-afWzu5hY.js → layer-discovery-DFP-WHAh.js} +1 -1
- package/dist-lib/{leaflet-adapter-D9djjrKv.js → leaflet-adapter-A0rte-c7.js} +1 -1
- package/dist-lib/{maplibre-adapter-TFc3e0G9.js → maplibre-adapter-Cy6yX6o7.js} +1 -1
- package/dist-lib/ol-tilegrid-Ct4my3IN.js +24 -0
- package/dist-lib/openlayers-adapter-B8WtV1tn.js +1462 -0
- package/dist-lib/{toast-Cm28o9U6.js → toast-BsoXOdeA.js} +1 -1
- package/dist-lib/{webmapx-3d-tool-D4CTD2gB.js → webmapx-3d-tool-CLppA7mK.js} +13 -13
- package/dist-lib/{webmapx-base-tool-Dm9NAWLD.js → webmapx-base-tool-DfRa7TlD.js} +1 -1
- package/dist-lib/{webmapx-config-edit-tool-BgcSkmmg.js → webmapx-config-edit-tool-BztWspia.js} +21 -21
- package/dist-lib/{webmapx-coordinates-tool-B3cuq_hG.js → webmapx-coordinates-tool-EOqZodjr.js} +20 -20
- package/dist-lib/{webmapx-core-bundle-BDImi1RE.js → webmapx-core-bundle-CH-5vYXU.js} +607 -1519
- package/dist-lib/webmapx-draw-tool-DxQgUF1Q.js +2117 -0
- package/dist-lib/{webmapx-geolocation-tool-Rw3-Iad1.js → webmapx-geolocation-tool-DIMh2kIr.js} +26 -25
- package/dist-lib/{webmapx-import-layer-tool-DRYviHd5.js → webmapx-import-layer-tool-DMiC1TpU.js} +16 -16
- package/dist-lib/{webmapx-info-tool-BJA157cy.js → webmapx-info-tool-D-XbAU9J.js} +56 -56
- package/dist-lib/{webmapx-language-osmvector-M5y_lwOg.js → webmapx-language-osmvector-BAw9TR-M.js} +12 -11
- package/dist-lib/{webmapx-measure-tool-BXhMJFC6.js → webmapx-measure-tool-CXlg11s8.js} +34 -34
- package/dist-lib/{webmapx-modal-tool-eF6Naluv.js → webmapx-modal-tool-Cs7LRrgW.js} +3 -3
- package/dist-lib/{webmapx-plugin-tool-D2Hghf9n.js → webmapx-plugin-tool-qe2yTrWB.js} +7 -7
- package/dist-lib/{webmapx-print-tool-ob1bOsR5.js → webmapx-print-tool-DrK9sLC7.js} +27 -26
- package/dist-lib/{webmapx-search-tool-Cv8BrYvY.js → webmapx-search-tool-H7NisgWH.js} +11 -11
- package/dist-lib/webmapx-settings-EHSm-AGU.js +167 -0
- package/dist-lib/{webmapx-truearea-tool-CMB4Orm-.js → webmapx-truearea-tool-CSU9mE1D.js} +26 -26
- package/dist-lib/{webmapx-view-mode-tool-CUpLNjOj.js → webmapx-view-mode-tool-D1QyQfq8.js} +9 -9
- package/dist-lib/webmapx.css +1 -1
- package/dist-lib/webmapx.js +22 -21
- package/package.json +1 -1
- package/dist-lib/WMTS-DCN4zX0-.js +0 -1169
- package/dist-lib/alert-GeHlqlN8.js +0 -310
- package/dist-lib/button-DFdGkRPQ.js +0 -741
- package/dist-lib/checkbox-QoR4S8tV.js +0 -284
- package/dist-lib/chunk.36O46B5H-B6ZL7Sm1.js +0 -77
- package/dist-lib/chunk.3RPBFEDE-BFO1fHVm.js +0 -138
- package/dist-lib/chunk.5JY5FUCG-DTXsslmx.js +0 -1090
- package/dist-lib/chunk.6CTB5ZDJ-DjZrBd6Y.js +0 -99
- package/dist-lib/chunk.AJ3ENQ5C-Ci7Gm2b6.js +0 -175
- package/dist-lib/chunk.LD4M4QGE-CiCfhE8r.js +0 -8
- package/dist-lib/chunk.NYIIDP5N-BikXIStD.js +0 -99
- package/dist-lib/chunk.RWUUFNUL-DFztA4uV.js +0 -43
- package/dist-lib/chunk.SI4ACBFK-CLb9VfMG.js +0 -61
- package/dist-lib/chunk.YHLNUJ7P-D-kanrCf.js +0 -503
- package/dist-lib/decorators-B35AgiCU.js +0 -351
- package/dist-lib/dist-c1PlDAd1.js +0 -2359
- package/dist-lib/divider-CPm675yY.js +0 -41
- package/dist-lib/icon-CEOgWlro.js +0 -9
- package/dist-lib/icon-button-Da_nBTy3.js +0 -408
- package/dist-lib/input-CeGntPlT.js +0 -590
- package/dist-lib/ol-tilegrid-9VtyxaLG.js +0 -64
- package/dist-lib/openlayers-adapter-DVW1KCRv.js +0 -13307
- package/dist-lib/option-CBxl1mZP.js +0 -1106
- package/dist-lib/rbush-C8k41T4z.js +0 -254
- package/dist-lib/spinner-DysxdNG9.js +0 -6
- package/dist-lib/tooltip-Cucn1SiD.js +0 -197
- package/dist-lib/webmapx-draw-tool-DooAV8cF.js +0 -4336
- package/dist-lib/webmapx-settings-DDEJ8aoV.js +0 -479
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
import { c as e, d as t, l as n, r, s as i, t as a, u as o } from "./decorate-CWgUV1hU.js";
|
|
2
|
-
import { a as s, i as c, n as l, o as u } from "./decorators-B35AgiCU.js";
|
|
3
|
-
import { d, f, l as p, u as m } from "./chunk.YHLNUJ7P-D-kanrCf.js";
|
|
4
|
-
import { a as h, n as g, t as _ } from "./chunk.NYIIDP5N-BikXIStD.js";
|
|
5
|
-
import { t as v } from "./chunk.3RPBFEDE-BFO1fHVm.js";
|
|
6
|
-
import { n as y, r as b } from "./input-CeGntPlT.js";
|
|
7
|
-
import { t as x } from "./chunk.SI4ACBFK-CLb9VfMG.js";
|
|
8
|
-
import "./divider-CPm675yY.js";
|
|
9
|
-
import "./option-CBxl1mZP.js";
|
|
10
|
-
import { LitElement as S, css as C, html as w } from "lit";
|
|
11
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EU44RQUN.js
|
|
12
|
-
var T = C`
|
|
13
|
-
:host {
|
|
14
|
-
display: inline-block;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([size='small']) {
|
|
18
|
-
--height: var(--sl-toggle-size-small);
|
|
19
|
-
--thumb-size: calc(var(--sl-toggle-size-small) + 4px);
|
|
20
|
-
--width: calc(var(--height) * 2);
|
|
21
|
-
|
|
22
|
-
font-size: var(--sl-input-font-size-small);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
:host([size='medium']) {
|
|
26
|
-
--height: var(--sl-toggle-size-medium);
|
|
27
|
-
--thumb-size: calc(var(--sl-toggle-size-medium) + 4px);
|
|
28
|
-
--width: calc(var(--height) * 2);
|
|
29
|
-
|
|
30
|
-
font-size: var(--sl-input-font-size-medium);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([size='large']) {
|
|
34
|
-
--height: var(--sl-toggle-size-large);
|
|
35
|
-
--thumb-size: calc(var(--sl-toggle-size-large) + 4px);
|
|
36
|
-
--width: calc(var(--height) * 2);
|
|
37
|
-
|
|
38
|
-
font-size: var(--sl-input-font-size-large);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.switch {
|
|
42
|
-
position: relative;
|
|
43
|
-
display: inline-flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
font-family: var(--sl-input-font-family);
|
|
46
|
-
font-size: inherit;
|
|
47
|
-
font-weight: var(--sl-input-font-weight);
|
|
48
|
-
color: var(--sl-input-label-color);
|
|
49
|
-
vertical-align: middle;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.switch__control {
|
|
54
|
-
flex: 0 0 auto;
|
|
55
|
-
position: relative;
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
width: var(--width);
|
|
60
|
-
height: var(--height);
|
|
61
|
-
background-color: var(--sl-color-neutral-400);
|
|
62
|
-
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
|
63
|
-
border-radius: var(--height);
|
|
64
|
-
transition:
|
|
65
|
-
var(--sl-transition-fast) border-color,
|
|
66
|
-
var(--sl-transition-fast) background-color;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.switch__control .switch__thumb {
|
|
70
|
-
width: var(--thumb-size);
|
|
71
|
-
height: var(--thumb-size);
|
|
72
|
-
background-color: var(--sl-color-neutral-0);
|
|
73
|
-
border-radius: 50%;
|
|
74
|
-
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
|
75
|
-
translate: calc((var(--width) - var(--height)) / -2);
|
|
76
|
-
transition:
|
|
77
|
-
var(--sl-transition-fast) translate ease,
|
|
78
|
-
var(--sl-transition-fast) background-color,
|
|
79
|
-
var(--sl-transition-fast) border-color,
|
|
80
|
-
var(--sl-transition-fast) box-shadow;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.switch__input {
|
|
84
|
-
position: absolute;
|
|
85
|
-
opacity: 0;
|
|
86
|
-
padding: 0;
|
|
87
|
-
margin: 0;
|
|
88
|
-
pointer-events: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* Hover */
|
|
92
|
-
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
|
|
93
|
-
background-color: var(--sl-color-neutral-400);
|
|
94
|
-
border-color: var(--sl-color-neutral-400);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
98
|
-
background-color: var(--sl-color-neutral-0);
|
|
99
|
-
border-color: var(--sl-color-neutral-400);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Focus */
|
|
103
|
-
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
104
|
-
background-color: var(--sl-color-neutral-400);
|
|
105
|
-
border-color: var(--sl-color-neutral-400);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
109
|
-
background-color: var(--sl-color-neutral-0);
|
|
110
|
-
border-color: var(--sl-color-primary-600);
|
|
111
|
-
outline: var(--sl-focus-ring);
|
|
112
|
-
outline-offset: var(--sl-focus-ring-offset);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* Checked */
|
|
116
|
-
.switch--checked .switch__control {
|
|
117
|
-
background-color: var(--sl-color-primary-600);
|
|
118
|
-
border-color: var(--sl-color-primary-600);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.switch--checked .switch__control .switch__thumb {
|
|
122
|
-
background-color: var(--sl-color-neutral-0);
|
|
123
|
-
border-color: var(--sl-color-primary-600);
|
|
124
|
-
translate: calc((var(--width) - var(--height)) / 2);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* Checked + hover */
|
|
128
|
-
.switch.switch--checked:not(.switch--disabled) .switch__control:hover {
|
|
129
|
-
background-color: var(--sl-color-primary-600);
|
|
130
|
-
border-color: var(--sl-color-primary-600);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
134
|
-
background-color: var(--sl-color-neutral-0);
|
|
135
|
-
border-color: var(--sl-color-primary-600);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* Checked + focus */
|
|
139
|
-
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
140
|
-
background-color: var(--sl-color-primary-600);
|
|
141
|
-
border-color: var(--sl-color-primary-600);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
145
|
-
background-color: var(--sl-color-neutral-0);
|
|
146
|
-
border-color: var(--sl-color-primary-600);
|
|
147
|
-
outline: var(--sl-focus-ring);
|
|
148
|
-
outline-offset: var(--sl-focus-ring-offset);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/* Disabled */
|
|
152
|
-
.switch--disabled {
|
|
153
|
-
opacity: 0.5;
|
|
154
|
-
cursor: not-allowed;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.switch__label {
|
|
158
|
-
display: inline-block;
|
|
159
|
-
line-height: var(--height);
|
|
160
|
-
margin-inline-start: 0.5em;
|
|
161
|
-
user-select: none;
|
|
162
|
-
-webkit-user-select: none;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
:host([required]) .switch__label::after {
|
|
166
|
-
content: var(--sl-input-required-content);
|
|
167
|
-
color: var(--sl-input-required-content-color);
|
|
168
|
-
margin-inline-start: var(--sl-input-required-content-offset);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@media (forced-colors: active) {
|
|
172
|
-
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,
|
|
173
|
-
.switch--checked .switch__control .switch__thumb {
|
|
174
|
-
background-color: ButtonText;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
`, E = class extends p {
|
|
178
|
-
constructor() {
|
|
179
|
-
super(...arguments), this.formControlController = new v(this, {
|
|
180
|
-
value: (e) => e.checked ? e.value || "on" : void 0,
|
|
181
|
-
defaultValue: (e) => e.defaultChecked,
|
|
182
|
-
setValue: (e, t) => e.checked = t
|
|
183
|
-
}), this.hasSlotController = new _(this, "help-text"), this.hasFocus = !1, this.title = "", this.name = "", this.size = "medium", this.disabled = !1, this.checked = !1, this.defaultChecked = !1, this.form = "", this.required = !1, this.helpText = "";
|
|
184
|
-
}
|
|
185
|
-
get validity() {
|
|
186
|
-
return this.input.validity;
|
|
187
|
-
}
|
|
188
|
-
get validationMessage() {
|
|
189
|
-
return this.input.validationMessage;
|
|
190
|
-
}
|
|
191
|
-
firstUpdated() {
|
|
192
|
-
this.formControlController.updateValidity();
|
|
193
|
-
}
|
|
194
|
-
handleBlur() {
|
|
195
|
-
this.hasFocus = !1, this.emit("sl-blur");
|
|
196
|
-
}
|
|
197
|
-
handleInput() {
|
|
198
|
-
this.emit("sl-input");
|
|
199
|
-
}
|
|
200
|
-
handleInvalid(e) {
|
|
201
|
-
this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(e);
|
|
202
|
-
}
|
|
203
|
-
handleClick() {
|
|
204
|
-
this.checked = !this.checked, this.emit("sl-change");
|
|
205
|
-
}
|
|
206
|
-
handleFocus() {
|
|
207
|
-
this.hasFocus = !0, this.emit("sl-focus");
|
|
208
|
-
}
|
|
209
|
-
handleKeyDown(e) {
|
|
210
|
-
e.key === "ArrowLeft" && (e.preventDefault(), this.checked = !1, this.emit("sl-change"), this.emit("sl-input")), e.key === "ArrowRight" && (e.preventDefault(), this.checked = !0, this.emit("sl-change"), this.emit("sl-input"));
|
|
211
|
-
}
|
|
212
|
-
handleCheckedChange() {
|
|
213
|
-
this.input.checked = this.checked, this.formControlController.updateValidity();
|
|
214
|
-
}
|
|
215
|
-
handleDisabledChange() {
|
|
216
|
-
this.formControlController.setValidity(!0);
|
|
217
|
-
}
|
|
218
|
-
click() {
|
|
219
|
-
this.input.click();
|
|
220
|
-
}
|
|
221
|
-
focus(e) {
|
|
222
|
-
this.input.focus(e);
|
|
223
|
-
}
|
|
224
|
-
blur() {
|
|
225
|
-
this.input.blur();
|
|
226
|
-
}
|
|
227
|
-
checkValidity() {
|
|
228
|
-
return this.input.checkValidity();
|
|
229
|
-
}
|
|
230
|
-
getForm() {
|
|
231
|
-
return this.formControlController.getForm();
|
|
232
|
-
}
|
|
233
|
-
reportValidity() {
|
|
234
|
-
return this.input.reportValidity();
|
|
235
|
-
}
|
|
236
|
-
setCustomValidity(e) {
|
|
237
|
-
this.input.setCustomValidity(e), this.formControlController.updateValidity();
|
|
238
|
-
}
|
|
239
|
-
render() {
|
|
240
|
-
let e = this.hasSlotController.test("help-text"), t = this.helpText ? !0 : !!e;
|
|
241
|
-
return w`
|
|
242
|
-
<div
|
|
243
|
-
class=${h({
|
|
244
|
-
"form-control": !0,
|
|
245
|
-
"form-control--small": this.size === "small",
|
|
246
|
-
"form-control--medium": this.size === "medium",
|
|
247
|
-
"form-control--large": this.size === "large",
|
|
248
|
-
"form-control--has-help-text": t
|
|
249
|
-
})}
|
|
250
|
-
>
|
|
251
|
-
<label
|
|
252
|
-
part="base"
|
|
253
|
-
class=${h({
|
|
254
|
-
switch: !0,
|
|
255
|
-
"switch--checked": this.checked,
|
|
256
|
-
"switch--disabled": this.disabled,
|
|
257
|
-
"switch--focused": this.hasFocus,
|
|
258
|
-
"switch--small": this.size === "small",
|
|
259
|
-
"switch--medium": this.size === "medium",
|
|
260
|
-
"switch--large": this.size === "large"
|
|
261
|
-
})}
|
|
262
|
-
>
|
|
263
|
-
<input
|
|
264
|
-
class="switch__input"
|
|
265
|
-
type="checkbox"
|
|
266
|
-
title=${this.title}
|
|
267
|
-
name=${this.name}
|
|
268
|
-
value=${g(this.value)}
|
|
269
|
-
.checked=${y(this.checked)}
|
|
270
|
-
.disabled=${this.disabled}
|
|
271
|
-
.required=${this.required}
|
|
272
|
-
role="switch"
|
|
273
|
-
aria-checked=${this.checked ? "true" : "false"}
|
|
274
|
-
aria-describedby="help-text"
|
|
275
|
-
@click=${this.handleClick}
|
|
276
|
-
@input=${this.handleInput}
|
|
277
|
-
@invalid=${this.handleInvalid}
|
|
278
|
-
@blur=${this.handleBlur}
|
|
279
|
-
@focus=${this.handleFocus}
|
|
280
|
-
@keydown=${this.handleKeyDown}
|
|
281
|
-
/>
|
|
282
|
-
|
|
283
|
-
<span part="control" class="switch__control">
|
|
284
|
-
<span part="thumb" class="switch__thumb"></span>
|
|
285
|
-
</span>
|
|
286
|
-
|
|
287
|
-
<div part="label" class="switch__label">
|
|
288
|
-
<slot></slot>
|
|
289
|
-
</div>
|
|
290
|
-
</label>
|
|
291
|
-
|
|
292
|
-
<div
|
|
293
|
-
aria-hidden=${t ? "false" : "true"}
|
|
294
|
-
class="form-control__help-text"
|
|
295
|
-
id="help-text"
|
|
296
|
-
part="form-control-help-text"
|
|
297
|
-
>
|
|
298
|
-
<slot name="help-text">${this.helpText}</slot>
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
`;
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
//#endregion
|
|
305
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IADS735N.js
|
|
306
|
-
E.styles = [
|
|
307
|
-
m,
|
|
308
|
-
x,
|
|
309
|
-
T
|
|
310
|
-
], f([l("input[type=\"checkbox\"]")], E.prototype, "input", 2), f([c()], E.prototype, "hasFocus", 2), f([s()], E.prototype, "title", 2), f([s()], E.prototype, "name", 2), f([s()], E.prototype, "value", 2), f([s({ reflect: !0 })], E.prototype, "size", 2), f([s({
|
|
311
|
-
type: Boolean,
|
|
312
|
-
reflect: !0
|
|
313
|
-
})], E.prototype, "disabled", 2), f([s({
|
|
314
|
-
type: Boolean,
|
|
315
|
-
reflect: !0
|
|
316
|
-
})], E.prototype, "checked", 2), f([b("checked")], E.prototype, "defaultChecked", 2), f([s({ reflect: !0 })], E.prototype, "form", 2), f([s({
|
|
317
|
-
type: Boolean,
|
|
318
|
-
reflect: !0
|
|
319
|
-
})], E.prototype, "required", 2), f([s({ attribute: "help-text" })], E.prototype, "helpText", 2), f([d("checked", { waitUntilFirstUpdate: !0 })], E.prototype, "handleCheckedChange", 1), f([d("disabled", { waitUntilFirstUpdate: !0 })], E.prototype, "handleDisabledChange", 1), E.define("sl-switch");
|
|
320
|
-
//#endregion
|
|
321
|
-
//#region src/components/webmapx-settings.ts
|
|
322
|
-
var D = class extends S {
|
|
323
|
-
constructor(...e) {
|
|
324
|
-
super(...e), this.darkMode = !1, this.apiKey = "", this.currentAdapter = o, this.availableAdapters = [];
|
|
325
|
-
}
|
|
326
|
-
static {
|
|
327
|
-
this.styles = C`
|
|
328
|
-
:host {
|
|
329
|
-
display: block;
|
|
330
|
-
padding: 1rem;
|
|
331
|
-
box-sizing: border-box;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.setting-group {
|
|
335
|
-
margin-bottom: 1.5rem;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.setting-group:last-child {
|
|
339
|
-
margin-bottom: 0;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
h4 {
|
|
343
|
-
margin: 0 0 0.75rem 0;
|
|
344
|
-
font-size: 0.875rem;
|
|
345
|
-
font-weight: 600;
|
|
346
|
-
color: var(--color-text-secondary, #666);
|
|
347
|
-
text-transform: uppercase;
|
|
348
|
-
letter-spacing: 0.05em;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
sl-switch {
|
|
352
|
-
--sl-toggle-size-medium: 1.25rem;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
sl-input {
|
|
356
|
-
margin-top: 0.5rem;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
sl-select {
|
|
360
|
-
margin-top: 0.5rem;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
sl-select::part(combobox) {
|
|
364
|
-
min-height: 2.5rem;
|
|
365
|
-
}
|
|
366
|
-
`;
|
|
367
|
-
}
|
|
368
|
-
connectedCallback() {
|
|
369
|
-
super.connectedCallback(), this.loadSettings();
|
|
370
|
-
}
|
|
371
|
-
loadSettings() {
|
|
372
|
-
let e = localStorage.getItem("webmapx-theme");
|
|
373
|
-
e ? this.darkMode = e === "dark" : this.darkMode = window.matchMedia("(prefers-color-scheme: dark)").matches, this.applyTheme(), this.apiKey = localStorage.getItem("webmapx-api-key") || "", this.availableAdapters = t().filter((e) => ![
|
|
374
|
-
"ol",
|
|
375
|
-
"l",
|
|
376
|
-
"c"
|
|
377
|
-
].includes(e)), this.currentAdapter = this.detectCurrentAdapter();
|
|
378
|
-
}
|
|
379
|
-
getMapStorageKey(e, t) {
|
|
380
|
-
return i(e.id, t);
|
|
381
|
-
}
|
|
382
|
-
detectCurrentAdapter() {
|
|
383
|
-
let e = r(this);
|
|
384
|
-
if (!e) return o;
|
|
385
|
-
let t = this.getMapStorageKey(e, "adapter"), i = n({
|
|
386
|
-
explicitAdapter: e.getAttribute("adapter") ?? e.getAttribute("type"),
|
|
387
|
-
savedAdapter: t ? localStorage.getItem(t) : null,
|
|
388
|
-
configuredAdapter: e.mapConfig?.type ?? null,
|
|
389
|
-
defaultAdapter: o
|
|
390
|
-
});
|
|
391
|
-
return this.availableAdapters.includes(i) ? i : o;
|
|
392
|
-
}
|
|
393
|
-
applyTheme() {
|
|
394
|
-
let e = document.documentElement;
|
|
395
|
-
this.darkMode ? (e.setAttribute("data-theme", "dark"), e.classList.add("sl-theme-dark")) : (e.removeAttribute("data-theme"), e.classList.remove("sl-theme-dark")), localStorage.setItem("webmapx-theme", this.darkMode ? "dark" : "light");
|
|
396
|
-
}
|
|
397
|
-
handleThemeChange(e) {
|
|
398
|
-
let t = e.target;
|
|
399
|
-
this.darkMode = t.checked, this.applyTheme(), this.dispatchEvent(new CustomEvent("theme-change", {
|
|
400
|
-
detail: { theme: this.darkMode ? "dark" : "light" },
|
|
401
|
-
bubbles: !0,
|
|
402
|
-
composed: !0
|
|
403
|
-
}));
|
|
404
|
-
}
|
|
405
|
-
handleApiKeyChange(e) {
|
|
406
|
-
let t = e.target;
|
|
407
|
-
this.apiKey = t.value, localStorage.setItem("webmapx-api-key", this.apiKey), this.dispatchEvent(new CustomEvent("apikey-change", {
|
|
408
|
-
detail: { apiKey: this.apiKey },
|
|
409
|
-
bubbles: !0,
|
|
410
|
-
composed: !0
|
|
411
|
-
}));
|
|
412
|
-
}
|
|
413
|
-
handleAdapterChange(t) {
|
|
414
|
-
let n = t.target, i = e(n.value);
|
|
415
|
-
if (!i || i === this.currentAdapter) return;
|
|
416
|
-
let a = r(this);
|
|
417
|
-
if (!a) {
|
|
418
|
-
console.error("[webmapx-settings] No <webmapx-map> found for adapter switching.");
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
let o = this.getMapStorageKey(a, "adapter");
|
|
422
|
-
a.saveState?.(), o && localStorage.setItem(o, i), window.location.reload();
|
|
423
|
-
}
|
|
424
|
-
formatAdapterName(e) {
|
|
425
|
-
return {
|
|
426
|
-
maplibre: "MapLibre GL",
|
|
427
|
-
openlayers: "OpenLayers",
|
|
428
|
-
leaflet: "Leaflet",
|
|
429
|
-
cesium: "Cesium"
|
|
430
|
-
}[e] || e;
|
|
431
|
-
}
|
|
432
|
-
render() {
|
|
433
|
-
return w`
|
|
434
|
-
<div class="setting-group">
|
|
435
|
-
<h4>Map Engine</h4>
|
|
436
|
-
<sl-select
|
|
437
|
-
label="Adapter"
|
|
438
|
-
value=${this.currentAdapter}
|
|
439
|
-
@sl-change=${this.handleAdapterChange}
|
|
440
|
-
>
|
|
441
|
-
${this.availableAdapters.map((e) => w`
|
|
442
|
-
<sl-option value=${e}>
|
|
443
|
-
${this.formatAdapterName(e)}
|
|
444
|
-
</sl-option>
|
|
445
|
-
`)}
|
|
446
|
-
</sl-select>
|
|
447
|
-
</div>
|
|
448
|
-
|
|
449
|
-
<sl-divider></sl-divider>
|
|
450
|
-
|
|
451
|
-
<div class="setting-group">
|
|
452
|
-
<h4>Appearance</h4>
|
|
453
|
-
<sl-switch
|
|
454
|
-
?checked=${this.darkMode}
|
|
455
|
-
@sl-change=${this.handleThemeChange}
|
|
456
|
-
>
|
|
457
|
-
Dark Mode
|
|
458
|
-
</sl-switch>
|
|
459
|
-
</div>
|
|
460
|
-
|
|
461
|
-
<sl-divider></sl-divider>
|
|
462
|
-
|
|
463
|
-
<div class="setting-group">
|
|
464
|
-
<h4>API Configuration</h4>
|
|
465
|
-
<sl-input
|
|
466
|
-
label="API Key"
|
|
467
|
-
type="password"
|
|
468
|
-
password-toggle
|
|
469
|
-
value=${this.apiKey}
|
|
470
|
-
@sl-input=${this.handleApiKeyChange}
|
|
471
|
-
placeholder="Enter your API key"
|
|
472
|
-
></sl-input>
|
|
473
|
-
</div>
|
|
474
|
-
`;
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
a([c()], D.prototype, "darkMode", void 0), a([c()], D.prototype, "apiKey", void 0), a([c()], D.prototype, "currentAdapter", void 0), a([c()], D.prototype, "availableAdapters", void 0), D = a([u("webmapx-settings")], D);
|
|
478
|
-
//#endregion
|
|
479
|
-
export { D as WebmapxSettings };
|