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