@delta10/atlas-sdk 0.2.0 → 0.2.1

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.
@@ -0,0 +1,559 @@
1
+ import { defineComponent as Oe, ref as c, shallowRef as ie, computed as b, onMounted as ze, openBlock as l, createElementBlock as L, createVNode as g, unref as r, withCtx as k, createBlock as f, normalizeStyle as xe, createCommentVNode as d, Fragment as K, renderList as se, createElementVNode as m, toDisplayString as Pe, normalizeClass as re, Transition as le } from "vue";
2
+ import { OlMap as Be, OlProjectionRegister as Ae, OlView as We, OlFeature as je, OlOverlay as Re } from "vue3-openlayers/map";
3
+ import { OlTileLayer as ae, OlVectorLayer as Ve } from "vue3-openlayers/layers";
4
+ import { OlSourceVector as Ze } from "vue3-openlayers/sources";
5
+ import { OlGeomPoint as $e, OlGeomPolygon as Ge } from "vue3-openlayers/geometries";
6
+ import { OlStyle as Ne } from "vue3-openlayers/styles";
7
+ import { OlInteractionSelect as De, OlInteractionModify as Ue, OlInteractionSnap as Ke } from "vue3-openlayers/interactions";
8
+ import { epsg28992 as j } from "../utils/projections.js";
9
+ import Ye, { optionsFromCapabilities as qe } from "ol/source/WMTS";
10
+ import He from "ol/format/WMTSCapabilities";
11
+ import Je from "ol/source/TileWMS";
12
+ import { Style as Y, Fill as q, Stroke as H, Circle as Qe, Text as Xe } from "ol/style";
13
+ import { boundingExtent as Ee } from "ol/extent";
14
+ import { unByKey as et } from "ol/Observable";
15
+ import { Collection as tt } from "ol";
16
+ import "ol/geom";
17
+ import ot from "../assets/icons/map.svg.js";
18
+ import nt from "../assets/icons/layers.svg.js";
19
+ import it from "../assets/icons/plus.svg.js";
20
+ import st from "../assets/icons/minus.svg.js";
21
+ import rt from "./panels/BaseLayers.vue.js";
22
+ import lt from "./panels/Layers.vue.js";
23
+ const at = { class: "map-container" }, ct = { class: "modify-overlay" }, ut = {
24
+ key: 0,
25
+ class: "modify-overlay-label"
26
+ }, ft = { class: "bottom-left-panels" }, dt = {
27
+ key: 0,
28
+ class: "layers-control"
29
+ }, pt = ["aria-expanded"], mt = { class: "bottom-right-panels" }, yt = {
30
+ key: 0,
31
+ class: "base-layers-control"
32
+ }, vt = ["aria-expanded"], gt = { class: "zoom-panel" }, Zt = /* @__PURE__ */ Oe({
33
+ __name: "Map",
34
+ props: {
35
+ layers: { default: () => [] },
36
+ baseLayers: { default: () => [] },
37
+ toggleableLayers: { default: () => [] },
38
+ interactions: {},
39
+ zoom: { default: 10 },
40
+ center: { default: () => [12e4, 487e3] }
41
+ },
42
+ emits: ["featureSelected", "featureDeselected", "featureModified", "mapClicked", "modifyCancelled"],
43
+ setup(S, { expose: ce, emit: ue }) {
44
+ const i = S, x = ue, P = c(), w = c(), J = c(), fe = c({}), R = c({}), F = c(!1), I = c(!1), _ = c(null), O = c(/* @__PURE__ */ new Set()), V = c(!1), z = c(null), h = c(null), M = c(null), B = c(null), A = c(null), C = ie(new tt([])), Z = b(() => C.value), Q = b(() => {
45
+ const e = i.interactions?.modify?.labelProperty;
46
+ if (!e || !M.value) return "";
47
+ const t = M.value.get?.(e);
48
+ return t == null ? "" : String(t);
49
+ }), T = ie(
50
+ new globalThis.Map()
51
+ ), X = new globalThis.Map(), E = /* @__PURE__ */ new WeakMap(), $ = (e, t) => {
52
+ if (!e || !t) return null;
53
+ const o = `${e}|${t}`, n = X.get(o);
54
+ if (n) return n;
55
+ const s = new Je({
56
+ url: e,
57
+ params: { LAYERS: t, TILED: !0 },
58
+ serverType: "geoserver",
59
+ crossOrigin: "anonymous"
60
+ });
61
+ return X.set(o, s), s;
62
+ }, G = (e) => {
63
+ if (!e) return null;
64
+ const t = E.get(e);
65
+ if (t) return t;
66
+ const o = new Ye({
67
+ ...e,
68
+ style: e.style || "default"
69
+ });
70
+ return E.set(e, o), o;
71
+ }, N = (e, t) => {
72
+ const o = new globalThis.Map(T.value);
73
+ o.set(e, t), T.value = o;
74
+ }, ee = (e, t, o, n) => {
75
+ if (!e) return;
76
+ if (e instanceof Y || typeof e == "function")
77
+ return e;
78
+ const s = {}, a = (p) => {
79
+ if (Array.isArray(p)) {
80
+ const [y, ...u] = p;
81
+ switch (y) {
82
+ case "get":
83
+ return t?.getProperties()?.[u[0]] ?? null;
84
+ case "case":
85
+ for (let v = 0; v < u.length - 1; v += 2)
86
+ if (a(u[v]))
87
+ return a(u[v + 1]);
88
+ return a(u[u.length - 1]);
89
+ case "==":
90
+ return a(u[0]) === a(u[1]);
91
+ case "coalesce":
92
+ for (const v of u) {
93
+ const U = a(v);
94
+ if (U != null) return U;
95
+ }
96
+ return null;
97
+ default:
98
+ return p;
99
+ }
100
+ }
101
+ return p;
102
+ };
103
+ if (e["fill-color"] && (s.fill = new q({ color: a(e["fill-color"]) })), (e["stroke-color"] || e["stroke-width"]) && (s.stroke = new H({
104
+ color: a(e["stroke-color"]) || "#3399CC",
105
+ width: a(e["stroke-width"]) || 1.25
106
+ })), e["circle-radius"] || e["circle-fill-color"] || e["circle-stroke-color"]) {
107
+ const p = a(e["circle-radius"]) || 5, y = a(e["circle-fill-color"]), u = a(e["circle-stroke-color"]) || "#3399CC", v = a(e["circle-stroke-width"]) || 1.25;
108
+ s.image = new Qe({
109
+ radius: p,
110
+ fill: y ? new q({ color: y }) : void 0,
111
+ stroke: new H({ color: u, width: v })
112
+ });
113
+ }
114
+ if (e["text-value"]) {
115
+ const p = a(e["text-value"]);
116
+ p && (s.text = new Xe({
117
+ text: String(p),
118
+ fill: new q({ color: "#000" }),
119
+ stroke: new H({ color: "#fff", width: 2 })
120
+ }));
121
+ }
122
+ return new Y(s);
123
+ }, de = (e) => typeof e == "function" ? e : e instanceof Y ? (t, o, n) => [e] : (t, o, n) => {
124
+ const s = ee(e, t);
125
+ return s ? [s] : void 0;
126
+ }, pe = b(() => i.layers.map((e) => {
127
+ if (e.type === "wmts") {
128
+ const t = T.value.get(e.options.identifier);
129
+ return {
130
+ type: "wmts",
131
+ identifier: e.options.identifier,
132
+ options: t || null,
133
+ source: G(t)
134
+ };
135
+ } else return e.type === "wms" ? {
136
+ type: "wms",
137
+ identifier: e.options.identifier,
138
+ wmsUrl: e.options.url,
139
+ layerName: e.options.layer,
140
+ source: $(e.options.url, e.options.layer)
141
+ } : {
142
+ type: "vector",
143
+ identifier: e.options.identifier,
144
+ options: e.options,
145
+ style: e.options.style,
146
+ styleFunction: e.options.styleFunction
147
+ };
148
+ })), W = b(() => {
149
+ if (!_.value || !i.baseLayers)
150
+ return null;
151
+ const e = i.baseLayers.find(
152
+ (t) => t.options.identifier === _.value
153
+ );
154
+ return !e || e.type === "wmts" && !T.value.get(e.options.identifier) ? null : e;
155
+ }), te = b(() => W.value && T.value.get(W.value.options.identifier) || null), me = b(() => (i.toggleableLayers || []).filter(
156
+ (e) => O.value.has(e.options.identifier)
157
+ ).map((e) => {
158
+ if (e.type === "wms")
159
+ return {
160
+ type: "wms",
161
+ identifier: e.options.identifier,
162
+ wmsUrl: e.options.url,
163
+ layerName: e.options.layer,
164
+ source: $(e.options.url, e.options.layer)
165
+ };
166
+ if (e.type === "wmts") {
167
+ const t = T.value.get(e.options.identifier);
168
+ return {
169
+ type: "wmts",
170
+ identifier: e.options.identifier,
171
+ wmtsOptions: t,
172
+ source: G(t)
173
+ };
174
+ } else if (e.type === "vector")
175
+ return {
176
+ type: "vector",
177
+ identifier: e.options.identifier,
178
+ options: e.options,
179
+ style: e.options.style,
180
+ styleFunction: e.options.styleFunction
181
+ };
182
+ return {
183
+ ...e,
184
+ identifier: e.options.identifier
185
+ };
186
+ })), ye = b(() => {
187
+ const e = [];
188
+ if (W.value) {
189
+ const n = W.value;
190
+ n.type === "wmts" ? e.push({
191
+ type: "wmts",
192
+ identifier: n.options.identifier,
193
+ wmtsOptions: te.value,
194
+ source: G(te.value),
195
+ zIndex: 0
196
+ }) : n.type === "wms" ? e.push({
197
+ type: "wms",
198
+ identifier: n.options.identifier,
199
+ wmsUrl: n.options.url,
200
+ layerName: n.options.layer,
201
+ source: $(n.options.url, n.options.layer),
202
+ zIndex: 0
203
+ }) : n.type === "vector" && e.push({
204
+ type: "vector",
205
+ identifier: n.options.identifier,
206
+ options: n.options,
207
+ style: n.options.style,
208
+ styleFunction: n.options.styleFunction,
209
+ zIndex: 0
210
+ });
211
+ }
212
+ const t = me.value.map((n, s) => ({
213
+ ...n,
214
+ zIndex: s + 10
215
+ })), o = pe.value.map((n, s) => ({
216
+ ...n,
217
+ zIndex: t.length + s + 20
218
+ }));
219
+ return [...e, ...t, ...o];
220
+ }), ve = () => {
221
+ F.value = !F.value;
222
+ }, ge = () => {
223
+ I.value = !I.value;
224
+ }, be = (e) => {
225
+ O.value.has(e) ? O.value.delete(e) : O.value.add(e);
226
+ }, we = (e) => {
227
+ _.value = e;
228
+ }, he = () => {
229
+ if (w.value?.view) {
230
+ const e = w.value.view, t = e.getZoom(), o = e.getMaxZoom();
231
+ typeof t == "number" && t < o && e.animate({ zoom: t + 1, duration: 250 });
232
+ }
233
+ }, Le = () => {
234
+ if (w.value?.view) {
235
+ const e = w.value.view, t = e.getZoom(), o = e.getMinZoom();
236
+ typeof t == "number" && t > o && e.animate({ zoom: t - 1, duration: 250 });
237
+ }
238
+ }, D = async (e, t, o) => {
239
+ try {
240
+ const s = await (await fetch(e)).text(), a = new He().read(s), p = o ? [o, "image/jpeg", "image/png"] : ["image/png", "image/jpeg"];
241
+ let y = null;
242
+ for (const u of p)
243
+ try {
244
+ if (y = qe(a, {
245
+ layer: t,
246
+ matrixSet: "EPSG:28992",
247
+ projection: "EPSG:28992",
248
+ format: u,
249
+ crossOrigin: "anonymous",
250
+ style: "default"
251
+ }), y) break;
252
+ } catch (v) {
253
+ console.warn(`Format ${u} failed for layer ${t}:`, v);
254
+ }
255
+ return y && (y.style = "default"), y;
256
+ } catch (n) {
257
+ return console.error("Failed to fetch WMTS capabilities:", n), null;
258
+ }
259
+ }, ke = (e) => {
260
+ if (!e || e.length === 0 || !w.value?.view) return;
261
+ const t = [];
262
+ for (const o of e)
263
+ if (o.type === "Point")
264
+ t.push(o.coordinates);
265
+ else if (o.type === "Polygon") {
266
+ const n = o.coordinates;
267
+ for (const s of n)
268
+ for (const a of s)
269
+ t.push(a);
270
+ }
271
+ if (t.length > 0) {
272
+ const o = Ee(t);
273
+ w.value.view.fit(o, {
274
+ padding: [50, 50, 50, 50]
275
+ });
276
+ }
277
+ };
278
+ ze(async () => {
279
+ if (!_.value && i.baseLayers && i.baseLayers.length > 0) {
280
+ const e = i.baseLayers[0];
281
+ e?.options.identifier && (_.value = e.options.identifier);
282
+ }
283
+ await new Promise((e) => setTimeout(e, 100)), P.value?.map && P.value.map.on("singleclick", (e) => {
284
+ x("mapClicked", {
285
+ coordinate: e.coordinate,
286
+ pixel: e.pixel
287
+ });
288
+ });
289
+ for (const e of i.layers.filter((t) => t.type === "wmts"))
290
+ if (e.options.url) {
291
+ const t = await D(
292
+ e.options.url,
293
+ e.options.identifier,
294
+ e.options.format
295
+ );
296
+ N(e.options.identifier, t);
297
+ }
298
+ if (i.baseLayers) {
299
+ for (const e of i.baseLayers.filter((t) => t.type === "wmts"))
300
+ if (e.options.url) {
301
+ const t = await D(
302
+ e.options.url,
303
+ e.options.identifier,
304
+ e.options.format
305
+ );
306
+ N(e.options.identifier, t);
307
+ }
308
+ }
309
+ if (i.toggleableLayers) {
310
+ for (const e of i.toggleableLayers.filter(
311
+ (t) => t.type === "wmts"
312
+ ))
313
+ if (e.options.url) {
314
+ const t = await D(
315
+ e.options.url,
316
+ e.options.identifier,
317
+ e.options.format
318
+ );
319
+ N(e.options.identifier, t);
320
+ }
321
+ }
322
+ });
323
+ const Se = b(() => {
324
+ if (!i.interactions?.selectable?.layers || i.interactions.selectable.layers.length === 0)
325
+ return;
326
+ const e = i.interactions.selectable.layers;
327
+ return (t, o) => {
328
+ if (!o) return !1;
329
+ const n = o.get("name");
330
+ return e.includes(n);
331
+ };
332
+ }), _e = b(() => ee(i.interactions?.selectable?.style, void 0)), Me = (e) => {
333
+ C.value && (C.value.clear(), e.selected && e.selected.length > 0 && C.value.push(e.selected[0])), x("featureSelected", e);
334
+ }, Ce = (e) => {
335
+ h.value = e;
336
+ const t = e.features.getArray()[0];
337
+ if (M.value = t || null, t) {
338
+ const o = t.getGeometry();
339
+ B.value = o.clone();
340
+ const n = o.getCoordinates();
341
+ z.value = n, V.value = !0, A.value = o.on("change", () => {
342
+ const s = o.getCoordinates();
343
+ z.value = s;
344
+ });
345
+ }
346
+ }, Te = (e) => {
347
+ h.value = e, M.value = e.features.getArray()[0] || M.value;
348
+ }, oe = () => {
349
+ C.value && C.value.clear();
350
+ const e = J.value?.select;
351
+ (e?.value || e)?.getFeatures?.().clear();
352
+ }, Fe = () => {
353
+ if (h.value) {
354
+ const e = h.value.features.getArray();
355
+ x("featureModified", { features: e });
356
+ }
357
+ oe(), ne();
358
+ }, Ie = () => {
359
+ if (h.value && B.value) {
360
+ const e = h.value.features.getArray()[0];
361
+ e && e.setGeometry(B.value);
362
+ const t = h.value.features.getArray();
363
+ x("modifyCancelled", { features: t });
364
+ }
365
+ oe(), ne();
366
+ }, ne = () => {
367
+ V.value = !1, z.value = null, h.value = null, M.value = null, B.value = null, A.value && (et(A.value), A.value = null);
368
+ };
369
+ return ce({ map: P, view: w, fitToFeatures: ke }), (e, t) => (l(), L("div", at, [
370
+ g(r(Be), {
371
+ ref_key: "mapRef",
372
+ ref: P,
373
+ style: { width: "100%", height: "100%" },
374
+ controls: []
375
+ }, {
376
+ default: k(() => [
377
+ g(r(Ae), {
378
+ projectionName: r(j).name,
379
+ projectionDef: r(j).def,
380
+ extent: r(j).extent
381
+ }, null, 8, ["projectionName", "projectionDef", "extent"]),
382
+ g(r(We), {
383
+ ref_key: "viewRef",
384
+ ref: w,
385
+ center: S.center,
386
+ zoom: S.zoom,
387
+ projection: r(j).name
388
+ }, null, 8, ["center", "zoom", "projection"]),
389
+ i.interactions?.selectable?.enabled ? (l(), f(r(De), {
390
+ key: 0,
391
+ ref_key: "selectInteractionRef",
392
+ ref: J,
393
+ multi: !1,
394
+ features: Z.value,
395
+ filter: Se.value,
396
+ style: xe(_e.value),
397
+ onSelect: Me
398
+ }, null, 8, ["features", "filter", "style"])) : d("", !0),
399
+ (l(!0), L(K, null, se(ye.value, (o) => (l(), L(K, {
400
+ key: o.identifier
401
+ }, [
402
+ o.type === "wms" && o.source ? (l(), f(r(ae), {
403
+ key: 0,
404
+ zIndex: o.zIndex,
405
+ source: o.source
406
+ }, null, 8, ["zIndex", "source"])) : o.type === "wmts" && o.source ? (l(), f(r(ae), {
407
+ key: 1,
408
+ zIndex: o.zIndex,
409
+ source: o.source
410
+ }, null, 8, ["zIndex", "source"])) : o.type === "vector" ? (l(), f(r(Ve), {
411
+ key: 2,
412
+ zIndex: o.zIndex,
413
+ properties: { name: o.identifier },
414
+ ref_for: !0,
415
+ ref: (n) => {
416
+ n && (fe.value[o.identifier] = n);
417
+ }
418
+ }, {
419
+ default: k(() => [
420
+ o.styleFunction || o.options?.styleFunction || o.style || o.options?.style ? (l(), f(r(Ne), {
421
+ key: 0,
422
+ overrideStyleFunction: o.styleFunction || o.options?.styleFunction || de(o.style || o.options?.style)
423
+ }, null, 8, ["overrideStyleFunction"])) : d("", !0),
424
+ g(r(Ze), {
425
+ ref_for: !0,
426
+ ref: (n) => {
427
+ n && (R.value[o.identifier] = n);
428
+ }
429
+ }, {
430
+ default: k(() => [
431
+ (l(!0), L(K, null, se(o.options?.features, (n, s) => (l(), f(r(je), {
432
+ key: `${o.identifier}-${s}`,
433
+ properties: n.properties || {}
434
+ }, {
435
+ default: k(() => [
436
+ n.type === "Point" ? (l(), f(r($e), {
437
+ key: 0,
438
+ coordinates: n.coordinates
439
+ }, null, 8, ["coordinates"])) : d("", !0),
440
+ n.type === "Polygon" ? (l(), f(r(Ge), {
441
+ key: 1,
442
+ coordinates: n.coordinates
443
+ }, null, 8, ["coordinates"])) : d("", !0)
444
+ ]),
445
+ _: 2
446
+ }, 1032, ["properties"]))), 128)),
447
+ i.interactions?.modify?.enabled && i.interactions.modify.layer === o.identifier && Z.value ? (l(), f(r(Ue), {
448
+ key: 0,
449
+ features: Z.value,
450
+ onModifystart: Ce,
451
+ onModifyend: Te
452
+ }, null, 8, ["features"])) : d("", !0),
453
+ i.interactions?.snap?.enabled && i.interactions?.modify?.enabled && i.interactions?.modify?.layer === o.identifier && R.value[i.interactions.snap.targetLayer]?.source ? (l(), f(r(Ke), {
454
+ key: `snap-${o.identifier}-${i.interactions?.snap?.enabled}-${i.interactions?.modify?.enabled}`,
455
+ source: R.value[i.interactions.snap.targetLayer]?.source,
456
+ pixelTolerance: i.interactions?.snap?.pixelTolerance || 8
457
+ }, null, 8, ["source", "pixelTolerance"])) : d("", !0)
458
+ ]),
459
+ _: 2
460
+ }, 1536)
461
+ ]),
462
+ _: 2
463
+ }, 1032, ["zIndex", "properties"])) : d("", !0)
464
+ ], 64))), 128)),
465
+ V.value && z.value ? (l(), f(r(Re), {
466
+ key: 1,
467
+ position: z.value,
468
+ positioning: "bottom-left",
469
+ offset: [10, -10],
470
+ stopEvent: !0
471
+ }, {
472
+ default: k(() => [
473
+ m("div", ct, [
474
+ Q.value ? (l(), L("div", ut, Pe(Q.value), 1)) : d("", !0),
475
+ m("div", { class: "modify-overlay-actions" }, [
476
+ m("button", {
477
+ class: "modify-btn modify-btn-cancel",
478
+ onClick: Ie
479
+ }, " Annuleer "),
480
+ m("button", {
481
+ class: "modify-btn modify-btn-ok",
482
+ onClick: Fe
483
+ }, " Bevestig ")
484
+ ])
485
+ ])
486
+ ]),
487
+ _: 1
488
+ }, 8, ["position"])) : d("", !0)
489
+ ]),
490
+ _: 1
491
+ }, 512),
492
+ m("div", ft, [
493
+ S.toggleableLayers && S.toggleableLayers.length > 0 ? (l(), L("div", dt, [
494
+ m("button", {
495
+ class: re(["iconbutton", { isActive: I.value }]),
496
+ "aria-label": "Toon lagen",
497
+ "aria-expanded": I.value,
498
+ onClick: ge
499
+ }, [
500
+ g(r(nt))
501
+ ], 10, pt),
502
+ g(le, { name: "fade" }, {
503
+ default: k(() => [
504
+ I.value ? (l(), f(lt, {
505
+ key: 0,
506
+ toggleableLayers: S.toggleableLayers || [],
507
+ visibleToggleableLayers: O.value,
508
+ onToggleLayer: be
509
+ }, null, 8, ["toggleableLayers", "visibleToggleableLayers"])) : d("", !0)
510
+ ]),
511
+ _: 1
512
+ })
513
+ ])) : d("", !0)
514
+ ]),
515
+ m("div", mt, [
516
+ i.baseLayers && i.baseLayers.length > 0 ? (l(), L("div", yt, [
517
+ m("button", {
518
+ class: re(["iconbutton", { isActive: F.value }]),
519
+ "aria-label": "Toon basislagen",
520
+ "aria-expanded": F.value,
521
+ onClick: ve
522
+ }, [
523
+ g(r(ot))
524
+ ], 10, vt),
525
+ g(le, { name: "fade" }, {
526
+ default: k(() => [
527
+ F.value ? (l(), f(rt, {
528
+ key: 0,
529
+ baseLayers: i.baseLayers,
530
+ selectedBaseLayerId: _.value,
531
+ onSelectBaseLayer: we
532
+ }, null, 8, ["baseLayers", "selectedBaseLayerId"])) : d("", !0)
533
+ ]),
534
+ _: 1
535
+ })
536
+ ])) : d("", !0),
537
+ m("div", gt, [
538
+ m("button", {
539
+ class: "iconbutton",
540
+ "aria-label": "Zoom in",
541
+ onClick: he
542
+ }, [
543
+ g(r(it))
544
+ ]),
545
+ m("button", {
546
+ class: "iconbutton",
547
+ "aria-label": "Zoom out",
548
+ onClick: Le
549
+ }, [
550
+ g(r(st))
551
+ ])
552
+ ])
553
+ ])
554
+ ]));
555
+ }
556
+ });
557
+ export {
558
+ Zt as default
559
+ };
@@ -0,0 +1 @@
1
+ export { default as Map } from './Map.vue';
@@ -0,0 +1,23 @@
1
+ export interface LayerConfig {
2
+ type: "wmts" | "vector";
3
+ options: {
4
+ identifier: string;
5
+ title: string;
6
+ url?: string;
7
+ layer?: string;
8
+ matrixSet?: string;
9
+ format?: string;
10
+ projection?: string;
11
+ };
12
+ }
13
+ type __VLS_Props = {
14
+ baseLayers: LayerConfig[];
15
+ selectedBaseLayerId: string | null;
16
+ };
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ selectBaseLayer: (layerId: string | null) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ onSelectBaseLayer?: ((layerId: string | null) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import a from "./BaseLayers.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ o(a, [["__scopeId", "data-v-7a503b81"]]);
5
+ export {
6
+ s as default
7
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as u, computed as f, openBlock as o, createElementBlock as r, createElementVNode as t, Fragment as m, renderList as y, toDisplayString as L } from "vue";
2
+ const _ = { class: "wrapper" }, B = ["id", "checked", "onClick"], k = ["for"], b = { class: "layer" }, h = ["checked"], I = /* @__PURE__ */ u({
3
+ __name: "BaseLayers",
4
+ props: {
5
+ baseLayers: {},
6
+ selectedBaseLayerId: {}
7
+ },
8
+ emits: ["selectBaseLayer"],
9
+ setup(a, { emit: c }) {
10
+ const i = a, l = c, p = f(() => i.selectedBaseLayerId === null), d = (n) => {
11
+ if (!n) {
12
+ l("selectBaseLayer", null);
13
+ return;
14
+ }
15
+ i.selectedBaseLayerId !== n.options.identifier && l("selectBaseLayer", n.options.identifier);
16
+ };
17
+ return (n, s) => (o(), r("div", _, [
18
+ t("ul", null, [
19
+ (o(!0), r(m, null, y(a.baseLayers, (e) => (o(), r("li", {
20
+ key: e.options.identifier,
21
+ class: "layer"
22
+ }, [
23
+ t("input", {
24
+ id: e.options.identifier,
25
+ type: "radio",
26
+ name: "baseLayer",
27
+ checked: i.selectedBaseLayerId === e.options.identifier,
28
+ onClick: () => d(e)
29
+ }, null, 8, B),
30
+ t("label", {
31
+ for: e.options.identifier
32
+ }, L(e.options.title), 9, k)
33
+ ]))), 128)),
34
+ t("li", b, [
35
+ t("input", {
36
+ id: "baseLayer_none",
37
+ type: "radio",
38
+ name: "baseLayer",
39
+ checked: p.value,
40
+ onClick: s[0] || (s[0] = () => d(null))
41
+ }, null, 8, h),
42
+ s[1] || (s[1] = t("label", { for: "baseLayer_none" }, "Geen", -1))
43
+ ])
44
+ ])
45
+ ]));
46
+ }
47
+ });
48
+ export {
49
+ I as default
50
+ };
@@ -0,0 +1,23 @@
1
+ export interface LayerConfig {
2
+ type: "wmts" | "vector" | "wms";
3
+ options: {
4
+ identifier: string;
5
+ title: string;
6
+ url?: string;
7
+ layer?: string;
8
+ matrixSet?: string;
9
+ format?: string;
10
+ projection?: string;
11
+ };
12
+ }
13
+ type __VLS_Props = {
14
+ toggleableLayers: LayerConfig[];
15
+ visibleToggleableLayers: Set<string>;
16
+ };
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ toggleLayer: (layerId: string) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ onToggleLayer?: ((layerId: string) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./Layers.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-16f7d1b3"]]);
5
+ export {
6
+ f as default
7
+ };