@delta10/atlas-sdk 0.1.10 → 0.1.12

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