@opengis/gis 0.2.129 → 0.2.131
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-DgpYeKbG.js → CardIcon-Bty3pjDA.js} +1 -1
- package/dist/{EntityTablePage-DNdVavT4.js → EntityTablePage-Bx4SIoW8.js} +1 -1
- package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DQnIBCpE.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DRnlsqEC.js} +24 -22
- package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-Cg2y4sIa.js → HeaderActions.vue_vue_type_script_setup_true_lang-CpDC-v8-.js} +345 -321
- package/dist/{MapSettings-CHF3VpUu.js → MapSettings-Bw4WyHXT.js} +12 -12
- package/dist/{RastersTablePage-Ci3P3r4c.js → RastersTablePage-Cjb2zg5J.js} +1 -1
- package/dist/cartocss-sXf_ZeCv.js +1053 -0
- package/dist/{import-utils-ElncWVJV.js → import-utils-DdinjlC4.js} +1 -1
- package/dist/{index-UGx54M0Q.js → index-DtOSF_ba.js} +377 -386
- package/dist/index.css +1 -1
- package/dist/index.js +4 -4
- package/dist/index.umd.cjs +41 -41
- package/dist/raster-D7fESzin.js +792 -0
- package/dist/{register-BfNUPbey.js → register-C_mb5TbK.js} +3 -3
- package/dist/{service-DsykdHry.js → service-BUb9DRGZ.js} +911 -879
- package/dist/{vs-datatable-D6g7tjZo.js → vs-datatable-D-FY2azp.js} +1 -1
- package/package.json +2 -2
- package/server/routes/gis/cartocss/get.cartocss.js +11 -2
- package/server/routes/gis/registers/add.registry.js +3 -4
- package/server/routes/gis/registers/funcs/columns.js +2 -4
- package/server/routes/mapnik/controllers/pretile.js +7 -9
- package/server/routes/mapnik/controllers/rtile.js +13 -1
- package/server/routes/mapnik/functions/cartoBounds.js +6 -2
- package/dist/cartocss-BsaIlSRb.js +0 -894
- package/dist/raster-BDWEafwx.js +0 -663
package/dist/raster-BDWEafwx.js
DELETED
|
@@ -1,663 +0,0 @@
|
|
|
1
|
-
import { defineComponent as F, resolveDirective as Ce, openBlock as o, createElementBlock as d, createElementVNode as s, Fragment as q, renderList as B, toDisplayString as c, withDirectives as ie, createTextVNode as Re, normalizeClass as W, ref as h, watch as S, computed as g, vModelText as Ee, onMounted as Se, onBeforeUnmount as Ie, unref as je, createCommentVNode as U, createVNode as M, withCtx as ze, createBlock as L, resolveDynamicComponent as Me } from "vue";
|
|
2
|
-
import { useRouter as Le, useRoute as Ne } from "vue-router";
|
|
3
|
-
import { TooltipDirective as Ue, notify as D } from "@opengis/core";
|
|
4
|
-
import { _ as qe, u as Be, f as Te, M as De, i as Pe, j as re, F as Fe } from "./index-UGx54M0Q.js";
|
|
5
|
-
import { _ as Ve, a as Qe, b as Ge, c as Ae } from "./HeaderActions.vue_vue_type_script_setup_true_lang-Cg2y4sIa.js";
|
|
6
|
-
import { _ as Oe } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DQnIBCpE.js";
|
|
7
|
-
const We = { class: "flex-1 overflow-y-auto p-4 sm:p-6" }, Xe = { class: "space-y-3" }, Ye = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, Ke = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2" }, Ze = { class: "text-xs text-gray-500 mb-1" }, He = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "text-base text-md font-semibold text-gray-900"
|
|
10
|
-
}, Je = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "text-base text-md font-semibold text-gray-900"
|
|
13
|
-
}, et = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, tt = { class: "space-y-2" }, st = { class: "bg-gradient-to-br from-blue-50 to-blue-100/30 p-4 rounded-lg border border-blue-200" }, nt = { class: "text-sm font-semibold text-gray-900" }, lt = { class: "text-xs text-gray-600 mt-1" }, rt = { class: "grid grid-cols-2 gap-3" }, ot = { class: "text-xs text-gray-500 mb-1" }, it = { class: "text-sm font-semibold text-gray-900" }, at = { class: "bg-gray-50 p-4 rounded-lg" }, ut = { class: "grid grid-cols-2 gap-4" }, ct = { class: "text-xs text-gray-500 mb-1" }, dt = { class: "text-sm font-semibold text-gray-900" }, ft = /* @__PURE__ */ F({
|
|
14
|
-
directives: {
|
|
15
|
-
tooltip: Ue
|
|
16
|
-
},
|
|
17
|
-
__name: "raster-info-tab",
|
|
18
|
-
props: {
|
|
19
|
-
details: {}
|
|
20
|
-
},
|
|
21
|
-
setup(b) {
|
|
22
|
-
return (p, m) => {
|
|
23
|
-
const r = Ce("tooltip");
|
|
24
|
-
return o(), d("div", We, [
|
|
25
|
-
s("div", Xe, [
|
|
26
|
-
s("div", Ye, [
|
|
27
|
-
m[0] || (m[0] = s("div", { class: "mb-4" }, [
|
|
28
|
-
s("h4", { class: "text-sm font-semibold text-gray-900 uppercase tracking-wide" }, "Основні параметри")
|
|
29
|
-
], -1)),
|
|
30
|
-
s("div", Ke, [
|
|
31
|
-
(o(!0), d(q, null, B(b.details.baseParams, (a) => (o(), d("div", {
|
|
32
|
-
key: a.label,
|
|
33
|
-
class: "bg-gray-50 p-2 rounded-lg"
|
|
34
|
-
}, [
|
|
35
|
-
s("p", Ze, c(a.label), 1),
|
|
36
|
-
a.tooltip ? ie((o(), d("p", He, [
|
|
37
|
-
Re(c(a.value), 1)
|
|
38
|
-
])), [
|
|
39
|
-
[r, a.tooltip]
|
|
40
|
-
]) : (o(), d("p", Je, c(a.value), 1))
|
|
41
|
-
]))), 128))
|
|
42
|
-
])
|
|
43
|
-
]),
|
|
44
|
-
s("div", et, [
|
|
45
|
-
m[3] || (m[3] = s("div", { class: "mb-2" }, [
|
|
46
|
-
s("h4", { class: "text-sm font-semibold text-gray-900 uppercase tracking-wide" }, "Просторова інформація")
|
|
47
|
-
], -1)),
|
|
48
|
-
s("div", tt, [
|
|
49
|
-
s("div", null, [
|
|
50
|
-
m[1] || (m[1] = s("p", { class: "text-xs text-gray-500 mb-2" }, "Система координат", -1)),
|
|
51
|
-
s("div", st, [
|
|
52
|
-
s("p", nt, c(b.details.spatial.crs.code), 1),
|
|
53
|
-
s("p", lt, c(b.details.spatial.crs.description), 1)
|
|
54
|
-
])
|
|
55
|
-
]),
|
|
56
|
-
s("div", null, [
|
|
57
|
-
m[2] || (m[2] = s("p", { class: "text-xs text-gray-500 mb-2" }, "Межі покриття", -1)),
|
|
58
|
-
s("div", rt, [
|
|
59
|
-
(o(!0), d(q, null, B(b.details.spatial.bounds, (a) => (o(), d("div", {
|
|
60
|
-
key: a.label,
|
|
61
|
-
class: "bg-gray-50 p-2 rounded-lg border border-gray-200"
|
|
62
|
-
}, [
|
|
63
|
-
s("p", ot, c(a.label), 1),
|
|
64
|
-
s("p", it, c(a.value), 1)
|
|
65
|
-
]))), 128))
|
|
66
|
-
])
|
|
67
|
-
]),
|
|
68
|
-
s("div", at, [
|
|
69
|
-
s("div", ut, [
|
|
70
|
-
(o(!0), d(q, null, B(b.details.spatial.resolution, (a) => (o(), d("div", {
|
|
71
|
-
key: a.label
|
|
72
|
-
}, [
|
|
73
|
-
s("p", ct, c(a.label), 1),
|
|
74
|
-
s("p", dt, c(a.value), 1)
|
|
75
|
-
]))), 128))
|
|
76
|
-
])
|
|
77
|
-
])
|
|
78
|
-
])
|
|
79
|
-
])
|
|
80
|
-
])
|
|
81
|
-
]);
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}), pt = { class: "flex-1 overflow-y-auto space-y-3 pr-1" }, mt = { class: "font-medium text-sm text-gray-800" }, xt = { class: "text-xs text-gray-500" }, vt = /* @__PURE__ */ F({
|
|
85
|
-
__name: "raster-files-tab",
|
|
86
|
-
props: {
|
|
87
|
-
files: {}
|
|
88
|
-
},
|
|
89
|
-
setup(b) {
|
|
90
|
-
return (p, m) => (o(), d("div", pt, [
|
|
91
|
-
(o(!0), d(q, null, B(b.files, (r) => (o(), d("div", {
|
|
92
|
-
key: r.name,
|
|
93
|
-
class: "border border-gray-100 rounded-xl p-4 shadow-sm bg-white flex items-start justify-between"
|
|
94
|
-
}, [
|
|
95
|
-
s("div", null, [
|
|
96
|
-
s("p", mt, c(r.name), 1),
|
|
97
|
-
s("p", xt, c(r.resolution) + " • " + c(r.size) + "MB", 1)
|
|
98
|
-
]),
|
|
99
|
-
s("span", {
|
|
100
|
-
class: W(["text-[11px] font-semibold px-2 py-0.5 rounded-full", r.statusClass])
|
|
101
|
-
}, c(r.status), 3)
|
|
102
|
-
]))), 128))
|
|
103
|
-
]));
|
|
104
|
-
}
|
|
105
|
-
}), yt = {}, gt = {
|
|
106
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
107
|
-
width: "24",
|
|
108
|
-
height: "24",
|
|
109
|
-
viewBox: "0 0 24 24",
|
|
110
|
-
fill: "none",
|
|
111
|
-
stroke: "currentColor",
|
|
112
|
-
"stroke-width": "2",
|
|
113
|
-
"stroke-linecap": "round",
|
|
114
|
-
"stroke-linejoin": "round"
|
|
115
|
-
};
|
|
116
|
-
function bt(b, p) {
|
|
117
|
-
return o(), d("svg", gt, [...p[0] || (p[0] = [
|
|
118
|
-
s("circle", {
|
|
119
|
-
cx: "12",
|
|
120
|
-
cy: "12",
|
|
121
|
-
r: "9"
|
|
122
|
-
}, null, -1),
|
|
123
|
-
s("line", {
|
|
124
|
-
x1: "12",
|
|
125
|
-
y1: "8",
|
|
126
|
-
x2: "12",
|
|
127
|
-
y2: "8"
|
|
128
|
-
}, null, -1),
|
|
129
|
-
s("path", { d: "M11 12h1v4h1" }, null, -1)
|
|
130
|
-
])]);
|
|
131
|
-
}
|
|
132
|
-
const ht = /* @__PURE__ */ qe(yt, [["render", bt]]), _t = { class: "absolute top-[5.5rem] left-4 z-30 flex flex-col items-start gap-2" }, wt = { class: "rounded-2xl bg-white/90 px-3 py-2 text-xs font-medium text-slate-600 shadow-sm backdrop-blur" }, $t = { class: "flex items-center gap-2" }, kt = { class: "rounded-2xl bg-white/90 px-3 py-2 text-xs font-medium text-slate-600 shadow-sm backdrop-blur" }, Ct = { class: "inline-flex items-center gap-2 text-[11px] text-slate-600" }, Rt = ["checked"], Et = /* @__PURE__ */ F({
|
|
133
|
-
__name: "RasterLayer",
|
|
134
|
-
props: {
|
|
135
|
-
tileUrl: {},
|
|
136
|
-
extent: {},
|
|
137
|
-
layerId: {},
|
|
138
|
-
beforeId: {},
|
|
139
|
-
showRasterExtent: { type: Boolean }
|
|
140
|
-
},
|
|
141
|
-
emits: ["toggle-extent"],
|
|
142
|
-
setup(b) {
|
|
143
|
-
const p = b, m = p.layerId || "raster-preview-layer", r = `${m}-source`, a = p.extent && p.extent.length === 4 ? [...p.extent] : void 0, v = Be(m, {
|
|
144
|
-
sourceId: r,
|
|
145
|
-
source: {
|
|
146
|
-
type: "raster",
|
|
147
|
-
tiles: p.tileUrl ? [p.tileUrl + "?nottl=1"] : [],
|
|
148
|
-
tileSize: 256,
|
|
149
|
-
...a ? { bounds: a } : {}
|
|
150
|
-
},
|
|
151
|
-
layer: {
|
|
152
|
-
id: `${m}-raster`,
|
|
153
|
-
type: "raster",
|
|
154
|
-
paint: { "raster-opacity": 1 }
|
|
155
|
-
},
|
|
156
|
-
beforeId: p.beforeId ?? null
|
|
157
|
-
}), { fitBounds: x } = Te(), $ = h(1);
|
|
158
|
-
S(
|
|
159
|
-
() => p.tileUrl,
|
|
160
|
-
(u) => {
|
|
161
|
-
if (!u) {
|
|
162
|
-
v.setVisible(!1);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
v.setVisible(!0), v.setTiles([u]);
|
|
166
|
-
},
|
|
167
|
-
{ immediate: !0 }
|
|
168
|
-
), S(
|
|
169
|
-
() => $.value,
|
|
170
|
-
(u) => {
|
|
171
|
-
v.setOpacity(u);
|
|
172
|
-
},
|
|
173
|
-
{ immediate: !0 }
|
|
174
|
-
);
|
|
175
|
-
let I = null, k = !1;
|
|
176
|
-
S(
|
|
177
|
-
() => p.extent,
|
|
178
|
-
(u) => {
|
|
179
|
-
if (!u || u.length !== 4) return;
|
|
180
|
-
const y = u.join(",");
|
|
181
|
-
if (y !== I) {
|
|
182
|
-
if (I = y, !k) {
|
|
183
|
-
k = !0;
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
x == null || x([[u[0], u[1]], [u[2], u[3]]], {
|
|
187
|
-
padding: 40,
|
|
188
|
-
maxZoom: 17
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{ immediate: !0 }
|
|
193
|
-
);
|
|
194
|
-
const N = g(() => `${Math.round($.value * 100)}%`);
|
|
195
|
-
return (u, y) => (o(), d("div", _t, [
|
|
196
|
-
s("div", wt, [
|
|
197
|
-
s("div", $t, [
|
|
198
|
-
y[2] || (y[2] = s("span", null, "Прозорість:", -1)),
|
|
199
|
-
ie(s("input", {
|
|
200
|
-
type: "range",
|
|
201
|
-
min: "0",
|
|
202
|
-
max: "1",
|
|
203
|
-
step: "0.01",
|
|
204
|
-
"onUpdate:modelValue": y[0] || (y[0] = (C) => $.value = C),
|
|
205
|
-
class: "h-1 w-28 cursor-pointer appearance-none rounded-full bg-slate-300 focus:outline-none",
|
|
206
|
-
style: { "accent-color": "#3b82f6" }
|
|
207
|
-
}, null, 512), [
|
|
208
|
-
[
|
|
209
|
-
Ee,
|
|
210
|
-
$.value,
|
|
211
|
-
void 0,
|
|
212
|
-
{ number: !0 }
|
|
213
|
-
]
|
|
214
|
-
]),
|
|
215
|
-
s("span", null, c(N.value), 1)
|
|
216
|
-
])
|
|
217
|
-
]),
|
|
218
|
-
s("div", kt, [
|
|
219
|
-
s("label", Ct, [
|
|
220
|
-
s("input", {
|
|
221
|
-
type: "checkbox",
|
|
222
|
-
class: "h-3.5 w-3.5 rounded border-slate-300 text-blue-600 focus:ring-blue-200",
|
|
223
|
-
checked: b.showRasterExtent,
|
|
224
|
-
onChange: y[1] || (y[1] = (C) => u.$emit("toggle-extent", C.target.checked))
|
|
225
|
-
}, null, 40, Rt),
|
|
226
|
-
y[3] || (y[3] = s("span", null, "Межі растру", -1))
|
|
227
|
-
])
|
|
228
|
-
])
|
|
229
|
-
]));
|
|
230
|
-
}
|
|
231
|
-
}), St = { class: "flex h-full bg-gradient-to-br from-slate-50 to-white" }, It = { class: "flex-1 relative overflow-hidden" }, jt = { class: "absolute top-0 left-0 w-full z-20" }, zt = { class: "px-4 sm:px-6 py-4 border-b border-gray-200 bg-white shadow-sm" }, Mt = { class: "flex items-start justify-between gap-4" }, Lt = { class: "flex-1 min-w-0" }, Nt = { class: "flex items-center text-sm text-gray-500 mb-3" }, Ut = { class: "text-gray-900 font-medium truncate max-w-xs" }, qt = { class: "flex items-center justify-between gap-4" }, Bt = { class: "flex-1 min-w-0" }, Tt = { class: "flex items-center gap-3 mb-1" }, Dt = { class: "text-base font-semibold text-gray-900 truncate" }, Pt = ["title"], Ft = { class: "flex items-center gap-4 min-w-0" }, Vt = { class: "flex-1 min-w-0" }, Qt = ["title"], Gt = { class: "w-full h-full bg-gradient-to-br from-sky-50 via-white to-blue-50 flex items-center justify-center relative pt-[105px]" }, At = { class: "relative w-full h-full" }, Ot = { class: "absolute top-4 left-4 z-20" }, Wt = { class: "absolute top-[6.5rem] right-2 space-y-1 z-20" }, Xt = { class: "flex-1 flex flex-col h-full" }, Yt = { class: "px-3 pt-3 pb-2 border-b border-gray-100" }, Kt = { class: "items-center justify-center text-muted-foreground grid w-full grid-cols-3 h-12 p-1 bg-gray-50 rounded-xl shadow-sm" }, Zt = ["aria-selected", "onClick"], Ht = { class: "leading-none" }, Jt = { class: "flex flex-col flex-1 overflow-y-hidden p-3" }, es = {
|
|
232
|
-
key: 0,
|
|
233
|
-
class: "mb-3 text-xs text-slate-500"
|
|
234
|
-
}, ts = {
|
|
235
|
-
key: 1,
|
|
236
|
-
class: "mb-3 text-xs text-rose-600"
|
|
237
|
-
}, ss = "OpenGIS", oe = 2, P = 5, us = /* @__PURE__ */ F({
|
|
238
|
-
__name: "raster",
|
|
239
|
-
setup(b) {
|
|
240
|
-
const p = [
|
|
241
|
-
{ cardClass: "bg-gradient-to-br from-green-50 to-green-100/30 border-green-200", titleClass: "text-green-900" },
|
|
242
|
-
{ cardClass: "bg-gradient-to-br from-blue-50 to-blue-100/30 border-blue-200", titleClass: "text-blue-900" },
|
|
243
|
-
{ cardClass: "bg-gradient-to-br from-purple-50 to-purple-100/30 border-purple-200", titleClass: "text-purple-900" },
|
|
244
|
-
{ cardClass: "bg-gradient-to-br from-gray-50 to-gray-100/30 border-gray-200", titleClass: "text-gray-900" }
|
|
245
|
-
], m = Le(), r = Ne(), a = h(null), v = g(() => {
|
|
246
|
-
var t;
|
|
247
|
-
const e = (t = r.params) == null ? void 0 : t.id;
|
|
248
|
-
return typeof e == "string" ? e : void 0;
|
|
249
|
-
}), x = h(null), $ = h(!1), I = h(!1), k = h(null), N = h(!0);
|
|
250
|
-
let u = null;
|
|
251
|
-
const y = h(!1);
|
|
252
|
-
function C(e) {
|
|
253
|
-
if (Array.isArray(e)) return C(e[0]);
|
|
254
|
-
if (typeof e != "string" && typeof e != "number") return null;
|
|
255
|
-
const t = typeof e == "number" ? e : Number(e.trim());
|
|
256
|
-
return Number.isFinite(t) ? t : null;
|
|
257
|
-
}
|
|
258
|
-
function V(e, t) {
|
|
259
|
-
return e.toFixed(t);
|
|
260
|
-
}
|
|
261
|
-
function Q(e, t, n) {
|
|
262
|
-
const l = 0.5 * 10 ** -n;
|
|
263
|
-
return Math.abs(e - t) > l;
|
|
264
|
-
}
|
|
265
|
-
function G() {
|
|
266
|
-
var e;
|
|
267
|
-
return (e = a.value) == null ? void 0 : e.ctx;
|
|
268
|
-
}
|
|
269
|
-
function X() {
|
|
270
|
-
var w, se, ne, le;
|
|
271
|
-
const e = (se = (w = G()) == null ? void 0 : w.map) == null ? void 0 : se.value;
|
|
272
|
-
if (!e) return;
|
|
273
|
-
const t = C(r.query.z), n = C(r.query.x), l = C(r.query.y);
|
|
274
|
-
if (t == null || n == null || l == null) return;
|
|
275
|
-
const i = (ne = e.getCenter) == null ? void 0 : ne.call(e), f = (le = e.getZoom) == null ? void 0 : le.call(e);
|
|
276
|
-
(!i || Q(i.lng, n, P) || Q(i.lat, l, P) || Q(f ?? 0, t, oe)) && (y.value = !0, e.jumpTo({ center: [n, l], zoom: t }), y.value = !1);
|
|
277
|
-
}
|
|
278
|
-
function ae() {
|
|
279
|
-
var i, f, _, w;
|
|
280
|
-
if (y.value) return;
|
|
281
|
-
const e = (f = (i = G()) == null ? void 0 : i.map) == null ? void 0 : f.value;
|
|
282
|
-
if (!e) return;
|
|
283
|
-
const t = (_ = e.getCenter) == null ? void 0 : _.call(e), n = (w = e.getZoom) == null ? void 0 : w.call(e);
|
|
284
|
-
if (!t || n == null) return;
|
|
285
|
-
const l = {
|
|
286
|
-
...r.query,
|
|
287
|
-
z: V(n, oe),
|
|
288
|
-
x: V(t.lng, P),
|
|
289
|
-
y: V(t.lat, P)
|
|
290
|
-
};
|
|
291
|
-
r.query.z === l.z && r.query.x === l.x && r.query.y === l.y || m.replace({ query: l });
|
|
292
|
-
}
|
|
293
|
-
function ue() {
|
|
294
|
-
var t;
|
|
295
|
-
if (typeof document > "u") return;
|
|
296
|
-
const e = (t = z.value) == null ? void 0 : t.name;
|
|
297
|
-
document.title = e ? `${e} — Растер` : ss;
|
|
298
|
-
}
|
|
299
|
-
const Y = g(() => {
|
|
300
|
-
var t;
|
|
301
|
-
const e = (t = x.value) == null ? void 0 : t.url;
|
|
302
|
-
return e ? /^https?:\/\//i.test(e) || typeof window > "u" || typeof location > "u" ? e : `${location.origin}${e}` : "";
|
|
303
|
-
}), j = g(() => {
|
|
304
|
-
var e;
|
|
305
|
-
return ((e = x.value) == null ? void 0 : e.extent) ?? null;
|
|
306
|
-
}), K = g(() => v.value ? `raster-${v.value}` : void 0), ce = g(() => v.value ? `raster-extent-${v.value}` : "raster-extent"), de = g(() => {
|
|
307
|
-
const e = K.value ?? "raster", t = j.value && j.value.length === 4 ? j.value.join(",") : "no-extent";
|
|
308
|
-
return `${e}-${t}`;
|
|
309
|
-
}), fe = g(() => !!Y.value), Z = g(() => {
|
|
310
|
-
const e = j.value;
|
|
311
|
-
if (!e || e.length !== 4) return null;
|
|
312
|
-
const [t, n, l, i] = e;
|
|
313
|
-
return [t, n, l, i].some(
|
|
314
|
-
(f) => typeof f != "number" || Number.isNaN(f)
|
|
315
|
-
) ? null : [(t + l) / 2, (n + i) / 2];
|
|
316
|
-
}), z = g(() => {
|
|
317
|
-
var f, _;
|
|
318
|
-
const e = x.value, t = e == null ? void 0 : e.extent, l = v.value ?? "—", i = [
|
|
319
|
-
e != null && e.extension ? `Формат ${String(e.extension).toUpperCase()}` : null,
|
|
320
|
-
(e == null ? void 0 : e.resolution) || null
|
|
321
|
-
].filter(Boolean).join(", ");
|
|
322
|
-
return {
|
|
323
|
-
id: l,
|
|
324
|
-
name: (e == null ? void 0 : e.name) || ((_ = (f = e == null ? void 0 : e.files) == null ? void 0 : f[0]) == null ? void 0 : _.name),
|
|
325
|
-
description: (e == null ? void 0 : e.description) || i || "Попередній перегляд растрового шару.",
|
|
326
|
-
coverage: t && t.length === 4 ? `${E(t[0])}, ${E(t[1])} → ${E(t[2])}, ${E(t[3])}` : "Покриття уточнюється",
|
|
327
|
-
crs: e != null && e.srid ? `EPSG:${e.srid}` : "EPSG:4326",
|
|
328
|
-
source: e != null && e.proj4 ? e.proj4 : "Джерело: Mapnik",
|
|
329
|
-
updatedAt: e != null && e.cache ? "Дані кешовано" : "Нові дані"
|
|
330
|
-
};
|
|
331
|
-
}), A = g(() => {
|
|
332
|
-
const e = x.value;
|
|
333
|
-
return e ? [
|
|
334
|
-
e.source_path,
|
|
335
|
-
e.srid ? `SRID: ${e.srid}` : null,
|
|
336
|
-
e.is_public ? "Публічна" : "Не публічна",
|
|
337
|
-
e.is_active ? "Активна" : "Неактивна",
|
|
338
|
-
e.cache ? "Кешовано" : null
|
|
339
|
-
].filter((t) => t).join(", ") : "";
|
|
340
|
-
}), H = [
|
|
341
|
-
{ key: "info", label: "Інформація", icon: ht },
|
|
342
|
-
{ key: "files", label: "Файли", icon: Fe },
|
|
343
|
-
{ key: "metadata", label: "Метадані", icon: Ae }
|
|
344
|
-
], J = H.map((e) => e.key), R = h(J.includes(r.query.tab) ? r.query.tab : "info"), T = h(!0);
|
|
345
|
-
S(() => r.query.tab, (e) => {
|
|
346
|
-
e && J.includes(e) && R.value !== e && (R.value = e);
|
|
347
|
-
}), S(R, (e) => {
|
|
348
|
-
r.query.tab !== e && m.replace({ query: { ...r.query, tab: e } });
|
|
349
|
-
});
|
|
350
|
-
const pe = g(() => ve(x.value)), ee = g(() => ge(x.value));
|
|
351
|
-
S(
|
|
352
|
-
() => x.value,
|
|
353
|
-
() => {
|
|
354
|
-
ue();
|
|
355
|
-
},
|
|
356
|
-
{ immediate: !0 }
|
|
357
|
-
);
|
|
358
|
-
async function me() {
|
|
359
|
-
var l;
|
|
360
|
-
const e = G();
|
|
361
|
-
if (!(e != null && e.ready)) return;
|
|
362
|
-
await e.ready(), X();
|
|
363
|
-
const t = (l = e.map) == null ? void 0 : l.value;
|
|
364
|
-
if (!t) return;
|
|
365
|
-
const n = () => ae();
|
|
366
|
-
t.on("moveend", n), t.on("zoomend", n), u = () => {
|
|
367
|
-
t.off("moveend", n), t.off("zoomend", n);
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
S(
|
|
371
|
-
() => [r.query.z, r.query.x, r.query.y],
|
|
372
|
-
() => {
|
|
373
|
-
X();
|
|
374
|
-
}
|
|
375
|
-
), Se(() => {
|
|
376
|
-
me();
|
|
377
|
-
}), Ie(() => {
|
|
378
|
-
u == null || u(), u = null;
|
|
379
|
-
}), S(v, () => {
|
|
380
|
-
O();
|
|
381
|
-
}, { immediate: !0 });
|
|
382
|
-
async function xe(e) {
|
|
383
|
-
var t;
|
|
384
|
-
O(), ((t = x.value) == null ? void 0 : t.srid) !== e.srid && (D({ title: "XML start", type: "info", message: "зміна системи координат, оновлюємо карту ..." }), await te(`/api/gis-xml/${encodeURIComponent(v.value)}`), D({ title: "XML created", type: "info", message: "карта створена" }), location.reload());
|
|
385
|
-
}
|
|
386
|
-
async function O() {
|
|
387
|
-
const e = v.value;
|
|
388
|
-
if (!e) {
|
|
389
|
-
x.value = null, k.value = null;
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
$.value = !0, k.value = null;
|
|
393
|
-
try {
|
|
394
|
-
const t = await fetch(`/api/gis-raster/${encodeURIComponent(e)}`);
|
|
395
|
-
if (!t.ok)
|
|
396
|
-
throw new Error(`HTTP ${t.status}`);
|
|
397
|
-
const n = await t.json();
|
|
398
|
-
n.xml && (I.value = !0), x.value = n, n.xml || (D({ title: "XML not found", type: "info", message: "йде створення xml ... зачекайте" }), await te(`/api/gis-xml/${encodeURIComponent(e)}`), D({ title: "XML created", type: "info", message: "карта створена" }), fetch(`/api/gis-raster/${encodeURIComponent(e)}?nocache=1`), I.value = !0);
|
|
399
|
-
} catch (t) {
|
|
400
|
-
console.error("Failed to load raster info", t), x.value = null, k.value = t instanceof Error ? t.message : String(t);
|
|
401
|
-
} finally {
|
|
402
|
-
$.value = !1;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
function te(e) {
|
|
406
|
-
return new Promise((t, n) => {
|
|
407
|
-
const l = new EventSource(e), i = [];
|
|
408
|
-
l.onmessage = (f) => {
|
|
409
|
-
i.push(f.data), console.log("Received:", f.data);
|
|
410
|
-
}, l.addEventListener("end", () => {
|
|
411
|
-
l.close(), t(i);
|
|
412
|
-
}), l.onerror = (f) => {
|
|
413
|
-
l.close(), t(f);
|
|
414
|
-
};
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
function ve(e) {
|
|
418
|
-
var t;
|
|
419
|
-
return (t = e == null ? void 0 : e.files) != null && t.length ? e.files.map((n) => ({
|
|
420
|
-
name: n.name,
|
|
421
|
-
resolution: ye(n.name, e),
|
|
422
|
-
size: n.size || "—",
|
|
423
|
-
status: "Готово",
|
|
424
|
-
statusClass: "bg-emerald-50 text-emerald-600 border border-emerald-100"
|
|
425
|
-
})) : [];
|
|
426
|
-
}
|
|
427
|
-
function ye(e, t) {
|
|
428
|
-
const n = e.toLowerCase();
|
|
429
|
-
return n.endsWith(".tfw") ? "Georeference" : n.endsWith(".xml") ? "Опис" : n.endsWith(".tif") || n.endsWith(".tiff") ? t != null && t.resolution ? t.resolution : "Растер" : (t == null ? void 0 : t.resolution) ?? "Файл";
|
|
430
|
-
}
|
|
431
|
-
function ge(e) {
|
|
432
|
-
return e ? {
|
|
433
|
-
baseParams: he(e),
|
|
434
|
-
spatial: {
|
|
435
|
-
crs: {
|
|
436
|
-
code: e.srid ? `EPSG:${e.srid}` : "EPSG:4326",
|
|
437
|
-
description: e.proj4 || "WGS 84 — World Geodetic System 1984"
|
|
438
|
-
},
|
|
439
|
-
bounds: _e(e.extent),
|
|
440
|
-
resolution: we(e)
|
|
441
|
-
},
|
|
442
|
-
statistics: $e(e),
|
|
443
|
-
technical: ke(e)
|
|
444
|
-
} : null;
|
|
445
|
-
}
|
|
446
|
-
function be(e) {
|
|
447
|
-
return e != null && e.length ? e.map((n) => {
|
|
448
|
-
var i;
|
|
449
|
-
if (!n) return "";
|
|
450
|
-
const l = n.trim().split(/\s+/)[0];
|
|
451
|
-
return ((i = l == null ? void 0 : l[0]) == null ? void 0 : i.toUpperCase()) || "";
|
|
452
|
-
}).filter(Boolean).join("") : "";
|
|
453
|
-
}
|
|
454
|
-
function he(e) {
|
|
455
|
-
var f, _;
|
|
456
|
-
const t = e.bands_count ?? ((f = e.bands) == null ? void 0 : f.length) ?? "—", n = be(e.bands), l = (e.bands ?? []).map((w) => w.trim()).filter((w) => w.length > 0), i = l.length ? l.join(", ") : void 0;
|
|
457
|
-
return [
|
|
458
|
-
{
|
|
459
|
-
label: "Розмір растру, px",
|
|
460
|
-
value: e.width && e.height ? `${e.width}×${e.height}` : "—"
|
|
461
|
-
},
|
|
462
|
-
{ label: "Формат файлу", value: ((_ = e.extension) == null ? void 0 : _.toUpperCase()) ?? "—" },
|
|
463
|
-
{ label: "Розмір файлу, mb", value: e.total_size ? `${e.total_size}` : "—" },
|
|
464
|
-
{
|
|
465
|
-
label: "Кількість каналів",
|
|
466
|
-
value: typeof t == "number" ? `${t}${n ? ` (${n})` : ""}` : `${t}${n ? ` (${n})` : ""}`,
|
|
467
|
-
tooltip: i
|
|
468
|
-
},
|
|
469
|
-
{ label: "Глибина кольору", value: e.color_depth ? `${e.color_depth} біт/канал` : "—" },
|
|
470
|
-
{ label: "Стиснення", value: e.compression || "—" }
|
|
471
|
-
];
|
|
472
|
-
}
|
|
473
|
-
function _e(e) {
|
|
474
|
-
return !e || e.length !== 4 ? [] : [
|
|
475
|
-
{ label: "Північ", value: E(e[3], "N") },
|
|
476
|
-
{ label: "Схід", value: E(e[2], "E") },
|
|
477
|
-
{ label: "Південь", value: E(e[1], "S") },
|
|
478
|
-
{ label: "Захід", value: E(e[0], "W") }
|
|
479
|
-
];
|
|
480
|
-
}
|
|
481
|
-
function we(e) {
|
|
482
|
-
const t = [
|
|
483
|
-
{ label: "Роздільна здатність", value: e.resolution || "—" }
|
|
484
|
-
];
|
|
485
|
-
return e.width && e.height && t.push({ label: "Розмір пікселя", value: `${e.width} × ${e.height} px` }), t;
|
|
486
|
-
}
|
|
487
|
-
function $e(e) {
|
|
488
|
-
var t;
|
|
489
|
-
return (t = e.bands) != null && t.length ? e.bands.map((n, l) => {
|
|
490
|
-
const i = p[l % p.length];
|
|
491
|
-
return {
|
|
492
|
-
label: `Канал ${l + 1}${n ? ` (${n})` : ""}`,
|
|
493
|
-
cardClass: i.cardClass,
|
|
494
|
-
titleClass: i.titleClass,
|
|
495
|
-
metrics: [
|
|
496
|
-
{ label: "Назва", value: n || `Канал ${l + 1}` },
|
|
497
|
-
{ label: "Глибина", value: e.color_depth ? `${e.color_depth} біт` : "—" },
|
|
498
|
-
{ label: "Статус", value: e.cache ? "Кешовано" : "Готово" }
|
|
499
|
-
]
|
|
500
|
-
};
|
|
501
|
-
}) : [];
|
|
502
|
-
}
|
|
503
|
-
function ke(e) {
|
|
504
|
-
var t;
|
|
505
|
-
return [
|
|
506
|
-
{ label: "Тип даних", value: e.color_depth ? `Unsigned Integer ${e.color_depth}-bit` : "—" },
|
|
507
|
-
{ label: "Компресія", value: e.compression || "—" },
|
|
508
|
-
{ label: "Кольорова інтерпретація", value: ((t = e.bands) == null ? void 0 : t.join(", ")) || "—" },
|
|
509
|
-
{ label: "SRID", value: e.srid ? `EPSG:${e.srid}` : "—" },
|
|
510
|
-
{ label: "Проекція (proj4)", value: e.proj4 || "—" },
|
|
511
|
-
{ label: "URL тайла", value: e.url || "—" }
|
|
512
|
-
];
|
|
513
|
-
}
|
|
514
|
-
function E(e, t) {
|
|
515
|
-
if (e == null || Number.isNaN(e)) return "—";
|
|
516
|
-
const n = `${e.toFixed(5)}°`;
|
|
517
|
-
return t ? `${n} ${t}` : n;
|
|
518
|
-
}
|
|
519
|
-
return (e, t) => (o(), d("div", St, [
|
|
520
|
-
s("div", It, [
|
|
521
|
-
s("div", jt, [
|
|
522
|
-
s("div", zt, [
|
|
523
|
-
s("div", Mt, [
|
|
524
|
-
s("div", Lt, [
|
|
525
|
-
s("div", Nt, [
|
|
526
|
-
s("button", {
|
|
527
|
-
type: "button",
|
|
528
|
-
class: "hover:text-gray-700 cursor-pointer transition-colors",
|
|
529
|
-
onClick: t[0] || (t[0] = (n) => je(m).push("/gis.rasters"))
|
|
530
|
-
}, " Растри "),
|
|
531
|
-
t[3] || (t[3] = s("svg", {
|
|
532
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
533
|
-
width: "24",
|
|
534
|
-
height: "24",
|
|
535
|
-
viewBox: "0 0 24 24",
|
|
536
|
-
fill: "none",
|
|
537
|
-
stroke: "currentColor",
|
|
538
|
-
"stroke-width": "2",
|
|
539
|
-
"stroke-linecap": "round",
|
|
540
|
-
"stroke-linejoin": "round",
|
|
541
|
-
class: "lucide lucide-chevron-right w-4 h-4 mx-1"
|
|
542
|
-
}, [
|
|
543
|
-
s("path", { d: "m9 18 6-6-6-6" })
|
|
544
|
-
], -1)),
|
|
545
|
-
s("span", Ut, c(z.value.name || "Растер"), 1)
|
|
546
|
-
]),
|
|
547
|
-
s("div", qt, [
|
|
548
|
-
s("div", Bt, [
|
|
549
|
-
s("div", Tt, [
|
|
550
|
-
s("h1", Dt, c(z.value.name || "Растер"), 1)
|
|
551
|
-
]),
|
|
552
|
-
A.value ? (o(), d("p", {
|
|
553
|
-
key: 0,
|
|
554
|
-
class: "text-xs text-gray-500 truncate",
|
|
555
|
-
title: A.value
|
|
556
|
-
}, c(A.value), 9, Pt)) : U("", !0)
|
|
557
|
-
])
|
|
558
|
-
])
|
|
559
|
-
]),
|
|
560
|
-
s("div", Ft, [
|
|
561
|
-
s("div", Vt, [
|
|
562
|
-
s("div", {
|
|
563
|
-
class: "w-full text-xs text-gray-600 truncate",
|
|
564
|
-
title: z.value.description
|
|
565
|
-
}, c(z.value.description), 9, Qt)
|
|
566
|
-
]),
|
|
567
|
-
M(Ve, {
|
|
568
|
-
"entity-id": v.value || "",
|
|
569
|
-
"entity-info": { name: z.value.name },
|
|
570
|
-
table: "gis.rasters.table",
|
|
571
|
-
"entity-label": "Растер",
|
|
572
|
-
"save-method": "put",
|
|
573
|
-
"edit-button-text": "Редагувати",
|
|
574
|
-
onSaved: xe
|
|
575
|
-
}, null, 8, ["entity-id", "entity-info"])
|
|
576
|
-
])
|
|
577
|
-
])
|
|
578
|
-
])
|
|
579
|
-
]),
|
|
580
|
-
s("div", Gt, [
|
|
581
|
-
s("div", At, [
|
|
582
|
-
M(De, {
|
|
583
|
-
ref_key: "mapViewRef",
|
|
584
|
-
ref: a
|
|
585
|
-
}, {
|
|
586
|
-
default: ze(() => [
|
|
587
|
-
fe.value && I.value ? (o(), L(Et, {
|
|
588
|
-
key: de.value,
|
|
589
|
-
"tile-url": Y.value,
|
|
590
|
-
extent: j.value,
|
|
591
|
-
"layer-id": K.value,
|
|
592
|
-
"show-raster-extent": N.value,
|
|
593
|
-
onToggleExtent: t[1] || (t[1] = (n) => N.value = n)
|
|
594
|
-
}, null, 8, ["tile-url", "extent", "layer-id", "show-raster-extent"])) : U("", !0),
|
|
595
|
-
M(Oe, {
|
|
596
|
-
extent: N.value ? j.value : null,
|
|
597
|
-
"layer-id": ce.value
|
|
598
|
-
}, null, 8, ["extent", "layer-id"]),
|
|
599
|
-
s("div", Ot, [
|
|
600
|
-
M(Pe)
|
|
601
|
-
]),
|
|
602
|
-
s("div", Wt, [
|
|
603
|
-
M(re),
|
|
604
|
-
Z.value ? (o(), L(re, {
|
|
605
|
-
key: 0,
|
|
606
|
-
targetCenter: Z.value,
|
|
607
|
-
targetLabel: "Центр даних",
|
|
608
|
-
targetAriaLabel: "Перейти до центру даних"
|
|
609
|
-
}, null, 8, ["targetCenter"])) : U("", !0)
|
|
610
|
-
])
|
|
611
|
-
]),
|
|
612
|
-
_: 1
|
|
613
|
-
}, 512)
|
|
614
|
-
])
|
|
615
|
-
]),
|
|
616
|
-
M(Qe, {
|
|
617
|
-
open: T.value,
|
|
618
|
-
onToggle: t[2] || (t[2] = (n) => T.value = !T.value)
|
|
619
|
-
}, null, 8, ["open"])
|
|
620
|
-
]),
|
|
621
|
-
s("div", {
|
|
622
|
-
class: W(["bg-white border-l border-gray-100 flex flex-col overflow-hidden shadow-lg flex-shrink-0 transition-[width] duration-100 ease-in-out", T.value ? "w-[650px]" : "w-0"])
|
|
623
|
-
}, [
|
|
624
|
-
s("div", Xt, [
|
|
625
|
-
s("div", Yt, [
|
|
626
|
-
s("div", Kt, [
|
|
627
|
-
(o(), d(q, null, B(H, (n) => s("button", {
|
|
628
|
-
key: n.key,
|
|
629
|
-
type: "button",
|
|
630
|
-
role: "tab",
|
|
631
|
-
"aria-selected": R.value === n.key,
|
|
632
|
-
class: W(["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", R.value === n.key ? "bg-white shadow-sm text-gray-700" : ""]),
|
|
633
|
-
onClick: (l) => R.value = n.key
|
|
634
|
-
}, [
|
|
635
|
-
(o(), L(Me(n.icon), { class: "h-3.5 w-3.5 mb-0.5" })),
|
|
636
|
-
s("span", Ht, c(n.label), 1)
|
|
637
|
-
], 10, Zt)), 64))
|
|
638
|
-
])
|
|
639
|
-
]),
|
|
640
|
-
s("div", Jt, [
|
|
641
|
-
$.value ? (o(), d("div", es, " Завантаження метаданих растру… ")) : k.value ? (o(), d("div", ts, " Не вдалося отримати дані: " + c(k.value), 1)) : U("", !0),
|
|
642
|
-
R.value === "files" ? (o(), L(vt, {
|
|
643
|
-
key: 2,
|
|
644
|
-
files: pe.value
|
|
645
|
-
}, null, 8, ["files"])) : R.value === "metadata" ? (o(), L(Ge, {
|
|
646
|
-
key: 3,
|
|
647
|
-
data: x.value,
|
|
648
|
-
"entity-id": v.value,
|
|
649
|
-
"entity-type": "raster",
|
|
650
|
-
onSaved: O
|
|
651
|
-
}, null, 8, ["data", "entity-id"])) : ee.value ? (o(), L(ft, {
|
|
652
|
-
key: 4,
|
|
653
|
-
details: ee.value
|
|
654
|
-
}, null, 8, ["details"])) : U("", !0)
|
|
655
|
-
])
|
|
656
|
-
])
|
|
657
|
-
], 2)
|
|
658
|
-
]));
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
export {
|
|
662
|
-
us as default
|
|
663
|
-
};
|