@opengis/gis 0.1.17 → 0.1.18
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/import-file.cjs +3 -3
- package/dist/import-file.js +20 -25
- package/module/gis/table/gis.maps.table.json +4 -11
- package/module/gis/table/gis.registers.table.json +4 -11
- package/module/gis/table/gis.services.table.json +4 -11
- package/package.json +4 -3
- package/server/routes/gis/index.mjs +2 -1
- package/server/routes/gis/registers/funcs/handleRegistryRequest.js +3 -1
- package/server/routes/gis/registers/gis.registry.js +14 -9
- package/server/routes/map/controllers/mapCatalog.js +5 -1
- package/server/routes/map/controllers/vtile.js +4 -2
package/dist/import-file.js
CHANGED
|
@@ -25083,8 +25083,7 @@ const Pb = { class: "w-full flex flex-col bg-white border border-stone-200 shado
|
|
|
25083
25083
|
default: yr(() => [
|
|
25084
25084
|
v[1] || (v[1] = ei(" Перейти на карту "))
|
|
25085
25085
|
]),
|
|
25086
|
-
_: 1
|
|
25087
|
-
__: [1]
|
|
25086
|
+
_: 1
|
|
25088
25087
|
})
|
|
25089
25088
|
]),
|
|
25090
25089
|
default: yr(() => [
|
|
@@ -30855,8 +30854,7 @@ const B2 = { class: "w-full flex flex-col bg-white border border-stone-200 shado
|
|
|
30855
30854
|
default: yr(() => [
|
|
30856
30855
|
I[1] || (I[1] = ei(" Відкрити бокову панель "))
|
|
30857
30856
|
]),
|
|
30858
|
-
_: 1
|
|
30859
|
-
__: [1]
|
|
30857
|
+
_: 1
|
|
30860
30858
|
})
|
|
30861
30859
|
]),
|
|
30862
30860
|
_: 1
|
|
@@ -31048,8 +31046,7 @@ function dS(u, d, y, x, A, P) {
|
|
|
31048
31046
|
default: yr(() => [
|
|
31049
31047
|
d[0] || (d[0] = re("div", null, "Повернутися до початкових налаштувань", -1))
|
|
31050
31048
|
]),
|
|
31051
|
-
_: 1
|
|
31052
|
-
__: [0]
|
|
31049
|
+
_: 1
|
|
31053
31050
|
})
|
|
31054
31051
|
]);
|
|
31055
31052
|
}
|
|
@@ -31221,8 +31218,7 @@ function xS(u, d, y, x, A, P) {
|
|
|
31221
31218
|
default: yr(() => [
|
|
31222
31219
|
d[0] || (d[0] = re("div", null, "Надрукувати", -1))
|
|
31223
31220
|
]),
|
|
31224
|
-
_: 1
|
|
31225
|
-
__: [0]
|
|
31221
|
+
_: 1
|
|
31226
31222
|
});
|
|
31227
31223
|
}
|
|
31228
31224
|
const bS = /* @__PURE__ */ br(vS, [["render", xS]]), wS = {
|
|
@@ -31277,8 +31273,7 @@ function SS(u, d, y, x, A, P) {
|
|
|
31277
31273
|
default: yr(() => [
|
|
31278
31274
|
d[1] || (d[1] = re("div", null, "Перемикач виду", -1))
|
|
31279
31275
|
]),
|
|
31280
|
-
_: 1
|
|
31281
|
-
__: [1]
|
|
31276
|
+
_: 1
|
|
31282
31277
|
});
|
|
31283
31278
|
}
|
|
31284
31279
|
const AS = /* @__PURE__ */ br(wS, [["render", SS]]), kS = {}, TS = {
|
|
@@ -31498,8 +31493,7 @@ function HS(u, d, y, x, A, P) {
|
|
|
31498
31493
|
default: yr(() => [
|
|
31499
31494
|
d[7] || (d[7] = re("div", null, "Дізнатися геолокацію", -1))
|
|
31500
31495
|
]),
|
|
31501
|
-
_: 1
|
|
31502
|
-
__: [7]
|
|
31496
|
+
_: 1
|
|
31503
31497
|
})
|
|
31504
31498
|
]);
|
|
31505
31499
|
}
|
|
@@ -32259,8 +32253,7 @@ function xA(u, d, y, x, A, P) {
|
|
|
32259
32253
|
default: yr(() => [
|
|
32260
32254
|
d[2] || (d[2] = ei(" Приховати панель "))
|
|
32261
32255
|
]),
|
|
32262
|
-
_: 1
|
|
32263
|
-
__: [2]
|
|
32256
|
+
_: 1
|
|
32264
32257
|
})
|
|
32265
32258
|
]),
|
|
32266
32259
|
re("div", gA, [
|
|
@@ -32305,8 +32298,7 @@ function xA(u, d, y, x, A, P) {
|
|
|
32305
32298
|
default: yr(() => [
|
|
32306
32299
|
d[6] || (d[6] = re("div", null, "Виміряти довжину", -1))
|
|
32307
32300
|
]),
|
|
32308
|
-
_: 1
|
|
32309
|
-
__: [6]
|
|
32301
|
+
_: 1
|
|
32310
32302
|
})
|
|
32311
32303
|
]);
|
|
32312
32304
|
}
|
|
@@ -32607,8 +32599,7 @@ function zA(u, d, y, x, A, P) {
|
|
|
32607
32599
|
default: yr(() => [
|
|
32608
32600
|
d[1] || (d[1] = ei(" Приховати панель "))
|
|
32609
32601
|
]),
|
|
32610
|
-
_: 1
|
|
32611
|
-
__: [1]
|
|
32602
|
+
_: 1
|
|
32612
32603
|
})
|
|
32613
32604
|
]),
|
|
32614
32605
|
re("div", LA, [
|
|
@@ -32645,8 +32636,7 @@ function zA(u, d, y, x, A, P) {
|
|
|
32645
32636
|
default: yr(() => [
|
|
32646
32637
|
d[4] || (d[4] = re("div", null, "Виміряти площу", -1))
|
|
32647
32638
|
]),
|
|
32648
|
-
_: 1
|
|
32649
|
-
__: [4]
|
|
32639
|
+
_: 1
|
|
32650
32640
|
})
|
|
32651
32641
|
]);
|
|
32652
32642
|
}
|
|
@@ -33383,8 +33373,9 @@ const BA = /* @__PURE__ */ br(EA, [["render", zA], ["__scopeId", "data-v-024154e
|
|
|
33383
33373
|
key: 0,
|
|
33384
33374
|
map: y.value,
|
|
33385
33375
|
activeTool: I.value,
|
|
33386
|
-
setActiveTool: Un
|
|
33387
|
-
|
|
33376
|
+
setActiveTool: Un,
|
|
33377
|
+
ref_for: !0
|
|
33378
|
+
}, Ft === "home" ? { initialView: cn.value } : {}, { onCardValuesId: ai }), null, 16, ["map", "activeTool"])) : Yt("", !0)
|
|
33388
33379
|
], 64))), 128))
|
|
33389
33380
|
])) : Yt("", !0)
|
|
33390
33381
|
], 512), [
|
|
@@ -33481,7 +33472,11 @@ const Qy = /* @__PURE__ */ br(jA, [["render", KA]]), GA = {
|
|
|
33481
33472
|
},
|
|
33482
33473
|
table: {
|
|
33483
33474
|
type: String,
|
|
33484
|
-
|
|
33475
|
+
default: ""
|
|
33476
|
+
},
|
|
33477
|
+
slug: {
|
|
33478
|
+
type: String,
|
|
33479
|
+
default: ""
|
|
33485
33480
|
}
|
|
33486
33481
|
},
|
|
33487
33482
|
data() {
|
|
@@ -33512,8 +33507,8 @@ const Qy = /* @__PURE__ */ br(jA, [["render", KA]]), GA = {
|
|
|
33512
33507
|
},
|
|
33513
33508
|
async getData() {
|
|
33514
33509
|
try {
|
|
33515
|
-
const u = this.type === "registry" ?
|
|
33516
|
-
`${u}
|
|
33510
|
+
const u = this.type === "registry" ? `/api/gis-registry/${this.slug}` : `/api/data/${this.table}`, { data: d } = await Zr.get(
|
|
33511
|
+
`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`
|
|
33517
33512
|
);
|
|
33518
33513
|
d && (this.tableData = d == null ? void 0 : d.rows, this.localTotal = this.type === "registry" ? d == null ? void 0 : d.total : d == null ? void 0 : d.filtered);
|
|
33519
33514
|
} catch (u) {
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "map_id",
|
|
3
3
|
"table": "gis.maps",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_at desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description"
|
|
19
12
|
},
|
|
20
|
-
"title":"Тематичні карти",
|
|
13
|
+
"title": "Тематичні карти",
|
|
21
14
|
"form": "gis.maps.form",
|
|
22
15
|
"sql": [
|
|
23
16
|
{
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "register_id",
|
|
3
3
|
"table": "gis.registers",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_at desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description"
|
|
19
12
|
},
|
|
20
|
-
"title":"Реєстри",
|
|
13
|
+
"title": "Реєстри",
|
|
21
14
|
"form": "gis.registers.form",
|
|
22
15
|
"columns": [
|
|
23
16
|
{
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "service_id",
|
|
3
3
|
"table": "gis.services",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_by desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description,source_path"
|
|
19
12
|
},
|
|
20
|
-
"title":"Набори даних",
|
|
13
|
+
"title": "Набори даних",
|
|
21
14
|
"form": "gis.services.form",
|
|
22
15
|
"sqlColumns": "*",
|
|
23
16
|
"columns": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/gis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Softpro",
|
|
6
6
|
"main": "import-file.js",
|
|
@@ -39,15 +39,16 @@
|
|
|
39
39
|
"handlebars": "4.7.8",
|
|
40
40
|
"maplibre-gl": "5.5.0",
|
|
41
41
|
"marked": "15.0.12",
|
|
42
|
+
"monaco-editor": "^0.52.2",
|
|
42
43
|
"vue": "^3.5.13",
|
|
43
44
|
"vue-router": "4.5.1",
|
|
44
45
|
"vue3-smooth-dnd": "0.0.6"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
48
|
-
"vite": "^6.3.5",
|
|
49
49
|
"eslint": "8.49.0",
|
|
50
50
|
"eslint-config-airbnb": "19.0.4",
|
|
51
|
-
"sass-embedded": "1.86.3"
|
|
51
|
+
"sass-embedded": "1.86.3",
|
|
52
|
+
"vite": "^6.3.5"
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -10,7 +10,8 @@ export default async function route(app) {
|
|
|
10
10
|
app.put('/insert-columns/:token', insertColumns);
|
|
11
11
|
app.put('/insert-filters/:token', insertFilters);
|
|
12
12
|
app.get('/gis-registry/:slug', { config: { policy: ['public'] } }, gisRegistry);
|
|
13
|
-
app.get('/gis-registry
|
|
13
|
+
app.get('/gis-registry/:slug/:objectId', { config: { policy: ['public'] } }, gisRegistry);
|
|
14
|
+
app.get('/gis-registry', { config: { policy: ['public'] } }, gisRegistryList);
|
|
14
15
|
app.get('/map-registry/:slug/:id', { config: { policy: ['public'] } }, mapRegistry);
|
|
15
16
|
|
|
16
17
|
app.get('/xml/:id', { config: { policy: ['public'] } }, metadataXML);
|
|
@@ -2,7 +2,7 @@ import { attachClassifiers } from './classifiers.js';
|
|
|
2
2
|
import { extractVisibleColumns } from './columns.js';
|
|
3
3
|
import { getMeta, getFilterSQL } from "@opengis/fastify-table/utils.js";
|
|
4
4
|
|
|
5
|
-
export async function handleRegistryRequest({ settings, query, object_id, offset, limit, page, pg }) {
|
|
5
|
+
export async function handleRegistryRequest({ settings, query, object_id, offset = 0, limit = 16, page = 1, pg }) {
|
|
6
6
|
const { name, table_name, columns, filters, query: whereQuery, order, pk, register_id, is_files } = settings;
|
|
7
7
|
const parsedColumns = Array.isArray(columns) ? columns : JSON.parse(columns);
|
|
8
8
|
const filtersParsed = Array.isArray(filters) ? filters : JSON.parse(filters);
|
|
@@ -39,6 +39,8 @@ export async function handleRegistryRequest({ settings, query, object_id, offset
|
|
|
39
39
|
|
|
40
40
|
await attachClassifiers(row, classifiers);
|
|
41
41
|
|
|
42
|
+
return row;
|
|
43
|
+
|
|
42
44
|
return {
|
|
43
45
|
row,
|
|
44
46
|
columns: columnsInfo,
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { pgClients, getTemplate } from "@opengis/fastify-table/utils.js";
|
|
2
|
+
|
|
2
3
|
import { handleRegistryRequest } from './funcs/handleRegistryRequest.js';
|
|
3
|
-
const pg = pgClients.client;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const maxLimit = 100;
|
|
6
|
+
const defaultLimit = 9;
|
|
7
|
+
|
|
8
|
+
export default async function gisRegistry({
|
|
9
|
+
pg = pgClients.client, params = {}, query = {},
|
|
10
|
+
}) {
|
|
11
|
+
const { slug, objectId } = params;
|
|
12
|
+
|
|
13
|
+
const limit = Math.min(query.limit || defaultLimit, maxLimit);
|
|
14
|
+
const offset = query.page && query.page > 0 && !objectId ? (query.page - 1) * limit : 0;
|
|
10
15
|
|
|
11
16
|
//if (!slug) return reply.code(404).send({ message: 'Params slug is required', status: 404 });
|
|
12
17
|
if (!slug) throw new Error('Params slug is required');
|
|
@@ -19,14 +24,14 @@ export default async function gisRegistry(req = {}) {
|
|
|
19
24
|
WHERE register_key = $1`,
|
|
20
25
|
[slug]
|
|
21
26
|
);
|
|
22
|
-
|
|
27
|
+
|
|
23
28
|
if (registry) {
|
|
24
|
-
return
|
|
29
|
+
return handleRegistryRequest({ settings: registry, query, object_id: objectId, offset, limit, page: query.page, pg });
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
const registryTemplate = await getTemplate('registry', slug);
|
|
28
33
|
//if (!registryTemplate) return reply.code(404).send({ message: 'Template not found', status: 404 });
|
|
29
34
|
if (!registryTemplate) throw new Error('Template not found');
|
|
30
35
|
|
|
31
|
-
return
|
|
36
|
+
return handleRegistryRequest({ settings: registryTemplate, query, object_id: objectId, offset, limit, page: query.page, pg });
|
|
32
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { config, pgClients } from "@opengis/fastify-table/utils.js";
|
|
1
|
+
import { config, pgClients, yml2json } from "@opengis/fastify-table/utils.js";
|
|
2
2
|
|
|
3
3
|
const { prefix = '/api' } = config;
|
|
4
4
|
|
|
@@ -25,6 +25,10 @@ export default async function mapCatalog({ pg = pgClients.client }, reply) {
|
|
|
25
25
|
)
|
|
26
26
|
: {};
|
|
27
27
|
|
|
28
|
+
services.filter(row => row.style).map(row => {
|
|
29
|
+
row.style = yml2json(row.style);
|
|
30
|
+
});
|
|
31
|
+
|
|
28
32
|
services.filter(el => el.bbox).forEach(el => {
|
|
29
33
|
el.bbox = getBBox(el.bbox);
|
|
30
34
|
});
|
|
@@ -5,7 +5,7 @@ import { readFile, stat, mkdir, writeFile } from 'node:fs/promises';
|
|
|
5
5
|
|
|
6
6
|
import Sphericalmercator from '@mapbox/sphericalmercator';
|
|
7
7
|
|
|
8
|
-
import { getTemplate, pgClients, getFilterSQL, getMeta } from '@opengis/fastify-table/utils.js';
|
|
8
|
+
import { getTemplate, pgClients, getFilterSQL, getMeta, yml2json } from '@opengis/fastify-table/utils.js';
|
|
9
9
|
|
|
10
10
|
import rootFolder from '../../../plugins/mapnik/funcs/rootFolder.mjs';
|
|
11
11
|
|
|
@@ -64,7 +64,9 @@ export default async function vtile({ pg = pgClients.client, params = {}, query
|
|
|
64
64
|
return reply.status(404).send('service not found');
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const { source,
|
|
67
|
+
const { source, gt, gc } = data;
|
|
68
|
+
|
|
69
|
+
const style = data.style ? yml2json(data.style) : {};
|
|
68
70
|
|
|
69
71
|
if (!source) {
|
|
70
72
|
return reply.status(400).send('invalid service source path');
|