@opengis/gis 0.2.166 → 0.2.168
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/{CardIcon-B-HKyoDs.js → CardIcon-DzERD2T8.js} +1 -1
- package/dist/{EntityTablePage-BnAJuEwI.js → EntityTablePage-DAVJRQLe.js} +1 -1
- package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-L9BfGfUU.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-B-6axJUY.js} +1 -1
- package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js → HeaderActions.vue_vue_type_script_setup_true_lang-D1iwSeRN.js} +1 -1
- package/dist/{MapSettings-B1lSk4KX.js → MapSettings-wVix8wMh.js} +1 -1
- package/dist/{RastersTablePage-aEh696Or.js → RastersTablePage-u3oN_h_n.js} +1 -1
- package/dist/cartocss-BIveBlgY.js +1586 -0
- package/dist/{import-utils-HEL359RU.js → import-utils-DkKPU_Nd.js} +1 -1
- package/dist/{index-ClqqnPEd.js → index-C3bl1qBS.js} +4493 -4455
- package/dist/index.css +1 -1
- package/dist/index.js +12 -12
- package/dist/index.umd.cjs +48 -48
- package/dist/{raster-DFD-dtui.js → raster-CfTJZx5p.js} +3 -3
- package/dist/{register-DMJ_OnzW.js → register-dV5ipRhb.js} +3 -3
- package/dist/{service-FcW2Gvt4.js → service-DWC5gq3L.js} +5 -5
- package/dist/{vs-datatable-C27Dlfo3.js → vs-datatable-Cd2Gp4jo.js} +2 -3
- package/package.json +1 -2
- package/server/routes/mapnik/controllers/mapnikLogger.js +10 -21
- package/server/routes/mapnik/controllers/rtile.js +12 -28
- package/dist/cartocss-BoYdEjtS.js +0 -1065
|
@@ -1,1065 +0,0 @@
|
|
|
1
|
-
import { openBlock as _, createElementBlock as z, createElementVNode as o, defineComponent as Y, computed as L, createTextVNode as Ee, createVNode as E, mergeModels as Xe, defineAsyncComponent as ye, useModel as Ze, ref as x, withCtx as J, toDisplayString as T, unref as ve, watch as I, onUnmounted as Ke, createCommentVNode as q, onBeforeUnmount as je, onMounted as et, withDirectives as tt, vModelText as at, createBlock as R, normalizeClass as $e, normalizeStyle as ot, Fragment as Le, renderList as nt, resolveDynamicComponent as st } from "vue";
|
|
2
|
-
import { useRouter as lt, useRoute as rt } from "vue-router";
|
|
3
|
-
import { notify as P } from "@opengis/core";
|
|
4
|
-
import { _ as ut, f as Ae, o as it, p as ct, q as dt, M as ft, i as mt, j as Ve, m as pt } from "./index-ClqqnPEd.js";
|
|
5
|
-
import { S as yt, C as vt } from "./CardIcon-B-HKyoDs.js";
|
|
6
|
-
import { _ as ht, a as gt, b as bt, c as xt } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
|
|
7
|
-
import { _ as Ne } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
|
|
8
|
-
import { V as wt } from "./vs-datatable-C27Dlfo3.js";
|
|
9
|
-
import { _ as Me } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-L9BfGfUU.js";
|
|
10
|
-
const _t = {}, kt = {
|
|
11
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
-
width: "24",
|
|
13
|
-
height: "24",
|
|
14
|
-
viewBox: "0 0 24 24",
|
|
15
|
-
fill: "none",
|
|
16
|
-
stroke: "currentColor",
|
|
17
|
-
"stroke-width": "2",
|
|
18
|
-
"stroke-linecap": "round",
|
|
19
|
-
"stroke-linejoin": "round",
|
|
20
|
-
class: "lucide lucide-table"
|
|
21
|
-
};
|
|
22
|
-
function Ct(N, u) {
|
|
23
|
-
return _(), z("svg", kt, [...u[0] || (u[0] = [
|
|
24
|
-
o("path", { d: "M12 3v18" }, null, -1),
|
|
25
|
-
o("rect", {
|
|
26
|
-
width: "18",
|
|
27
|
-
height: "18",
|
|
28
|
-
x: "3",
|
|
29
|
-
y: "3",
|
|
30
|
-
rx: "2"
|
|
31
|
-
}, null, -1),
|
|
32
|
-
o("path", { d: "M3 9h18" }, null, -1),
|
|
33
|
-
o("path", { d: "M3 15h18" }, null, -1)
|
|
34
|
-
])]);
|
|
35
|
-
}
|
|
36
|
-
const St = /* @__PURE__ */ ut(_t, [["render", Ct]]), $t = { class: "flex flex-col h-full" }, Lt = { class: "flex justify-end mb-3 gap-2" }, Vt = /* @__PURE__ */ Y({
|
|
37
|
-
__name: "cartocss-css-tab",
|
|
38
|
-
props: {
|
|
39
|
-
modelValue: {}
|
|
40
|
-
},
|
|
41
|
-
emits: ["update:modelValue", "save"],
|
|
42
|
-
setup(N, { emit: u }) {
|
|
43
|
-
const r = N, A = u, V = L({
|
|
44
|
-
get: () => r.modelValue,
|
|
45
|
-
set: (w) => A("update:modelValue", w)
|
|
46
|
-
});
|
|
47
|
-
return (w, k) => (_(), z("div", $t, [
|
|
48
|
-
o("div", Lt, [
|
|
49
|
-
o("button", {
|
|
50
|
-
type: "button",
|
|
51
|
-
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium bg-gradient-to-r from-sky-400 to-blue-400 hover:from-sky-500 hover:to-blue-500 text-white shadow-sm px-4 py-2 h-9 text-xs transition-all duration-300",
|
|
52
|
-
onClick: k[0] || (k[0] = (f) => w.$emit("save"))
|
|
53
|
-
}, [...k[2] || (k[2] = [
|
|
54
|
-
o("svg", {
|
|
55
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
-
width: "24",
|
|
57
|
-
height: "24",
|
|
58
|
-
viewBox: "0 0 24 24",
|
|
59
|
-
fill: "none",
|
|
60
|
-
stroke: "currentColor",
|
|
61
|
-
"stroke-width": "2",
|
|
62
|
-
"stroke-linecap": "round",
|
|
63
|
-
"stroke-linejoin": "round",
|
|
64
|
-
class: "h-3.5 w-3.5"
|
|
65
|
-
}, [
|
|
66
|
-
o("path", { d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a 2 2 0 0 1-2-2V5a 2 2 0 0 1 2-2z" }),
|
|
67
|
-
o("path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a 1 1 0 0 0-1 1v7" }),
|
|
68
|
-
o("path", { d: "M7 3v4a1 1 0 0 0 1 1h7" })
|
|
69
|
-
], -1),
|
|
70
|
-
Ee(" Зберегти ", -1)
|
|
71
|
-
])])
|
|
72
|
-
]),
|
|
73
|
-
E(Ne, {
|
|
74
|
-
modelValue: V.value,
|
|
75
|
-
"onUpdate:modelValue": k[1] || (k[1] = (f) => V.value = f),
|
|
76
|
-
language: "cartocss",
|
|
77
|
-
class: "flex-1 rounded-lg overflow-hidden"
|
|
78
|
-
}, null, 8, ["modelValue"])
|
|
79
|
-
]));
|
|
80
|
-
}
|
|
81
|
-
}), Mt = { class: "flex flex-col flex-1 min-h-0" }, zt = { class: "flex justify-between mb-3 gap-2" }, Et = { class: "text-left" }, jt = { class: "font-medium text-gray-900" }, At = { class: "text-xs text-gray-500" }, Nt = { class: "flex justify-center gap-2" }, Bt = ["checked", "onChange"], qt = { class: "text-sm font-medium text-gray-900" }, Tt = /* @__PURE__ */ Y({
|
|
82
|
-
__name: "cartocss-data-tab",
|
|
83
|
-
props: {
|
|
84
|
-
modelValue: { default: [] },
|
|
85
|
-
modelModifiers: {}
|
|
86
|
-
},
|
|
87
|
-
emits: /* @__PURE__ */ Xe(["save"], ["update:modelValue"]),
|
|
88
|
-
setup(N, { emit: u }) {
|
|
89
|
-
const r = [
|
|
90
|
-
{ key: "table", label: "Таблиця", slot: "datasetCell" },
|
|
91
|
-
{
|
|
92
|
-
key: "active",
|
|
93
|
-
label: "Активний",
|
|
94
|
-
slot: "activeCell",
|
|
95
|
-
width: "140px"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
key: "zoom",
|
|
99
|
-
label: "Min Зум",
|
|
100
|
-
slot: "zoomCell",
|
|
101
|
-
width: "140px"
|
|
102
|
-
}
|
|
103
|
-
], A = ye(
|
|
104
|
-
() => import("@opengis/core").then((y) => y.VsModal)
|
|
105
|
-
), V = ye(() => import("@opengis/form")), w = Ze(N, "modelValue"), k = u, f = x(!1), v = x({
|
|
106
|
-
table: "",
|
|
107
|
-
query: "",
|
|
108
|
-
srid: "",
|
|
109
|
-
key: "",
|
|
110
|
-
columns: "",
|
|
111
|
-
gcol: "",
|
|
112
|
-
minzoom: "",
|
|
113
|
-
maxzoom: "",
|
|
114
|
-
proj4text: "",
|
|
115
|
-
active: !0
|
|
116
|
-
}), i = {
|
|
117
|
-
table: { type: "text", label: "Таблиця", validators: ["required"] },
|
|
118
|
-
key: { type: "text", label: "Ключ", validators: ["required"] },
|
|
119
|
-
query: { type: "text", label: "Query" },
|
|
120
|
-
columns: { type: "text", label: "Колонки" },
|
|
121
|
-
gcol: { type: "text", label: "Колонка geometry" },
|
|
122
|
-
srid: { type: "number", label: "SRID" },
|
|
123
|
-
proj4text: { type: "text", label: "PROJ4" },
|
|
124
|
-
active: { type: "switcher", label: "Активна" },
|
|
125
|
-
minzoom: { type: "number", label: "Min Зум", col: 6 },
|
|
126
|
-
maxzoom: { type: "number", label: "Max Зум", col: 6 }
|
|
127
|
-
};
|
|
128
|
-
function d() {
|
|
129
|
-
v.value = {
|
|
130
|
-
table: "",
|
|
131
|
-
query: "",
|
|
132
|
-
srid: "",
|
|
133
|
-
key: "",
|
|
134
|
-
columns: "",
|
|
135
|
-
gcol: "",
|
|
136
|
-
minzoom: "",
|
|
137
|
-
maxzoom: "",
|
|
138
|
-
proj4text: "",
|
|
139
|
-
active: !0
|
|
140
|
-
}, f.value = !0;
|
|
141
|
-
}
|
|
142
|
-
function c() {
|
|
143
|
-
f.value = !1;
|
|
144
|
-
}
|
|
145
|
-
function B() {
|
|
146
|
-
var m, C;
|
|
147
|
-
const y = (m = v.value.table) == null ? void 0 : m.trim(), p = (C = v.value.key) == null ? void 0 : C.trim();
|
|
148
|
-
if (!y || !p) {
|
|
149
|
-
P({
|
|
150
|
-
type: "warning",
|
|
151
|
-
title: "Перевірка",
|
|
152
|
-
message: "Вкажіть таблицю та підпис"
|
|
153
|
-
});
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
w.value = [
|
|
157
|
-
...Array.isArray(w.value) ? w.value : [],
|
|
158
|
-
{ ...v.value, table: y, key: p }
|
|
159
|
-
], f.value = !1;
|
|
160
|
-
}
|
|
161
|
-
function l(y, p) {
|
|
162
|
-
var C;
|
|
163
|
-
const m = ((C = p == null ? void 0 : p.target) == null ? void 0 : C.checked) ?? !1;
|
|
164
|
-
y.active = m, w.value = Array.isArray(w.value) ? [...w.value] : [];
|
|
165
|
-
}
|
|
166
|
-
return (y, p) => (_(), z("div", Mt, [
|
|
167
|
-
o("div", zt, [
|
|
168
|
-
o("button", {
|
|
169
|
-
type: "button",
|
|
170
|
-
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium bg-gradient-to-r from-gray-500 to-gray-400 text-white h-9 px-4 py-2 hover:from-gray-600 hover:to-gray-500",
|
|
171
|
-
onClick: d
|
|
172
|
-
}, " Додати таблицю "),
|
|
173
|
-
o("button", {
|
|
174
|
-
type: "button",
|
|
175
|
-
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium bg-gradient-to-r from-sky-400 to-blue-400 hover:from-sky-500 hover:to-blue-500 text-white shadow-sm px-4 py-2 h-9 text-xs transition-all duration-300",
|
|
176
|
-
onClick: p[0] || (p[0] = (m) => k("save"))
|
|
177
|
-
}, " Зберегти ")
|
|
178
|
-
]),
|
|
179
|
-
E(wt, {
|
|
180
|
-
modelValue: w.value,
|
|
181
|
-
"onUpdate:modelValue": p[1] || (p[1] = (m) => w.value = m),
|
|
182
|
-
"columns-scheme": r,
|
|
183
|
-
"form-scheme": i,
|
|
184
|
-
"add-button": !1,
|
|
185
|
-
"main-col-width": "260px"
|
|
186
|
-
}, {
|
|
187
|
-
datasetCell: J(({ row: m }) => [
|
|
188
|
-
o("div", Et, [
|
|
189
|
-
o("div", jt, T(m.table), 1),
|
|
190
|
-
o("div", At, T(m.key), 1)
|
|
191
|
-
])
|
|
192
|
-
]),
|
|
193
|
-
activeCell: J(({ row: m }) => [
|
|
194
|
-
o("label", Nt, [
|
|
195
|
-
o("input", {
|
|
196
|
-
type: "checkbox",
|
|
197
|
-
class: "h-4 w-4 text-sky-500 border-gray-300 rounded focus:ring-sky-300",
|
|
198
|
-
checked: m.active,
|
|
199
|
-
onChange: (C) => l(m, C)
|
|
200
|
-
}, null, 40, Bt)
|
|
201
|
-
])
|
|
202
|
-
]),
|
|
203
|
-
zoomCell: J(({ row: m }) => [
|
|
204
|
-
o("div", qt, T(m.zoom), 1)
|
|
205
|
-
]),
|
|
206
|
-
_: 1
|
|
207
|
-
}, 8, ["modelValue"]),
|
|
208
|
-
E(ve(A), {
|
|
209
|
-
teleport: "#modal",
|
|
210
|
-
visible: f.value,
|
|
211
|
-
"onUpdate:visible": p[3] || (p[3] = (m) => f.value = m),
|
|
212
|
-
title: "Нова таблиця CartoCSS"
|
|
213
|
-
}, {
|
|
214
|
-
footer: J(() => [
|
|
215
|
-
o("div", { class: "flex justify-end gap-2 p-4 border-т" }, [
|
|
216
|
-
o("button", {
|
|
217
|
-
type: "button",
|
|
218
|
-
class: "px-4 py-2 rounded bg-gray-100 text-gray-700",
|
|
219
|
-
onClick: c
|
|
220
|
-
}, " Скасувати "),
|
|
221
|
-
o("button", {
|
|
222
|
-
type: "button",
|
|
223
|
-
class: "px-4 py-2 rounded bg-blue-600 text-white",
|
|
224
|
-
onClick: B
|
|
225
|
-
}, " Додати ")
|
|
226
|
-
])
|
|
227
|
-
]),
|
|
228
|
-
default: J(() => [
|
|
229
|
-
E(ve(V), {
|
|
230
|
-
values: v.value,
|
|
231
|
-
"onUpdate:values": p[2] || (p[2] = (m) => v.value = m),
|
|
232
|
-
schema: i
|
|
233
|
-
}, null, 8, ["values"])
|
|
234
|
-
]),
|
|
235
|
-
_: 1
|
|
236
|
-
}, 8, ["visible"])
|
|
237
|
-
]));
|
|
238
|
-
}
|
|
239
|
-
}), Dt = { class: "flex flex-col flex-1 min-h-0 gap-4" }, Ut = { class: "h-[calc(100vh-230px)] rounded-md border border-gray-200 bg-white" }, It = /* @__PURE__ */ Y({
|
|
240
|
-
__name: "cartocss-card-tab",
|
|
241
|
-
props: {
|
|
242
|
-
card: {},
|
|
243
|
-
table: {}
|
|
244
|
-
},
|
|
245
|
-
emits: ["save"],
|
|
246
|
-
setup(N, { emit: u }) {
|
|
247
|
-
const r = N, A = u, V = x(r.table), w = x(r.card), k = ye(() => import("@opengis/form").then((v) => v.VsInputText));
|
|
248
|
-
function f() {
|
|
249
|
-
A("save", {
|
|
250
|
-
card_html: w.value,
|
|
251
|
-
card_table: V.value
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
return (v, i) => (_(), z("div", Dt, [
|
|
255
|
-
o("div", { class: "flex items-center justify-end gap-3" }, [
|
|
256
|
-
o("button", {
|
|
257
|
-
type: "button",
|
|
258
|
-
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium bg-gradient-to-r from-sky-400 to-blue-400 hover:from-sky-500 hover:to-blue-500 text-white shadow-sm px-4 py-2 h-9 text-xs transition-all duration-300",
|
|
259
|
-
onClick: f
|
|
260
|
-
}, [...i[2] || (i[2] = [
|
|
261
|
-
o("svg", {
|
|
262
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
263
|
-
width: "24",
|
|
264
|
-
height: "24",
|
|
265
|
-
viewBox: "0 0 24 24",
|
|
266
|
-
fill: "none",
|
|
267
|
-
stroke: "currentColor",
|
|
268
|
-
"stroke-width": "2",
|
|
269
|
-
"stroke-linecap": "round",
|
|
270
|
-
"stroke-linejoin": "round",
|
|
271
|
-
class: "h-3.5 w-3.5"
|
|
272
|
-
}, [
|
|
273
|
-
o("path", { d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a 2 2 0 0 1-2-2V5a 2 2 0 0 1 2-2z" }),
|
|
274
|
-
o("path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a 1 1 0 0 0-1 1v7" }),
|
|
275
|
-
o("path", { d: "M7 3v4a1 1 0 0 0 1 1h7" })
|
|
276
|
-
], -1),
|
|
277
|
-
Ee(" Зберегти картку ", -1)
|
|
278
|
-
])])
|
|
279
|
-
]),
|
|
280
|
-
o("div", null, [
|
|
281
|
-
E(ve(k), {
|
|
282
|
-
modelValue: V.value,
|
|
283
|
-
"onUpdate:modelValue": i[0] || (i[0] = (d) => V.value = d)
|
|
284
|
-
}, null, 8, ["modelValue"])
|
|
285
|
-
]),
|
|
286
|
-
o("div", Ut, [
|
|
287
|
-
E(Ne, {
|
|
288
|
-
modelValue: w.value,
|
|
289
|
-
"onUpdate:modelValue": i[1] || (i[1] = (d) => w.value = d),
|
|
290
|
-
language: "html",
|
|
291
|
-
theme: "vs-light",
|
|
292
|
-
class: "h-full w-full rounded-md"
|
|
293
|
-
}, null, 8, ["modelValue"])
|
|
294
|
-
])
|
|
295
|
-
]));
|
|
296
|
-
}
|
|
297
|
-
}), Pt = /* @__PURE__ */ Y({
|
|
298
|
-
__name: "CartocssLayerLoader",
|
|
299
|
-
props: {
|
|
300
|
-
layerId: { type: String, required: !0 },
|
|
301
|
-
tileUrl: { type: String, default: "" },
|
|
302
|
-
title: { type: String, default: "" },
|
|
303
|
-
active: { type: Boolean, default: !1 },
|
|
304
|
-
owner: { type: String, default: "" },
|
|
305
|
-
opacity: { type: Number, default: 1 }
|
|
306
|
-
},
|
|
307
|
-
setup(N) {
|
|
308
|
-
const u = N, r = Ae(), {
|
|
309
|
-
activateTemporaryLayer: A,
|
|
310
|
-
deactivateTemporaryLayer: V,
|
|
311
|
-
setTemporaryLayerOpacity: w
|
|
312
|
-
} = it(r.map), k = L(() => {
|
|
313
|
-
var c;
|
|
314
|
-
const d = `${(c = u == null ? void 0 : u.tileUrl) == null ? void 0 : c.trim()}`;
|
|
315
|
-
return d ? typeof window > "u" || typeof location > "u" || /^https?:\/\//i.test(d) ? d : d.startsWith("//") ? `${window.location.protocol}${d}` : d.startsWith("/") ? `${location.origin}${d}` : `${location.origin}/${d}` : "";
|
|
316
|
-
});
|
|
317
|
-
let f = "", v = "";
|
|
318
|
-
function i() {
|
|
319
|
-
const d = u.active && !!k.value;
|
|
320
|
-
f && (!d || f !== u.layerId) && (V(f, v || void 0), f = "", v = ""), d && (A(
|
|
321
|
-
{
|
|
322
|
-
id: u.layerId,
|
|
323
|
-
title: u.title || u.layerId,
|
|
324
|
-
url: k.value,
|
|
325
|
-
opacity: u.opacity
|
|
326
|
-
},
|
|
327
|
-
{},
|
|
328
|
-
u.owner
|
|
329
|
-
), f = u.layerId, v = u.owner || "");
|
|
330
|
-
}
|
|
331
|
-
return I(
|
|
332
|
-
() => [u.layerId, k.value, u.active, u.owner],
|
|
333
|
-
i,
|
|
334
|
-
{ immediate: !0 }
|
|
335
|
-
), I(
|
|
336
|
-
() => u.opacity,
|
|
337
|
-
(d) => {
|
|
338
|
-
!f || !u.active || w(f, d, v || void 0);
|
|
339
|
-
},
|
|
340
|
-
{ immediate: !0 }
|
|
341
|
-
), Ke(() => {
|
|
342
|
-
f && (V(f, v || void 0), f = "", v = "");
|
|
343
|
-
}), (d, c) => q("", !0);
|
|
344
|
-
}
|
|
345
|
-
}), Ot = /* @__PURE__ */ Y({
|
|
346
|
-
__name: "CartocssMapClickListener",
|
|
347
|
-
props: {
|
|
348
|
-
cartocssId: {},
|
|
349
|
-
infoEnabled: { type: [Boolean, null] }
|
|
350
|
-
},
|
|
351
|
-
setup(N) {
|
|
352
|
-
const u = N, r = L(() => u.cartocssId ?? null), A = L(() => !!u.infoEnabled), { map: V, ready: w } = Ae(), k = (l) => {
|
|
353
|
-
!l || typeof window > "u" || window.dispatchEvent(
|
|
354
|
-
new CustomEvent(dt, { detail: l })
|
|
355
|
-
);
|
|
356
|
-
}, f = async (l) => {
|
|
357
|
-
const y = await fetch(`/api/map-format?${l.toString()}`);
|
|
358
|
-
if (!y.ok)
|
|
359
|
-
throw new Error(`API returned ${y.status}`);
|
|
360
|
-
return y.json();
|
|
361
|
-
};
|
|
362
|
-
let v = null, i = null;
|
|
363
|
-
const d = (l) => {
|
|
364
|
-
if (!l) return null;
|
|
365
|
-
if (typeof l == "string")
|
|
366
|
-
try {
|
|
367
|
-
return JSON.parse(l);
|
|
368
|
-
} catch {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
return l;
|
|
372
|
-
}, c = async (l, y) => {
|
|
373
|
-
var C;
|
|
374
|
-
const p = r.value ? `external:${r.value},${String(l)}` : null, m = new URLSearchParams({
|
|
375
|
-
layer: r.value ?? "",
|
|
376
|
-
id: String(l)
|
|
377
|
-
});
|
|
378
|
-
try {
|
|
379
|
-
const $ = await f(m), D = typeof $.html == "string" ? $.html : null, j = d(
|
|
380
|
-
((C = $ == null ? void 0 : $.data) == null ? void 0 : C.geom) ?? ($ == null ? void 0 : $.geom) ?? null
|
|
381
|
-
);
|
|
382
|
-
(D || j) && k({
|
|
383
|
-
html: D,
|
|
384
|
-
geometry: j ?? y,
|
|
385
|
-
infoToken: p
|
|
386
|
-
});
|
|
387
|
-
} catch ($) {
|
|
388
|
-
console.warn("CartoCSS map-format (id) error", $);
|
|
389
|
-
}
|
|
390
|
-
}, B = async (l) => {
|
|
391
|
-
var C, $, D, j;
|
|
392
|
-
if (!r.value) return;
|
|
393
|
-
if (!A.value) {
|
|
394
|
-
P({
|
|
395
|
-
type: "error",
|
|
396
|
-
title: "CartoCSS",
|
|
397
|
-
message: "Картка не налаштована"
|
|
398
|
-
});
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
const y = (C = l == null ? void 0 : l.lngLat) == null ? void 0 : C.lng, p = ($ = l == null ? void 0 : l.lngLat) == null ? void 0 : $.lat;
|
|
402
|
-
if (typeof y != "number" || typeof p != "number") return;
|
|
403
|
-
const m = new URLSearchParams({
|
|
404
|
-
layer: r.value,
|
|
405
|
-
lat: p.toFixed(6),
|
|
406
|
-
lng: y.toFixed(6)
|
|
407
|
-
});
|
|
408
|
-
try {
|
|
409
|
-
const g = await f(m), Z = d(
|
|
410
|
-
((D = g == null ? void 0 : g.data) == null ? void 0 : D.geom) ?? (g == null ? void 0 : g.geom) ?? null
|
|
411
|
-
), G = ((j = g == null ? void 0 : g.data) == null ? void 0 : j.id) ?? (g == null ? void 0 : g.id);
|
|
412
|
-
if (G != null) {
|
|
413
|
-
await c(G, Z);
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
ct({ html: g == null ? void 0 : g.html }) && k({
|
|
417
|
-
html: g == null ? void 0 : g.html,
|
|
418
|
-
geometry: Z,
|
|
419
|
-
infoToken: null
|
|
420
|
-
});
|
|
421
|
-
} catch (g) {
|
|
422
|
-
console.warn("CartoCSS map-format error", g);
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
return w().then(() => {
|
|
426
|
-
i = V.value, i && (i.on("click", B), v = () => i == null ? void 0 : i.off("click", B));
|
|
427
|
-
}), je(() => {
|
|
428
|
-
v == null || v(), v = null, i = null;
|
|
429
|
-
}), () => {
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
}), Ft = { class: "flex h-full bg-gradient-to-br from-slate-50 to-white" }, Rt = { class: "flex-1 relative overflow-hidden" }, Qt = { class: "absolute top-0 left-0 w-full z-20" }, Ht = { class: "px-4 sm:px-6 py-4 border-b border-gray-200 bg-white shadow-sm" }, Jt = { class: "flex items-start justify-between gap-4" }, Yt = { class: "flex-1 min-w-0" }, Gt = { class: "flex items-center text-sm text-gray-500 mb-3" }, Wt = { class: "text-gray-900 font-medium truncate max-w-xs" }, Xt = { class: "flex items-center justify-between gap-4" }, Zt = { class: "flex-1 min-w-0" }, Kt = { class: "flex items-center gap-3 mb-1" }, ea = { class: "text-base font-semibold text-gray-900 truncate" }, ta = {
|
|
433
|
-
key: 0,
|
|
434
|
-
class: "px-2 py-0.5 bg-green-50 border border-green-200 rounded flex-shrink-0"
|
|
435
|
-
}, aa = { class: "text-xs font-medium text-green-700" }, oa = ["title"], na = { class: "w-full h-full bg-gradient-to-br from-sky-50 via-white to-blue-50 flex items-center justify-center relative pt-[115px]" }, sa = { class: "relative w-full h-full" }, la = { class: "absolute top-[5.5rem] left-4 z-30 flex flex-col items-start gap-2" }, ra = { class: "rounded-2xl bg-white/90 px-3 py-2 text-xs font-medium text-slate-600 shadow-sm backdrop-blur" }, ua = { class: "flex items-center gap-2" }, ia = { class: "rounded-2xl bg-white/90 px-3 py-2 text-xs font-medium text-slate-600 shadow-sm backdrop-blur" }, ca = { class: "inline-flex items-center gap-2 text-[11px] text-slate-600" }, da = ["checked"], fa = { class: "absolute top-4 left-4 z-20" }, ma = { class: "absolute top-[6.5rem] right-2 space-y-1 z-20" }, pa = {
|
|
436
|
-
key: 0,
|
|
437
|
-
class: "absolute bottom-4 left-1/2 z-30 -translate-x-1/2 rounded-2xl border border-sky-200 bg-white/95 px-4 py-2 text-xs font-medium text-slate-700 shadow-lg backdrop-blur"
|
|
438
|
-
}, ya = { class: "flex-1 flex flex-col h-full" }, va = {
|
|
439
|
-
key: 0,
|
|
440
|
-
class: "px-3 pt-3 pb-2 border-b border-gray-100"
|
|
441
|
-
}, ha = ["aria-selected", "onClick"], ga = { class: "leading-none" }, ba = { class: "flex flex-col flex-1 overflow-y-hidden p-3" }, xa = {
|
|
442
|
-
key: 0,
|
|
443
|
-
class: "flex-1 flex items-center justify-center text-sm text-gray-500"
|
|
444
|
-
}, wa = "cartocss-demo-001", _a = "OpenGIS", ze = 2, re = 5, ka = 5, Na = /* @__PURE__ */ Y({
|
|
445
|
-
__name: "cartocss",
|
|
446
|
-
setup(N) {
|
|
447
|
-
const u = lt(), r = rt(), A = x(null), V = L(() => {
|
|
448
|
-
var t;
|
|
449
|
-
const e = (t = r.matched[r.matched.length - 1]) == null ? void 0 : t.path;
|
|
450
|
-
return (typeof e == "string" && e ? e : r.path).replace(/\/:id\??$/, "") || "/";
|
|
451
|
-
}), w = L(() => {
|
|
452
|
-
var a;
|
|
453
|
-
const e = (a = r.meta) == null ? void 0 : a.title;
|
|
454
|
-
return typeof e == "string" && e.trim() ? e : "CartoCSS";
|
|
455
|
-
});
|
|
456
|
-
function k() {
|
|
457
|
-
u.push(V.value);
|
|
458
|
-
}
|
|
459
|
-
const f = [
|
|
460
|
-
{ key: "css", label: "CSS", icon: yt },
|
|
461
|
-
{ key: "data", label: "Дані", icon: St },
|
|
462
|
-
{ key: "metadata", label: "Метадані", icon: xt },
|
|
463
|
-
{ key: "card", label: "Картка", icon: vt }
|
|
464
|
-
], v = f.map((e) => e.key), i = x(
|
|
465
|
-
v.includes(r.query.tab) ? r.query.tab : "css"
|
|
466
|
-
), d = x(!0), c = x(null), B = L(
|
|
467
|
-
() => {
|
|
468
|
-
var e;
|
|
469
|
-
return (e = c.value) != null && e.source_path ? f.filter((a) => a.key === "card" || a.key === "metadata") : f;
|
|
470
|
-
}
|
|
471
|
-
), l = L(
|
|
472
|
-
() => r.params.id || wa
|
|
473
|
-
), y = x({
|
|
474
|
-
id: l.value,
|
|
475
|
-
name: "",
|
|
476
|
-
description: ""
|
|
477
|
-
});
|
|
478
|
-
let p = null;
|
|
479
|
-
const m = x(!1);
|
|
480
|
-
function C(e) {
|
|
481
|
-
if (Array.isArray(e)) return C(e[0]);
|
|
482
|
-
if (typeof e != "string" && typeof e != "number") return null;
|
|
483
|
-
const a = typeof e == "number" ? e : Number(e.trim());
|
|
484
|
-
return Number.isFinite(a) ? a : null;
|
|
485
|
-
}
|
|
486
|
-
function $(e, a) {
|
|
487
|
-
return e.toFixed(a);
|
|
488
|
-
}
|
|
489
|
-
function D(e, a, t) {
|
|
490
|
-
const n = 0.5 * 10 ** -t;
|
|
491
|
-
return Math.abs(e - a) > n;
|
|
492
|
-
}
|
|
493
|
-
function j() {
|
|
494
|
-
var e;
|
|
495
|
-
return (e = A.value) == null ? void 0 : e.ctx;
|
|
496
|
-
}
|
|
497
|
-
function g() {
|
|
498
|
-
var h, S, F, U;
|
|
499
|
-
const e = (S = (h = j()) == null ? void 0 : h.map) == null ? void 0 : S.value;
|
|
500
|
-
if (!e) return;
|
|
501
|
-
const a = C(r.query.z), t = C(r.query.x), n = C(r.query.y);
|
|
502
|
-
if (a == null || t == null || n == null) return;
|
|
503
|
-
const s = (F = e.getCenter) == null ? void 0 : F.call(e), b = (U = e.getZoom) == null ? void 0 : U.call(e);
|
|
504
|
-
(!s || D(s.lng, t, re) || D(s.lat, n, re) || D(b ?? 0, a, ze)) && (m.value = !0, e.jumpTo({ center: [t, n], zoom: a }), m.value = !1);
|
|
505
|
-
}
|
|
506
|
-
function Z() {
|
|
507
|
-
var s, b, M, h;
|
|
508
|
-
if (m.value) return;
|
|
509
|
-
const e = (b = (s = j()) == null ? void 0 : s.map) == null ? void 0 : b.value;
|
|
510
|
-
if (!e) return;
|
|
511
|
-
const a = (M = e.getCenter) == null ? void 0 : M.call(e), t = (h = e.getZoom) == null ? void 0 : h.call(e);
|
|
512
|
-
if (!a || t == null) return;
|
|
513
|
-
const n = {
|
|
514
|
-
...r.query,
|
|
515
|
-
z: $(t, ze),
|
|
516
|
-
x: $(a.lng, re),
|
|
517
|
-
y: $(a.lat, re)
|
|
518
|
-
};
|
|
519
|
-
r.query.z === n.z && r.query.x === n.x && r.query.y === n.y || u.replace({ query: n });
|
|
520
|
-
}
|
|
521
|
-
function G(e) {
|
|
522
|
-
typeof document > "u" || (document.title = e ? `${e} — CartoCSS` : _a);
|
|
523
|
-
}
|
|
524
|
-
const K = x(""), ee = x([]), ue = x(!1), te = x(!1), ie = x(""), ce = x(0), ae = x(!1), oe = x(1), de = x(!0), O = x(!1), W = x(null), Be = L(() => `cartocss-layer-${l.value}`), qe = L(
|
|
525
|
-
() => `${Math.round(oe.value * 100)}%`
|
|
526
|
-
), Te = L(
|
|
527
|
-
() => `cartocss-extent-${l.value}`
|
|
528
|
-
), De = L(
|
|
529
|
-
() => `cartocss-extent-draft-${l.value}`
|
|
530
|
-
), he = L(() => {
|
|
531
|
-
var s;
|
|
532
|
-
const e = (s = ie.value) == null ? void 0 : s.trim();
|
|
533
|
-
if (!e) return "";
|
|
534
|
-
const a = e.includes("?") ? "&" : "?", t = `${e}${a}nottl=1`, n = ce.value;
|
|
535
|
-
return n ? `${e}${a}ts=${n}&nocache=1` : t;
|
|
536
|
-
}), ge = x(""), be = x(""), xe = L(() => {
|
|
537
|
-
var b;
|
|
538
|
-
const e = (b = c.value) == null ? void 0 : b.bounds;
|
|
539
|
-
if (!Array.isArray(e) || e.length < 4) return null;
|
|
540
|
-
const [a, t, n, s] = e;
|
|
541
|
-
return [a, t, n, s].some(
|
|
542
|
-
(M) => typeof M != "number" || Number.isNaN(M)
|
|
543
|
-
) ? null : [(a + n) / 2, (t + s) / 2];
|
|
544
|
-
}), Ue = L(() => {
|
|
545
|
-
var b;
|
|
546
|
-
const e = (b = c.value) == null ? void 0 : b.bounds;
|
|
547
|
-
if (!Array.isArray(e) || e.length < 4) return null;
|
|
548
|
-
const [a, t, n, s] = e;
|
|
549
|
-
return [a, t, n, s].some(
|
|
550
|
-
(M) => typeof M != "number" || Number.isNaN(M)
|
|
551
|
-
) ? null : [a, t, n, s];
|
|
552
|
-
}), fe = L(() => {
|
|
553
|
-
const e = c.value;
|
|
554
|
-
return e ? [
|
|
555
|
-
e.description,
|
|
556
|
-
e.group_id ? `Група: ${e.group_id}` : null,
|
|
557
|
-
e.source_path ? `Шлях: ${e.source_path}` : null,
|
|
558
|
-
e.is_public === !0 ? "Публічний" : "Не публічний",
|
|
559
|
-
e.enabled === !0 ? "Активний" : "Неактивний"
|
|
560
|
-
].filter(Boolean).join(", ") : "";
|
|
561
|
-
}), we = L(() => {
|
|
562
|
-
var a;
|
|
563
|
-
const e = (a = c.value) == null ? void 0 : a.group_id;
|
|
564
|
-
return e ? String(e).toUpperCase() : "";
|
|
565
|
-
});
|
|
566
|
-
let Q = null, X = !1, H = null;
|
|
567
|
-
function ne(e) {
|
|
568
|
-
return Number(e.toFixed(ka));
|
|
569
|
-
}
|
|
570
|
-
function _e(e, a) {
|
|
571
|
-
const [t, n] = e, [s, b] = a;
|
|
572
|
-
return [
|
|
573
|
-
ne(Math.min(t, s)),
|
|
574
|
-
ne(Math.min(n, b)),
|
|
575
|
-
ne(Math.max(t, s)),
|
|
576
|
-
ne(Math.max(n, b))
|
|
577
|
-
];
|
|
578
|
-
}
|
|
579
|
-
function Ie(e) {
|
|
580
|
-
const [a, t, n, s] = e;
|
|
581
|
-
return {
|
|
582
|
-
type: "Polygon",
|
|
583
|
-
coordinates: [
|
|
584
|
-
[
|
|
585
|
-
[a, t],
|
|
586
|
-
[n, t],
|
|
587
|
-
[n, s],
|
|
588
|
-
[a, s],
|
|
589
|
-
[a, t]
|
|
590
|
-
]
|
|
591
|
-
]
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
function me(e) {
|
|
595
|
-
var n, s, b;
|
|
596
|
-
const a = (s = (n = j()) == null ? void 0 : n.map) == null ? void 0 : s.value, t = (b = a == null ? void 0 : a.getCanvas) == null ? void 0 : b.call(a);
|
|
597
|
-
t != null && t.style && (t.style.cursor = e);
|
|
598
|
-
}
|
|
599
|
-
async function Pe(e, a) {
|
|
600
|
-
if (!(!l.value || !c.value)) {
|
|
601
|
-
te.value = !0;
|
|
602
|
-
try {
|
|
603
|
-
const t = Ie(e), n = await fetch(`/api/gis-css/${l.value}`, {
|
|
604
|
-
method: "POST",
|
|
605
|
-
headers: { "Content-Type": "application/json" },
|
|
606
|
-
body: JSON.stringify({ geom: t })
|
|
607
|
-
});
|
|
608
|
-
if (!n.ok)
|
|
609
|
-
throw new Error(`Failed to save cartocss bounds: ${n.status}`);
|
|
610
|
-
P({
|
|
611
|
-
type: "success",
|
|
612
|
-
title: "Bounds збережено",
|
|
613
|
-
message: "Нові межі успішно збережено."
|
|
614
|
-
}), await se(l.value, { bustCache: !0 });
|
|
615
|
-
} catch (t) {
|
|
616
|
-
console.error("Failed to save CartoCSS bounds", t), c.value && (c.value = {
|
|
617
|
-
...c.value,
|
|
618
|
-
bounds: a ? [...a] : null
|
|
619
|
-
}), P({
|
|
620
|
-
type: "error",
|
|
621
|
-
title: "Помилка",
|
|
622
|
-
message: "Не вдалося зберегти Bounds"
|
|
623
|
-
});
|
|
624
|
-
} finally {
|
|
625
|
-
te.value = !1;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function ke(e) {
|
|
630
|
-
var t, n, s;
|
|
631
|
-
const a = (n = (t = j()) == null ? void 0 : t.map) == null ? void 0 : n.value;
|
|
632
|
-
if ((s = a == null ? void 0 : a.dragPan) != null && s.enable && a.dragPan.enable(), (e == null ? void 0 : e.length) === 4 && c.value) {
|
|
633
|
-
const b = Array.isArray(c.value.bounds) ? [...c.value.bounds] : null;
|
|
634
|
-
c.value = {
|
|
635
|
-
...c.value,
|
|
636
|
-
bounds: [...e]
|
|
637
|
-
}, Pe(e, b);
|
|
638
|
-
}
|
|
639
|
-
Q = null, X = !1, W.value = null, O.value = !1, me("");
|
|
640
|
-
}
|
|
641
|
-
function pe() {
|
|
642
|
-
ke(null);
|
|
643
|
-
}
|
|
644
|
-
function Oe() {
|
|
645
|
-
var b, M;
|
|
646
|
-
const e = (M = (b = j()) == null ? void 0 : b.map) == null ? void 0 : M.value;
|
|
647
|
-
if (!e) return;
|
|
648
|
-
const a = (h) => {
|
|
649
|
-
var F, U, le;
|
|
650
|
-
if (!O.value || ((F = h == null ? void 0 : h.originalEvent) == null ? void 0 : F.button) != null && h.originalEvent.button !== 0)
|
|
651
|
-
return;
|
|
652
|
-
const S = h == null ? void 0 : h.lngLat;
|
|
653
|
-
S && (Q = [S.lng, S.lat], X = !0, W.value = [S.lng, S.lat, S.lng, S.lat], (le = (U = e.dragPan) == null ? void 0 : U.disable) == null || le.call(U));
|
|
654
|
-
}, t = (h) => {
|
|
655
|
-
if (!O.value || !X || !Q)
|
|
656
|
-
return;
|
|
657
|
-
const S = h == null ? void 0 : h.lngLat;
|
|
658
|
-
S && (W.value = _e(Q, [
|
|
659
|
-
S.lng,
|
|
660
|
-
S.lat
|
|
661
|
-
]));
|
|
662
|
-
}, n = (h) => {
|
|
663
|
-
if (!O.value || !X || !Q)
|
|
664
|
-
return;
|
|
665
|
-
const S = h == null ? void 0 : h.lngLat;
|
|
666
|
-
if (!S) {
|
|
667
|
-
pe();
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
const F = _e(Q, [
|
|
671
|
-
S.lng,
|
|
672
|
-
S.lat
|
|
673
|
-
]), [U, le, Ge, We] = F;
|
|
674
|
-
if (!(Math.abs(Ge - U) > 0 && Math.abs(We - le) > 0)) {
|
|
675
|
-
P({
|
|
676
|
-
type: "warning",
|
|
677
|
-
title: "Bounds не змінено",
|
|
678
|
-
message: "Потрібно протягнути прямокутник з ненульовою площею."
|
|
679
|
-
}), pe();
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
ke(F);
|
|
683
|
-
}, s = (h) => {
|
|
684
|
-
O.value && h.key === "Escape" && (h.preventDefault(), pe());
|
|
685
|
-
};
|
|
686
|
-
e.on("mousedown", a), e.on("mousemove", t), e.on("mouseup", n), window.addEventListener("keydown", s), H = () => {
|
|
687
|
-
e.off("mousedown", a), e.off("mousemove", t), e.off("mouseup", n), window.removeEventListener("keydown", s);
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
async function Fe() {
|
|
691
|
-
var t;
|
|
692
|
-
const e = j();
|
|
693
|
-
!(e != null && e.ready) || (await e.ready(), !((t = e.map) == null ? void 0 : t.value)) || (H || Oe(), O.value = !0, X = !1, Q = null, W.value = null, me("crosshair"), P({
|
|
694
|
-
type: "info",
|
|
695
|
-
title: "Редагування Bounds",
|
|
696
|
-
message: "Протягніть прямокутник на карті, щоб задати нові межі."
|
|
697
|
-
}));
|
|
698
|
-
}
|
|
699
|
-
I(
|
|
700
|
-
l,
|
|
701
|
-
(e) => {
|
|
702
|
-
e && se(e);
|
|
703
|
-
},
|
|
704
|
-
{ immediate: !0 }
|
|
705
|
-
), I(
|
|
706
|
-
() => {
|
|
707
|
-
var e;
|
|
708
|
-
return (e = y.value) == null ? void 0 : e.name;
|
|
709
|
-
},
|
|
710
|
-
(e) => G(e),
|
|
711
|
-
{ immediate: !0 }
|
|
712
|
-
);
|
|
713
|
-
async function Re() {
|
|
714
|
-
var n;
|
|
715
|
-
const e = j();
|
|
716
|
-
if (!(e != null && e.ready)) return;
|
|
717
|
-
await e.ready(), g();
|
|
718
|
-
const a = (n = e.map) == null ? void 0 : n.value;
|
|
719
|
-
if (!a) return;
|
|
720
|
-
const t = () => Z();
|
|
721
|
-
a.on("moveend", t), a.on("zoomend", t), p = () => {
|
|
722
|
-
a.off("moveend", t), a.off("zoomend", t);
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
I(
|
|
726
|
-
() => [r.query.z, r.query.x, r.query.y],
|
|
727
|
-
() => {
|
|
728
|
-
g();
|
|
729
|
-
}
|
|
730
|
-
), et(() => {
|
|
731
|
-
Re();
|
|
732
|
-
}), je(() => {
|
|
733
|
-
p == null || p(), p = null, H == null || H(), H = null, me("");
|
|
734
|
-
}), I(
|
|
735
|
-
() => r.query.tab,
|
|
736
|
-
(e) => {
|
|
737
|
-
e && B.value.some((a) => a.key === e) && i.value !== e && (i.value = e);
|
|
738
|
-
}
|
|
739
|
-
), I(
|
|
740
|
-
B,
|
|
741
|
-
(e) => {
|
|
742
|
-
e.length && !e.some((a) => a.key === i.value) && (i.value = e[0].key);
|
|
743
|
-
},
|
|
744
|
-
{ immediate: !0 }
|
|
745
|
-
), I(i, (e) => {
|
|
746
|
-
r.query.tab !== e && B.value.some((a) => a.key === e) && u.replace({ query: { ...r.query, tab: e } });
|
|
747
|
-
}), I(
|
|
748
|
-
() => c.value,
|
|
749
|
-
(e) => {
|
|
750
|
-
const a = e == null ? void 0 : e.card_html;
|
|
751
|
-
ge.value = a, be.value = e == null ? void 0 : e.card_table;
|
|
752
|
-
},
|
|
753
|
-
{ immediate: !0 }
|
|
754
|
-
);
|
|
755
|
-
function Ce() {
|
|
756
|
-
l.value && se(l.value, { bustCache: !0 });
|
|
757
|
-
}
|
|
758
|
-
async function Qe(e, a) {
|
|
759
|
-
if (l.value) {
|
|
760
|
-
te.value = !0;
|
|
761
|
-
try {
|
|
762
|
-
const t = await fetch(`/api/gis-css/${l.value}`, {
|
|
763
|
-
method: "POST",
|
|
764
|
-
headers: { "Content-Type": "application/json" },
|
|
765
|
-
body: JSON.stringify(e)
|
|
766
|
-
});
|
|
767
|
-
if (!t.ok) throw new Error(`Failed to save cartocss: ${t.status}`);
|
|
768
|
-
P({ type: "success", title: "Збережено", message: a }), await se(l.value, { bustCache: !0 });
|
|
769
|
-
} catch (t) {
|
|
770
|
-
console.error("Failed to save CartoCSS", t), P({
|
|
771
|
-
type: "error",
|
|
772
|
-
title: "Помилка",
|
|
773
|
-
message: "Не вдалося зберегти CartoCSS"
|
|
774
|
-
});
|
|
775
|
-
} finally {
|
|
776
|
-
te.value = !1;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
function He(e) {
|
|
781
|
-
if (!e) return null;
|
|
782
|
-
if (typeof e == "string")
|
|
783
|
-
try {
|
|
784
|
-
return JSON.parse(e);
|
|
785
|
-
} catch (a) {
|
|
786
|
-
return console.warn("Failed to parse CartoCSS config", a), null;
|
|
787
|
-
}
|
|
788
|
-
return typeof e == "object" ? e : null;
|
|
789
|
-
}
|
|
790
|
-
function Je(e) {
|
|
791
|
-
const a = Array.isArray(e) ? e : e == null ? void 0 : e.datasets;
|
|
792
|
-
return Array.isArray(a) ? a.map((t, n) => ({
|
|
793
|
-
table: (t == null ? void 0 : t.table) || (t == null ? void 0 : t.id) || `dataset_${n + 1}`,
|
|
794
|
-
query: (t == null ? void 0 : t.query) || "",
|
|
795
|
-
srid: (t == null ? void 0 : t.srid) || "",
|
|
796
|
-
gcol: (t == null ? void 0 : t.gcol) || "",
|
|
797
|
-
key: (t == null ? void 0 : t.key) || (t == null ? void 0 : t.label) || "Без підпису",
|
|
798
|
-
active: typeof (t == null ? void 0 : t.active) == "boolean" ? t.active : !0,
|
|
799
|
-
minzoom: typeof (t == null ? void 0 : t.zoom) > "u" ? "" : String(t.zoom),
|
|
800
|
-
maxzoom: typeof (t == null ? void 0 : t.maxzoom) > "u" ? "" : String(t.maxzoom),
|
|
801
|
-
columns: (t == null ? void 0 : t.columns) || "",
|
|
802
|
-
proj4text: (t == null ? void 0 : t.proj4text) || ""
|
|
803
|
-
})) : [];
|
|
804
|
-
}
|
|
805
|
-
async function se(e, a) {
|
|
806
|
-
ue.value = !0;
|
|
807
|
-
try {
|
|
808
|
-
const t = await fetch(`/api/gis-css/${e}`);
|
|
809
|
-
if (!t.ok) throw new Error(`Failed to load cartocss: ${t.status}`);
|
|
810
|
-
const n = await t.json(), s = (n == null ? void 0 : n.message) || n || {};
|
|
811
|
-
c.value = s, y.value = {
|
|
812
|
-
id: s.cartocss_key || e,
|
|
813
|
-
name: s.name || y.value.name,
|
|
814
|
-
description: s.description || y.value.description
|
|
815
|
-
}, K.value = typeof s.style == "string" ? s.style : "";
|
|
816
|
-
const b = He(s.config ?? []);
|
|
817
|
-
ee.value = Je(b);
|
|
818
|
-
const M = typeof s.url == "string" ? s.url : "";
|
|
819
|
-
ie.value = M, ae.value = !!(M && s.enabled !== !1), ce.value = a != null && a.bustCache ? Date.now() : 0;
|
|
820
|
-
} catch (t) {
|
|
821
|
-
console.error("Failed to fetch CartoCSS", t), ae.value = !1, ie.value = "", ce.value = 0, c.value = null;
|
|
822
|
-
} finally {
|
|
823
|
-
ue.value = !1;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
async function Se() {
|
|
827
|
-
await Qe(
|
|
828
|
-
{
|
|
829
|
-
style: K.value || "",
|
|
830
|
-
config: ee.value
|
|
831
|
-
},
|
|
832
|
-
"CartoCSS оновлено"
|
|
833
|
-
);
|
|
834
|
-
}
|
|
835
|
-
async function Ye(e) {
|
|
836
|
-
const a = await fetch(`/api/gis-css/${l.value}`, {
|
|
837
|
-
method: "POST",
|
|
838
|
-
headers: { "Content-Type": "application/json" },
|
|
839
|
-
body: JSON.stringify(e)
|
|
840
|
-
});
|
|
841
|
-
if (!a.ok) throw new Error(`Failed to save cartocss: ${a.status}`);
|
|
842
|
-
P({
|
|
843
|
-
type: "success",
|
|
844
|
-
title: "Збережено",
|
|
845
|
-
message: "Картка CartoCSS оновлена"
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
return (e, a) => (_(), z("div", Ft, [
|
|
849
|
-
o("div", Rt, [
|
|
850
|
-
o("div", Qt, [
|
|
851
|
-
o("div", Ht, [
|
|
852
|
-
o("div", Jt, [
|
|
853
|
-
o("div", Yt, [
|
|
854
|
-
o("div", Gt, [
|
|
855
|
-
o("button", {
|
|
856
|
-
type: "button",
|
|
857
|
-
class: "hover:text-gray-700 cursor-pointer transition-colors",
|
|
858
|
-
onClick: k
|
|
859
|
-
}, T(w.value), 1),
|
|
860
|
-
a[5] || (a[5] = o("svg", {
|
|
861
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
862
|
-
width: "24",
|
|
863
|
-
height: "24",
|
|
864
|
-
viewBox: "0 0 24 24",
|
|
865
|
-
fill: "none",
|
|
866
|
-
stroke: "currentColor",
|
|
867
|
-
"stroke-width": "2",
|
|
868
|
-
"stroke-linecap": "round",
|
|
869
|
-
"stroke-linejoin": "round",
|
|
870
|
-
class: "lucide lucide-chevron-right w-4 h-4 mx-1"
|
|
871
|
-
}, [
|
|
872
|
-
o("path", { d: "m9 18 6-6-6-6" })
|
|
873
|
-
], -1)),
|
|
874
|
-
o("span", Wt, T(y.value.name || "CartoCSS"), 1)
|
|
875
|
-
]),
|
|
876
|
-
o("div", Xt, [
|
|
877
|
-
o("div", Zt, [
|
|
878
|
-
o("div", Kt, [
|
|
879
|
-
o("h1", ea, T(y.value.name || "CartoCSS"), 1),
|
|
880
|
-
we.value ? (_(), z("div", ta, [
|
|
881
|
-
o("span", aa, T(we.value), 1)
|
|
882
|
-
])) : q("", !0)
|
|
883
|
-
]),
|
|
884
|
-
fe.value ? (_(), z("p", {
|
|
885
|
-
key: 0,
|
|
886
|
-
class: "text-xs text-gray-500 truncate",
|
|
887
|
-
title: fe.value
|
|
888
|
-
}, T(fe.value), 9, oa)) : q("", !0)
|
|
889
|
-
])
|
|
890
|
-
])
|
|
891
|
-
]),
|
|
892
|
-
E(ht, {
|
|
893
|
-
class: "flex-shrink-0",
|
|
894
|
-
"entity-id": l.value,
|
|
895
|
-
"entity-info": y.value,
|
|
896
|
-
"form-endpoint": (t) => `/api/form/gis.cartocss.table/${t}`,
|
|
897
|
-
"save-endpoint": (t) => `/api/gis-css/${t}`,
|
|
898
|
-
"entity-label": "CartoCSS",
|
|
899
|
-
"save-method": "post",
|
|
900
|
-
onSaved: Ce
|
|
901
|
-
}, null, 8, ["entity-id", "entity-info", "form-endpoint", "save-endpoint"])
|
|
902
|
-
])
|
|
903
|
-
])
|
|
904
|
-
]),
|
|
905
|
-
o("div", na, [
|
|
906
|
-
o("div", sa, [
|
|
907
|
-
E(ft, {
|
|
908
|
-
ref_key: "mapViewRef",
|
|
909
|
-
ref: A
|
|
910
|
-
}, {
|
|
911
|
-
default: J(() => {
|
|
912
|
-
var t, n;
|
|
913
|
-
return [
|
|
914
|
-
o("div", la, [
|
|
915
|
-
o("div", ra, [
|
|
916
|
-
o("div", ua, [
|
|
917
|
-
a[6] || (a[6] = o("span", null, "Прозорість:", -1)),
|
|
918
|
-
tt(o("input", {
|
|
919
|
-
"onUpdate:modelValue": a[0] || (a[0] = (s) => oe.value = s),
|
|
920
|
-
type: "range",
|
|
921
|
-
min: "0",
|
|
922
|
-
max: "1",
|
|
923
|
-
step: "0.01",
|
|
924
|
-
class: "h-1 w-28 cursor-pointer appearance-none rounded-full bg-slate-300 focus:outline-none",
|
|
925
|
-
style: { "accent-color": "#3b82f6" }
|
|
926
|
-
}, null, 512), [
|
|
927
|
-
[
|
|
928
|
-
at,
|
|
929
|
-
oe.value,
|
|
930
|
-
void 0,
|
|
931
|
-
{ number: !0 }
|
|
932
|
-
]
|
|
933
|
-
]),
|
|
934
|
-
o("span", null, T(qe.value), 1)
|
|
935
|
-
])
|
|
936
|
-
]),
|
|
937
|
-
o("div", ia, [
|
|
938
|
-
o("label", ca, [
|
|
939
|
-
o("input", {
|
|
940
|
-
type: "checkbox",
|
|
941
|
-
class: "h-3.5 w-3.5 rounded border-slate-300 text-blue-600 focus:ring-blue-200",
|
|
942
|
-
checked: de.value,
|
|
943
|
-
onChange: a[1] || (a[1] = (s) => de.value = s.target.checked)
|
|
944
|
-
}, null, 40, da),
|
|
945
|
-
a[7] || (a[7] = o("span", null, "Межі css", -1))
|
|
946
|
-
])
|
|
947
|
-
])
|
|
948
|
-
]),
|
|
949
|
-
o("div", fa, [
|
|
950
|
-
E(mt)
|
|
951
|
-
]),
|
|
952
|
-
o("div", ma, [
|
|
953
|
-
E(Ve),
|
|
954
|
-
xe.value ? (_(), R(Ve, {
|
|
955
|
-
key: 0,
|
|
956
|
-
targetCenter: xe.value,
|
|
957
|
-
targetLabel: "Центр даних",
|
|
958
|
-
targetAriaLabel: "Перейти до центру даних"
|
|
959
|
-
}, null, 8, ["targetCenter"])) : q("", !0)
|
|
960
|
-
]),
|
|
961
|
-
O.value ? (_(), z("div", pa, " Потягніть на карті, щоб намалювати нові Bounds. Esc скасовує редагування. ")) : q("", !0),
|
|
962
|
-
he.value ? (_(), R(Pt, {
|
|
963
|
-
key: 1,
|
|
964
|
-
"layer-id": Be.value,
|
|
965
|
-
"tile-url": he.value,
|
|
966
|
-
active: ae.value,
|
|
967
|
-
opacity: oe.value,
|
|
968
|
-
title: y.value.name,
|
|
969
|
-
owner: l.value
|
|
970
|
-
}, null, 8, ["layer-id", "tile-url", "active", "opacity", "title", "owner"])) : q("", !0),
|
|
971
|
-
E(Me, {
|
|
972
|
-
extent: de.value ? Ue.value : null,
|
|
973
|
-
"layer-id": Te.value
|
|
974
|
-
}, null, 8, ["extent", "layer-id"]),
|
|
975
|
-
E(Me, {
|
|
976
|
-
extent: W.value,
|
|
977
|
-
"layer-id": De.value,
|
|
978
|
-
"line-color": "#0ea5e9",
|
|
979
|
-
"line-width": 3
|
|
980
|
-
}, null, 8, ["extent", "layer-id"]),
|
|
981
|
-
E(Ot, {
|
|
982
|
-
"cartocss-id": l.value,
|
|
983
|
-
bounds: ((t = c.value) == null ? void 0 : t.bounds) ?? null,
|
|
984
|
-
active: ae.value && !O.value,
|
|
985
|
-
"info-enabled": (n = c.value) == null ? void 0 : n.info
|
|
986
|
-
}, null, 8, ["cartocss-id", "bounds", "active", "info-enabled"]),
|
|
987
|
-
E(pt, { "map-id": l.value }, null, 8, ["map-id"])
|
|
988
|
-
];
|
|
989
|
-
}),
|
|
990
|
-
_: 1
|
|
991
|
-
}, 512)
|
|
992
|
-
])
|
|
993
|
-
]),
|
|
994
|
-
c.value ? (_(), R(gt, {
|
|
995
|
-
key: 0,
|
|
996
|
-
open: d.value,
|
|
997
|
-
onToggle: a[2] || (a[2] = (t) => d.value = !d.value)
|
|
998
|
-
}, null, 8, ["open"])) : q("", !0)
|
|
999
|
-
]),
|
|
1000
|
-
c.value ? (_(), z("div", {
|
|
1001
|
-
key: 0,
|
|
1002
|
-
class: $e(["bg-white border-l border-gray-100 flex flex-col overflow-hidden shadow-lg flex-shrink-0 transition-[width] duration-100 ease-in-out", d.value ? "w-[650px]" : "w-0"])
|
|
1003
|
-
}, [
|
|
1004
|
-
o("div", ya, [
|
|
1005
|
-
B.value.length > 1 ? (_(), z("div", va, [
|
|
1006
|
-
o("div", {
|
|
1007
|
-
class: "items-center justify-center text-muted-foreground grid w-full h-12 p-1 bg-gray-50 rounded-xl shadow-sm",
|
|
1008
|
-
style: ot({
|
|
1009
|
-
gridTemplateColumns: `repeat(${B.value.length}, minmax(0, 1fr))`
|
|
1010
|
-
})
|
|
1011
|
-
}, [
|
|
1012
|
-
(_(!0), z(Le, null, nt(B.value, (t) => (_(), z("button", {
|
|
1013
|
-
key: t.key,
|
|
1014
|
-
type: "button",
|
|
1015
|
-
role: "tab",
|
|
1016
|
-
"aria-selected": i.value === t.key,
|
|
1017
|
-
class: $e([
|
|
1018
|
-
"whitespace-nowrap flex flex-col items-center justify-center gap-0.5 py-1 px-1 text-[9px] font-medium transition-all duration-300 hover:bg-white/70 rounded-lg group",
|
|
1019
|
-
i.value === t.key ? "bg-white shadow-sm text-gray-700" : ""
|
|
1020
|
-
]),
|
|
1021
|
-
onClick: (n) => i.value = t.key
|
|
1022
|
-
}, [
|
|
1023
|
-
(_(), R(st(t.icon), { class: "h-3.5 w-3.5 mb-0.5" })),
|
|
1024
|
-
o("span", ga, T(t.label), 1)
|
|
1025
|
-
], 10, ha))), 128))
|
|
1026
|
-
], 4)
|
|
1027
|
-
])) : q("", !0),
|
|
1028
|
-
o("div", ba, [
|
|
1029
|
-
ue.value ? (_(), z("div", xa, " Завантаження стилю… ")) : (_(), z(Le, { key: 1 }, [
|
|
1030
|
-
i.value === "css" ? (_(), R(Vt, {
|
|
1031
|
-
key: 0,
|
|
1032
|
-
modelValue: K.value,
|
|
1033
|
-
"onUpdate:modelValue": a[3] || (a[3] = (t) => K.value = t),
|
|
1034
|
-
class: "flex-1 min-h-0",
|
|
1035
|
-
onSave: Se
|
|
1036
|
-
}, null, 8, ["modelValue"])) : i.value === "data" ? (_(), R(Tt, {
|
|
1037
|
-
key: 1,
|
|
1038
|
-
modelValue: ee.value,
|
|
1039
|
-
"onUpdate:modelValue": a[4] || (a[4] = (t) => ee.value = t),
|
|
1040
|
-
class: "flex-1 min-h-0 flex flex-col",
|
|
1041
|
-
onSave: Se
|
|
1042
|
-
}, null, 8, ["modelValue"])) : i.value === "card" ? (_(), R(It, {
|
|
1043
|
-
key: 2,
|
|
1044
|
-
card: ge.value,
|
|
1045
|
-
table: be.value,
|
|
1046
|
-
class: "flex-1 min-h-0",
|
|
1047
|
-
onSave: Ye
|
|
1048
|
-
}, null, 8, ["card", "table"])) : i.value === "metadata" ? (_(), R(bt, {
|
|
1049
|
-
key: 3,
|
|
1050
|
-
data: c.value,
|
|
1051
|
-
"entity-id": l.value,
|
|
1052
|
-
"entity-type": "css",
|
|
1053
|
-
onSaved: Ce,
|
|
1054
|
-
onEditCssBounds: Fe
|
|
1055
|
-
}, null, 8, ["data", "entity-id"])) : q("", !0)
|
|
1056
|
-
], 64))
|
|
1057
|
-
])
|
|
1058
|
-
])
|
|
1059
|
-
], 2)) : q("", !0)
|
|
1060
|
-
]));
|
|
1061
|
-
}
|
|
1062
|
-
});
|
|
1063
|
-
export {
|
|
1064
|
-
Na as default
|
|
1065
|
-
};
|