@opengis/gis 0.2.164 → 0.2.166
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-BZoV9hHZ.js → CardIcon-B-HKyoDs.js} +1 -1
- package/dist/{EntityTablePage-BvEgLON7.js → EntityTablePage-BnAJuEwI.js} +1 -1
- package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-D82X-z0q.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-L9BfGfUU.js} +1 -1
- package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-CmDKSALB.js → HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js} +1 -1
- package/dist/{MapSettings-WRwB36Dm.js → MapSettings-B1lSk4KX.js} +1 -1
- package/dist/{RastersTablePage-D71D-oy4.js → RastersTablePage-aEh696Or.js} +1 -1
- package/dist/{cartocss-DtveuW5e.js → cartocss-BoYdEjtS.js} +5 -5
- package/dist/{import-utils-gA0dsRhG.js → import-utils-HEL359RU.js} +1 -1
- package/dist/{index-lWiWUrDa.js → index-ClqqnPEd.js} +11 -11
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{raster-DVJiO4HK.js → raster-DFD-dtui.js} +3 -3
- package/dist/{register-D1q_RREp.js → register-DMJ_OnzW.js} +3 -3
- package/dist/{service-BnT0jfPh.js → service-FcW2Gvt4.js} +5 -5
- package/dist/{vs-datatable-BmISto2b.js → vs-datatable-C27Dlfo3.js} +1 -1
- package/package.json +2 -1
- package/server/routes/map/controllers/gis.icon.js +33 -15
- package/server/routes/mapnik/controllers/mapnikLogger.js +21 -10
- package/server/routes/mapnik/controllers/rtile.js +28 -12
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as te, resolveDirective as We, openBlock as u, createElementBlock as m, createElementVNode as n, Fragment as W, renderList as X, toDisplayString as d, withDirectives as we, createTextVNode as Xe, normalizeClass as ae, ref as $, watch as S, computed as h, vModelText as Ke, onMounted as Ye, onBeforeUnmount as Ze, createCommentVNode as q, createVNode as B, withCtx as He, createBlock as F, resolveDynamicComponent as Je } from "vue";
|
|
2
2
|
import { useRouter as et, useRoute as tt } from "vue-router";
|
|
3
3
|
import { TooltipDirective as st, notify as M } from "@opengis/core";
|
|
4
|
-
import { _ as nt, u as lt, f as rt, M as ot, i as it, j as be, F as at } from "./index-
|
|
5
|
-
import { _ as ut, a as ct, b as dt, c as ft } from "./HeaderActions.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as he } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as nt, u as lt, f as rt, M as ot, i as it, j as be, F as at } from "./index-ClqqnPEd.js";
|
|
5
|
+
import { _ as ut, a as ct, b as dt, c as ft } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
|
|
6
|
+
import { _ as he } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-L9BfGfUU.js";
|
|
7
7
|
const mt = { class: "flex-1 overflow-y-auto p-4 sm:p-6" }, pt = { class: "space-y-3" }, gt = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, yt = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2" }, vt = { class: "text-xs text-gray-500 mb-1" }, xt = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-base text-md font-semibold text-gray-900"
|
|
@@ -2,9 +2,9 @@ import { defineComponent as B, mergeModels as j, useModel as S, computed as h, d
|
|
|
2
2
|
import { useRoute as Z, useRouter as ee } from "vue-router";
|
|
3
3
|
import { notify as F } from "@opengis/core";
|
|
4
4
|
import { _ as te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
|
|
5
|
-
import { V as N } from "./vs-datatable-
|
|
6
|
-
import { _ as z, n as R, m as E, r as H } from "./import-utils-
|
|
7
|
-
import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-
|
|
5
|
+
import { V as N } from "./vs-datatable-C27Dlfo3.js";
|
|
6
|
+
import { _ as z, n as R, m as E, r as H } from "./import-utils-HEL359RU.js";
|
|
7
|
+
import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-ClqqnPEd.js";
|
|
8
8
|
import { LucideChevronRight as re } from "lucide-vue-next";
|
|
9
9
|
import { _ as ne } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
|
|
10
10
|
const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max container" }, ce = { class: "flex flex-wrap" }, me = { class: "h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6" }, ve = { class: "h-fit w-full flex flex-wrap" }, pe = { class: "w-full" }, fe = /* @__PURE__ */ B({
|
|
@@ -4,12 +4,12 @@ var L = (e, n, t) => pi(e, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { openBlock as _, createElementBlock as M, createElementVNode as g, defineComponent as ae, ref as E, watch as $, createTextVNode as mi, createVNode as D, createBlock as P, createCommentVNode as W, defineAsyncComponent as hi, unref as ze, withCtx as bn, withDirectives as fn, vModelText as dn, normalizeClass as _e, Fragment as kt, renderList as At, toDisplayString as fe, getCurrentInstance as Ct, onBeforeUnmount as wt, toRef as gi, computed as ve, onMounted as yi, resolveDynamicComponent as vi } from "vue";
|
|
5
5
|
import { useRoute as bi, useRouter as xi } from "vue-router";
|
|
6
6
|
import { notify as X } from "@opengis/core";
|
|
7
|
-
import { _ as Xe, u as Ge, f as Si, M as ki, g as Ai, h as Ci, i as wi, j as tt, k as Ti, l as _i, m as Ei, s as it, n as Ii } from "./index-
|
|
8
|
-
import { _ as Ni, a as $i, b as Li, c as Fi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { S as Oi, C as Ri } from "./CardIcon-
|
|
7
|
+
import { _ as Xe, u as Ge, f as Si, M as ki, g as Ai, h as Ci, i as wi, j as tt, k as Ti, l as _i, m as Ei, s as it, n as Ii } from "./index-ClqqnPEd.js";
|
|
8
|
+
import { _ as Ni, a as $i, b as Li, c as Fi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
|
|
9
|
+
import { S as Oi, C as Ri } from "./CardIcon-B-HKyoDs.js";
|
|
10
10
|
import { _ as Tt } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
|
|
11
|
-
import { V as Ze } from "./vs-datatable-
|
|
12
|
-
import { _ as Nn, m as $n, r as $e } from "./import-utils-
|
|
11
|
+
import { V as Ze } from "./vs-datatable-C27Dlfo3.js";
|
|
12
|
+
import { _ as Nn, m as $n, r as $e } from "./import-utils-HEL359RU.js";
|
|
13
13
|
/*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
14
14
|
var T = Symbol("NOT_RESOLVED"), Ln = Symbol("MERGE_KEY");
|
|
15
15
|
function U(e, n) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as F, mergeModels as O, defineAsyncComponent as I, useModel as R, ref as y, watch as K, openBlock as o, createElementBlock as s, createElementVNode as e, createVNode as $, unref as x, withCtx as S, createStaticVNode as V, useSlots as P, computed as H, Fragment as b, createTextVNode as U, createCommentVNode as N, renderList as A, normalizeStyle as Q, toDisplayString as M, normalizeClass as z, withModifiers as X, createBlock as Y, resolveDynamicComponent as ee, withDirectives as te, renderSlot as ne } from "vue";
|
|
2
2
|
import { notify as E } from "@opengis/core";
|
|
3
3
|
import { Edit as le, Trash as oe } from "lucide-vue-next";
|
|
4
|
-
import { _ as u } from "./index-
|
|
4
|
+
import { _ as u } from "./index-ClqqnPEd.js";
|
|
5
5
|
const se = { class: "flex items-center justify-center col-span-3 gap-2" }, re = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ie = /* @__PURE__ */ F({
|
|
6
6
|
__name: "vs-datatable-controls",
|
|
7
7
|
props: /* @__PURE__ */ O({
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import * as solidIcons from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
import sharp from 'sharp';
|
|
7
7
|
|
|
8
|
-
const iconFilenamePattern = /^([a-z][a-z0-9]*)-(s|m|l|xl)-fa-([a-z0-9-]+)\+([a-f0-9]{3,8})\.(png|svg)$/i;
|
|
8
|
+
const iconFilenamePattern = /^([a-z][a-z0-9]*)-(s|m|l|xl)-(fa|ar)-([a-z0-9-]+)\+([a-f0-9]{3,8})\.(png|svg)$/i;
|
|
9
9
|
const validColorLengths = new Set([3, 4, 6, 8]);
|
|
10
10
|
|
|
11
11
|
const iconSizeByCode = {
|
|
@@ -56,14 +56,17 @@ function parseIconFilename(filename) {
|
|
|
56
56
|
const match = iconFilenamePattern.exec(filename);
|
|
57
57
|
if (!match) return null;
|
|
58
58
|
|
|
59
|
-
const [, pinName, sizeCode,
|
|
59
|
+
const [, pinName, sizeCode, iconType, iconValue, hexColor, format] = match;
|
|
60
60
|
if (!validColorLengths.has(hexColor.length)) return null;
|
|
61
61
|
|
|
62
62
|
return {
|
|
63
63
|
filename: filename.toLowerCase(),
|
|
64
64
|
pinName: pinName.toLowerCase(),
|
|
65
65
|
size: iconSizeByCode[sizeCode.toLowerCase()],
|
|
66
|
-
|
|
66
|
+
iconType: iconType.toLowerCase(),
|
|
67
|
+
iconValue: iconType.toLowerCase() === 'fa'
|
|
68
|
+
? iconValue.toLowerCase()
|
|
69
|
+
: iconValue.toUpperCase(),
|
|
67
70
|
color: `#${hexColor}`,
|
|
68
71
|
format: format.toLowerCase(),
|
|
69
72
|
};
|
|
@@ -103,7 +106,7 @@ function getPinPlacement(pinName, width, height) {
|
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
function
|
|
109
|
+
function createFontAwesomeSvg(icon, placement, color) {
|
|
107
110
|
const [width, height, , , pathData] = icon.icon;
|
|
108
111
|
const paths = Array.isArray(pathData) ? pathData : [pathData];
|
|
109
112
|
const x = placement.x - placement.iconSize / 2;
|
|
@@ -114,6 +117,21 @@ function createForegroundSvg(icon, placement, color) {
|
|
|
114
117
|
</svg>`;
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
function createSymbolSvg(symbol, placement, color) {
|
|
121
|
+
const fontSize = Math.round(placement.iconSize * 0.75);
|
|
122
|
+
|
|
123
|
+
return `<text data-gis-icon-layer="foreground" x="${placement.x}" y="${placement.y}" fill="${color}" font-family="Arial, sans-serif" font-size="${fontSize}" font-weight="700" text-anchor="middle" dominant-baseline="middle">${symbol}</text>`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function createForegroundSvg(options, placement) {
|
|
127
|
+
if (options.iconType === 'ar') {
|
|
128
|
+
return createSymbolSvg(options.iconValue, placement, options.color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const icon = findIcon(options.iconValue);
|
|
132
|
+
return icon ? createFontAwesomeSvg(icon, placement, options.color) : null;
|
|
133
|
+
}
|
|
134
|
+
|
|
117
135
|
function setSvgViewport(svg, size, width, height) {
|
|
118
136
|
return svg.replace(/<svg\b([^>]*)>/i, (_, attributes) => {
|
|
119
137
|
const rootAttributes = attributes
|
|
@@ -129,7 +147,7 @@ async function createPinSvg({
|
|
|
129
147
|
pinName,
|
|
130
148
|
size,
|
|
131
149
|
color,
|
|
132
|
-
|
|
150
|
+
...iconOptions
|
|
133
151
|
}) {
|
|
134
152
|
const templatePath = path.join(pinDirectory, `${pinName}.svg`);
|
|
135
153
|
const template = await readFileIfExists(templatePath, 'utf8');
|
|
@@ -142,18 +160,15 @@ async function createPinSvg({
|
|
|
142
160
|
? template.replace(/#ff0000/gi, color)
|
|
143
161
|
: template;
|
|
144
162
|
const svg = setSvgViewport(coloredTemplate, size, width, height);
|
|
145
|
-
const foreground = createForegroundSvg(
|
|
163
|
+
const foreground = createForegroundSvg({ ...iconOptions, color }, placement);
|
|
164
|
+
if (!foreground) return null;
|
|
146
165
|
|
|
147
166
|
return svg.replace(/<\/svg>\s*$/, `${foreground}</svg>`);
|
|
148
167
|
}
|
|
149
168
|
|
|
150
169
|
async function createIcon(options) {
|
|
151
|
-
const icon = findIcon(options.iconName);
|
|
152
|
-
if (!icon) return null;
|
|
153
|
-
|
|
154
170
|
const svg = await createPinSvg({
|
|
155
171
|
...options,
|
|
156
|
-
icon,
|
|
157
172
|
});
|
|
158
173
|
if (!svg) return null;
|
|
159
174
|
if (options.format === 'svg') return Buffer.from(svg);
|
|
@@ -161,12 +176,14 @@ async function createIcon(options) {
|
|
|
161
176
|
return sharp(Buffer.from(svg)).png().toBuffer();
|
|
162
177
|
}
|
|
163
178
|
|
|
164
|
-
async function
|
|
179
|
+
async function getIcon(options, nocache = false) {
|
|
165
180
|
await iconDirectoryReady;
|
|
166
181
|
|
|
167
182
|
const iconPath = path.join(iconDirectory, options.filename);
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
if (!nocache) {
|
|
184
|
+
const cachedIcon = await readFileIfExists(iconPath);
|
|
185
|
+
if (cachedIcon) return cachedIcon;
|
|
186
|
+
}
|
|
170
187
|
|
|
171
188
|
const icon = await createIcon(options);
|
|
172
189
|
if (!icon) return null;
|
|
@@ -179,11 +196,12 @@ export default async function gisIconApi(req, reply) {
|
|
|
179
196
|
const options = parseIconFilename(req.params?.['*'] || '');
|
|
180
197
|
if (!options) return reply.status(400).send('invalid icon name');
|
|
181
198
|
|
|
182
|
-
const
|
|
199
|
+
const nocache = !!req.query?.nocache;
|
|
200
|
+
const image = await getIcon(options, nocache);
|
|
183
201
|
if (!image) return reply.status(404).send('icon not found');
|
|
184
202
|
|
|
185
203
|
return reply
|
|
186
204
|
.type(contentTypeByFormat[options.format])
|
|
187
|
-
.header('Cache-Control', 'public, max-age=31536000, immutable')
|
|
205
|
+
.header('Cache-Control', nocache ? 'no-cache' : 'public, max-age=31536000, immutable')
|
|
188
206
|
.send(image);
|
|
189
207
|
}
|
|
@@ -2,7 +2,15 @@ import { config } from '@opengis/fastify-table/utils.js';
|
|
|
2
2
|
|
|
3
3
|
import mapnik from '../../../plugins/mapnik/funcs/mapnik.js';
|
|
4
4
|
|
|
5
|
-
const { GetLogs } = mapnik();
|
|
5
|
+
const { GetLogs } = mapnik();
|
|
6
|
+
|
|
7
|
+
function sendTextOrJson(reply, contentType, payload) {
|
|
8
|
+
if (typeof payload === 'string' || Buffer.isBuffer(payload)) {
|
|
9
|
+
return reply.type(contentType).send(payload);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return reply.type('application/json').send(payload);
|
|
13
|
+
}
|
|
6
14
|
|
|
7
15
|
export default async function mapnikLogger({
|
|
8
16
|
params,
|
|
@@ -12,18 +20,21 @@ export default async function mapnikLogger({
|
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
const { data, links, err } = await GetLogs({ path: params['*'] });
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
if (err) {
|
|
24
|
+
return reply.status(400).send(err);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (links) {
|
|
28
|
+
if (typeof links !== 'string') {
|
|
29
|
+
return sendTextOrJson(reply, 'text/html; charset=UTF-8', links);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return reply.headers({
|
|
22
33
|
"Content-Type": "text/html; charset=UTF-8",
|
|
23
34
|
"Content-Security-Policy": "default-src 'none'",
|
|
24
35
|
"X-Content-Type-Options": "nosniff",
|
|
25
36
|
}).send(links.replace(/\/api\/gis-logger/g, '/logger-gis'));
|
|
26
37
|
}
|
|
27
38
|
|
|
28
|
-
return reply
|
|
29
|
-
}
|
|
39
|
+
return sendTextOrJson(reply, 'text/plain; charset=UTF-8', data);
|
|
40
|
+
}
|
|
@@ -9,9 +9,13 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import mapnik from '../../../plugins/mapnik/funcs/mapnik.js';
|
|
11
11
|
|
|
12
|
-
const { RenderTile } = mapnik();
|
|
13
|
-
|
|
14
|
-
const mercator = new SphericalMercator({ size: 256 });
|
|
12
|
+
const { RenderTile } = mapnik();
|
|
13
|
+
|
|
14
|
+
const mercator = new SphericalMercator({ size: 256 });
|
|
15
|
+
|
|
16
|
+
function isTrue(value) {
|
|
17
|
+
return value === true || value === 'true' || value === '1';
|
|
18
|
+
}
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Формування растрового tile cartoCss
|
|
@@ -28,14 +32,16 @@ const mercator = new SphericalMercator({ size: 256 });
|
|
|
28
32
|
* @param {String} y - координата x
|
|
29
33
|
*/
|
|
30
34
|
|
|
31
|
-
export default async function gisRtile({
|
|
32
|
-
pg = pgClients.client, params, query, user,
|
|
33
|
-
}, reply) {
|
|
35
|
+
export default async function gisRtile({
|
|
36
|
+
pg = pgClients.client, params, query, user,
|
|
37
|
+
}, reply) {
|
|
34
38
|
if (!RenderTile) {
|
|
35
39
|
return reply.status(400).send({ error: 'mapnik server address needed', code: 400 });
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
const { id, z, y } = params;
|
|
42
|
+
const { id, z, y } = params;
|
|
43
|
+
const nocache = isTrue(query.nocache);
|
|
44
|
+
const nottl = isTrue(query.nottl);
|
|
39
45
|
|
|
40
46
|
const x = params.x.split('.')[0] - 0;
|
|
41
47
|
|
|
@@ -85,8 +91,10 @@ export default async function gisRtile({
|
|
|
85
91
|
const meta = config?.mapnik?.meta ? true : false;
|
|
86
92
|
|
|
87
93
|
try {
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
// ttl: '0' tells the Mapnik service to skip its tile cache and render again.
|
|
95
|
+
const ttl = nocache
|
|
96
|
+
? '0'
|
|
97
|
+
: (data.type === 'css' && !data.is_static ? '1w' : null);
|
|
90
98
|
|
|
91
99
|
const md5 = data.source_path
|
|
92
100
|
? createHash('md5').update(data.source_path).digest('hex')
|
|
@@ -132,10 +140,18 @@ export default async function gisRtile({
|
|
|
132
140
|
const accelPath = result.tile_path?.startsWith('/') ? result.tile_path : `/${result.tile_path}`;
|
|
133
141
|
const metaHeaders = {
|
|
134
142
|
'Content-Type': 'image/webp',
|
|
135
|
-
'Cache-Control':
|
|
143
|
+
'Cache-Control': nocache || nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000',
|
|
136
144
|
'X-Accel-Redirect': accelPath,
|
|
137
145
|
};
|
|
138
|
-
if (query.debug)
|
|
146
|
+
if (query.debug) {
|
|
147
|
+
return reply.type('application/json').send({
|
|
148
|
+
...metaHeaders,
|
|
149
|
+
base64: result.base64,
|
|
150
|
+
z,
|
|
151
|
+
x,
|
|
152
|
+
y,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
139
155
|
reply.headers(metaHeaders);
|
|
140
156
|
return reply.code(204).send();
|
|
141
157
|
}
|
|
@@ -156,7 +172,7 @@ export default async function gisRtile({
|
|
|
156
172
|
|
|
157
173
|
const buffer = result.data || Buffer.from(result.base64, 'base64');
|
|
158
174
|
|
|
159
|
-
return reply.headers({ 'Content-Type': 'image/webp', 'Cache-Control':
|
|
175
|
+
return reply.headers({ 'Content-Type': 'image/webp', 'Cache-Control': nocache || nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000' }).send(buffer);
|
|
160
176
|
}
|
|
161
177
|
catch (err) {
|
|
162
178
|
logger.file('rtile/error', {
|