@phila/layerboard 3.0.0-beta.2 → 3.0.0-beta.5
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/README.md +12 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +1148 -1114
- package/dist/layerboard.css +1 -1
- package/package.json +9 -7
package/dist/index.mjs
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { defineComponent as we, ref as
|
|
1
|
+
import { defineComponent as we, ref as C, watch as Pe, computed as I, onMounted as Ve, onUnmounted as Lt, createElementBlock as w, openBlock as p, createVNode as K, unref as _, withCtx as Ee, createBlock as Y, createCommentVNode as O, Fragment as ie, renderList as se, useAttrs as Ft, toRef as zt, normalizeClass as ne, createElementVNode as P, toDisplayString as j, renderSlot as ae, withDirectives as St, mergeProps as tt, vModelDynamic as Tt, createTextVNode as me, normalizeProps as dt, guardReactiveProps as ft, withModifiers as Et, normalizeStyle as ee, readonly as W, provide as U, resolveComponent as _t, vShow as Ot } from "vue";
|
|
2
2
|
import { Map as It, DrawTool as Rt, RasterLayer as pt, CircleLayer as yt, FillLayer as Dt, LineLayer as Ye, MapMarker as Zt, MapPopup as Bt } from "@phila/phila-ui-map-core";
|
|
3
|
-
import { cn as ot, Icon as
|
|
4
|
-
function
|
|
3
|
+
import { cn as ot, Icon as ue, BaseLink as Vt, ActionContent as gt } from "@phila/phila-ui-core";
|
|
4
|
+
function Ne(e, n, t = {}) {
|
|
5
5
|
const o = { type: "Feature" };
|
|
6
|
-
return (t.id === 0 || t.id) && (o.id = t.id), t.bbox && (o.bbox = t.bbox), o.properties =
|
|
6
|
+
return (t.id === 0 || t.id) && (o.id = t.id), t.bbox && (o.bbox = t.bbox), o.properties = n || {}, o.geometry = e, o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
for (const
|
|
10
|
-
if (
|
|
8
|
+
function At(e, n, t = {}) {
|
|
9
|
+
for (const a of e) {
|
|
10
|
+
if (a.length < 4)
|
|
11
11
|
throw new Error(
|
|
12
12
|
"Each LinearRing of a Polygon must have 4 or more Positions."
|
|
13
13
|
);
|
|
14
|
-
if (
|
|
14
|
+
if (a[a.length - 1].length !== a[0].length)
|
|
15
15
|
throw new Error("First and last Position are not equivalent.");
|
|
16
|
-
for (let
|
|
17
|
-
if (
|
|
16
|
+
for (let l = 0; l < a[a.length - 1].length; l++)
|
|
17
|
+
if (a[a.length - 1][l] !== a[0][l])
|
|
18
18
|
throw new Error("First and last Position are not equivalent.");
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return Ne({
|
|
21
21
|
type: "Polygon",
|
|
22
22
|
coordinates: e
|
|
23
|
-
},
|
|
23
|
+
}, n, t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Nt(e, n, t = {}) {
|
|
26
26
|
if (e.length < 2)
|
|
27
27
|
throw new Error("coordinates must be an array of two or more positions");
|
|
28
|
-
return
|
|
28
|
+
return Ne({
|
|
29
29
|
type: "LineString",
|
|
30
30
|
coordinates: e
|
|
31
|
-
},
|
|
31
|
+
}, n, t);
|
|
32
32
|
}
|
|
33
|
-
function Ut(e,
|
|
34
|
-
return
|
|
33
|
+
function Ut(e, n, t = {}) {
|
|
34
|
+
return Ne({
|
|
35
35
|
type: "MultiLineString",
|
|
36
36
|
coordinates: e
|
|
37
|
-
},
|
|
37
|
+
}, n, t);
|
|
38
38
|
}
|
|
39
|
-
function Wt(e,
|
|
40
|
-
return
|
|
39
|
+
function Wt(e, n, t = {}) {
|
|
40
|
+
return Ne({
|
|
41
41
|
type: "MultiPolygon",
|
|
42
42
|
coordinates: e
|
|
43
|
-
},
|
|
43
|
+
}, n, t);
|
|
44
44
|
}
|
|
45
45
|
function jt(e) {
|
|
46
46
|
return e.type === "Feature" ? e.geometry : e;
|
|
47
47
|
}
|
|
48
|
-
function qt(e,
|
|
49
|
-
var o = e.length,
|
|
50
|
-
let
|
|
48
|
+
function qt(e, n, t) {
|
|
49
|
+
var o = e.length, a = Me(e[0], n), l = [], c, h, f;
|
|
50
|
+
let M, m;
|
|
51
51
|
for (t || (t = []), c = 1; c < o; c++) {
|
|
52
|
-
for (
|
|
53
|
-
if (
|
|
54
|
-
if (
|
|
52
|
+
for (M = e[c - 1], m = e[c], h = f = Me(m, n); ; )
|
|
53
|
+
if (a | h) {
|
|
54
|
+
if (a & h)
|
|
55
55
|
break;
|
|
56
|
-
|
|
56
|
+
a ? (M = nt(M, m, a, n), a = Me(M, n)) : (m = nt(M, m, h, n), h = Me(m, n));
|
|
57
57
|
} else {
|
|
58
|
-
|
|
58
|
+
l.push(M), h !== f ? (l.push(m), c < o - 1 && (t.push(l), l = [])) : c === o - 1 && l.push(m);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
a = f;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return l.length && t.push(l), t;
|
|
64
64
|
}
|
|
65
|
-
function Gt(e,
|
|
66
|
-
var t, o,
|
|
65
|
+
function Gt(e, n) {
|
|
66
|
+
var t, o, a, l, c, h, f;
|
|
67
67
|
for (o = 1; o <= 8; o *= 2) {
|
|
68
|
-
for (t = [],
|
|
69
|
-
|
|
68
|
+
for (t = [], a = e[e.length - 1], l = !(Me(a, n) & o), c = 0; c < e.length; c++)
|
|
69
|
+
h = e[c], f = !(Me(h, n) & o), f !== l && t.push(nt(a, h, o, n)), f && t.push(h), a = h, l = f;
|
|
70
70
|
if (e = t, !e.length) break;
|
|
71
71
|
}
|
|
72
72
|
return t;
|
|
73
73
|
}
|
|
74
|
-
function nt(e,
|
|
75
|
-
return t & 8 ? [e[0] + (
|
|
74
|
+
function nt(e, n, t, o) {
|
|
75
|
+
return t & 8 ? [e[0] + (n[0] - e[0]) * (o[3] - e[1]) / (n[1] - e[1]), o[3]] : t & 4 ? [e[0] + (n[0] - e[0]) * (o[1] - e[1]) / (n[1] - e[1]), o[1]] : t & 2 ? [o[2], e[1] + (n[1] - e[1]) * (o[2] - e[0]) / (n[0] - e[0])] : t & 1 ? [o[0], e[1] + (n[1] - e[1]) * (o[0] - e[0]) / (n[0] - e[0])] : null;
|
|
76
76
|
}
|
|
77
|
-
function Me(e,
|
|
77
|
+
function Me(e, n) {
|
|
78
78
|
var t = 0;
|
|
79
|
-
return e[0] <
|
|
79
|
+
return e[0] < n[0] ? t |= 1 : e[0] > n[2] && (t |= 2), e[1] < n[1] ? t |= 4 : e[1] > n[3] && (t |= 8), t;
|
|
80
80
|
}
|
|
81
|
-
function Ht(e,
|
|
82
|
-
const t = jt(e), o = t.type,
|
|
83
|
-
let
|
|
81
|
+
function Ht(e, n) {
|
|
82
|
+
const t = jt(e), o = t.type, a = e.type === "Feature" ? e.properties : {};
|
|
83
|
+
let l = t.coordinates;
|
|
84
84
|
switch (o) {
|
|
85
85
|
case "LineString":
|
|
86
86
|
case "MultiLineString": {
|
|
87
87
|
const c = [];
|
|
88
|
-
return o === "LineString" && (
|
|
89
|
-
qt(
|
|
90
|
-
}), c.length === 1 ?
|
|
88
|
+
return o === "LineString" && (l = [l]), l.forEach((h) => {
|
|
89
|
+
qt(h, n, c);
|
|
90
|
+
}), c.length === 1 ? Nt(c[0], a) : Ut(c, a);
|
|
91
91
|
}
|
|
92
92
|
case "Polygon":
|
|
93
|
-
return
|
|
93
|
+
return At(ht(l, n), a);
|
|
94
94
|
case "MultiPolygon":
|
|
95
95
|
return Wt(
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
l.map((c) => ht(c, n)),
|
|
97
|
+
a
|
|
98
98
|
);
|
|
99
99
|
default:
|
|
100
100
|
throw new Error("geometry " + o + " not supported");
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function ht(e,
|
|
103
|
+
function ht(e, n) {
|
|
104
104
|
const t = [];
|
|
105
105
|
for (const o of e) {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const a = Gt(o, n);
|
|
107
|
+
a.length > 0 && ((a[0][0] !== a[a.length - 1][0] || a[0][1] !== a[a.length - 1][1]) && a.push(a[0]), a.length >= 4 && t.push(a));
|
|
108
108
|
}
|
|
109
109
|
return t;
|
|
110
110
|
}
|
|
@@ -131,35 +131,35 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
131
131
|
initialCenter: {}
|
|
132
132
|
},
|
|
133
133
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
134
|
-
setup(e, { emit:
|
|
135
|
-
const t = e, o =
|
|
136
|
-
function
|
|
137
|
-
o("zoom",
|
|
138
|
-
}
|
|
139
|
-
function
|
|
140
|
-
const u =
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
const
|
|
144
|
-
async function
|
|
145
|
-
const
|
|
134
|
+
setup(e, { emit: n }) {
|
|
135
|
+
const t = e, o = n, a = C(null), l = C(null), c = C(0);
|
|
136
|
+
function h(i) {
|
|
137
|
+
o("zoom", i), l.value && (c.value = f(l.value));
|
|
138
|
+
}
|
|
139
|
+
function f(i) {
|
|
140
|
+
const u = i.getZoom(), x = i.getCenter().lat, k = 559082264028e-3, z = x * Math.PI / 180;
|
|
141
|
+
return k * Math.cos(z) / Math.pow(2, u);
|
|
142
|
+
}
|
|
143
|
+
const M = C({}), m = C(null), v = C(/* @__PURE__ */ new Set()), s = ["fema-100-year-floodplain", "fema-500-year-floodplain"];
|
|
144
|
+
async function d(i, u, r, x) {
|
|
145
|
+
const k = encodeURIComponent(x || "1=1"), z = JSON.stringify({
|
|
146
146
|
xmin: u.west,
|
|
147
147
|
ymin: u.south,
|
|
148
148
|
xmax: u.east,
|
|
149
149
|
ymax: u.north,
|
|
150
150
|
spatialReference: { wkid: 4326 }
|
|
151
|
-
}),
|
|
152
|
-
let
|
|
153
|
-
for (;
|
|
154
|
-
const G = `${
|
|
151
|
+
}), R = 2e3;
|
|
152
|
+
let V = 0, N = [], X = !0;
|
|
153
|
+
for (; X; ) {
|
|
154
|
+
const G = `${i}/query?where=${k}&geometry=${encodeURIComponent(z)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${R}&resultOffset=${V}&f=geojson`, Z = await fetch(G);
|
|
155
155
|
if (!Z.ok)
|
|
156
156
|
throw new Error(`HTTP ${Z.status}: ${Z.statusText}`);
|
|
157
157
|
const H = await Z.json();
|
|
158
|
-
H.features && H.features.length > 0 ? (
|
|
158
|
+
H.features && H.features.length > 0 ? (N = N.concat(H.features), V += H.features.length, X = H.features.length === R) : X = !1;
|
|
159
159
|
}
|
|
160
160
|
if (s.includes(r)) {
|
|
161
161
|
const G = [u.west, u.south, u.east, u.north];
|
|
162
|
-
|
|
162
|
+
N = N.map((Z) => {
|
|
163
163
|
if (Z.geometry && (Z.geometry.type === "Polygon" || Z.geometry.type === "MultiPolygon"))
|
|
164
164
|
try {
|
|
165
165
|
return Jt(Z, G);
|
|
@@ -171,20 +171,20 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
171
171
|
}
|
|
172
172
|
return {
|
|
173
173
|
type: "FeatureCollection",
|
|
174
|
-
features:
|
|
174
|
+
features: N
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
async function
|
|
177
|
+
async function $(i, u) {
|
|
178
178
|
const r = u.map(async (x) => {
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
179
|
+
const k = t.layerList.find((z) => z.config.id === x)?.config;
|
|
180
|
+
if (k) {
|
|
181
181
|
o("layerLoading", x, !0);
|
|
182
182
|
try {
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
} catch (
|
|
186
|
-
const
|
|
187
|
-
o("layerError", x,
|
|
183
|
+
const z = await d(k.url, i, x, k.where);
|
|
184
|
+
M.value = { ...M.value, [x]: z }, o("layerError", x, null);
|
|
185
|
+
} catch (z) {
|
|
186
|
+
const R = z instanceof Error ? z.message : "Failed to load";
|
|
187
|
+
o("layerError", x, R);
|
|
188
188
|
} finally {
|
|
189
189
|
o("layerLoading", x, !1);
|
|
190
190
|
}
|
|
@@ -192,163 +192,163 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
192
192
|
});
|
|
193
193
|
await Promise.all(r);
|
|
194
194
|
}
|
|
195
|
-
async function
|
|
195
|
+
async function y(i) {
|
|
196
196
|
const u = [...t.visibleLayers];
|
|
197
|
-
await
|
|
197
|
+
await $(i, u);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
199
|
+
function S(i) {
|
|
200
|
+
m.value = i.bounds, y(i.bounds);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
-
const u =
|
|
205
|
-
|
|
202
|
+
function g(i) {
|
|
203
|
+
l.value = i;
|
|
204
|
+
const u = i.getBounds();
|
|
205
|
+
m.value = {
|
|
206
206
|
west: u.getWest(),
|
|
207
207
|
south: u.getSouth(),
|
|
208
208
|
east: u.getEast(),
|
|
209
209
|
north: u.getNorth()
|
|
210
210
|
};
|
|
211
|
-
const r =
|
|
212
|
-
o("zoom", r), c.value =
|
|
211
|
+
const r = i.getZoom();
|
|
212
|
+
o("zoom", r), c.value = f(i), y(m.value);
|
|
213
213
|
}
|
|
214
214
|
Pe(
|
|
215
215
|
() => t.visibleLayers.size,
|
|
216
216
|
async () => {
|
|
217
|
-
if (oe.value.length > 0 && te(),
|
|
218
|
-
const
|
|
219
|
-
(r) => !
|
|
217
|
+
if (oe.value.length > 0 && te(), m.value) {
|
|
218
|
+
const i = new Set(t.visibleLayers), u = [...i].filter(
|
|
219
|
+
(r) => !v.value.has(r)
|
|
220
220
|
);
|
|
221
|
-
|
|
221
|
+
v.value = new Set(i), u.length > 0 && await $(m.value, u);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
|
-
function b(
|
|
226
|
-
return t.visibleLayers.has(
|
|
227
|
-
}
|
|
228
|
-
function E(
|
|
229
|
-
return !!
|
|
230
|
-
}
|
|
231
|
-
const
|
|
232
|
-
() => t.layerList.filter((
|
|
233
|
-
), B =
|
|
234
|
-
() => t.layerList.filter((
|
|
235
|
-
), q =
|
|
236
|
-
() => t.layerList.filter((
|
|
237
|
-
), ce =
|
|
238
|
-
() => t.layerList.filter((
|
|
225
|
+
function b(i) {
|
|
226
|
+
return t.visibleLayers.has(i);
|
|
227
|
+
}
|
|
228
|
+
function E(i) {
|
|
229
|
+
return !!M.value[i.id];
|
|
230
|
+
}
|
|
231
|
+
const T = I(
|
|
232
|
+
() => t.layerList.filter((i) => i.config.type === "circle" && b(i.config.id) && E(i.config)).map((i) => i.config)
|
|
233
|
+
), B = I(
|
|
234
|
+
() => t.layerList.filter((i) => i.config.type === "fill" && b(i.config.id) && E(i.config)).map((i) => i.config)
|
|
235
|
+
), q = I(
|
|
236
|
+
() => t.layerList.filter((i) => i.config.type === "fill" && i.config.outlinePaint && b(i.config.id) && E(i.config)).map((i) => i.config)
|
|
237
|
+
), ce = I(
|
|
238
|
+
() => t.layerList.filter((i) => i.config.type === "line" && b(i.config.id) && E(i.config)).map((i) => i.config)
|
|
239
239
|
);
|
|
240
|
-
function Le(
|
|
241
|
-
return t.visibleTiledLayers?.has(
|
|
240
|
+
function Le(i) {
|
|
241
|
+
return t.visibleTiledLayers?.has(i) ?? !1;
|
|
242
242
|
}
|
|
243
|
-
function Se(
|
|
244
|
-
return t.tiledLayerOpacities?.[
|
|
243
|
+
function Se(i) {
|
|
244
|
+
return t.tiledLayerOpacities?.[i] ?? 1;
|
|
245
245
|
}
|
|
246
|
-
function We(
|
|
247
|
-
return `${
|
|
246
|
+
function We(i) {
|
|
247
|
+
return `${i.replace(/\/$/, "")}/tile/{z}/{y}/{x}`;
|
|
248
248
|
}
|
|
249
|
-
function je(
|
|
249
|
+
function je(i) {
|
|
250
250
|
return {
|
|
251
251
|
type: "raster",
|
|
252
|
-
tiles: [We(
|
|
252
|
+
tiles: [We(i.url)],
|
|
253
253
|
tileSize: 256,
|
|
254
|
-
attribution:
|
|
254
|
+
attribution: i.attribution || ""
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
async function
|
|
259
|
-
if (!
|
|
260
|
-
|
|
257
|
+
const ze = C({}), Ie = C(/* @__PURE__ */ new Set());
|
|
258
|
+
async function Te(i) {
|
|
259
|
+
if (!Ie.value.has(i.id)) {
|
|
260
|
+
Ie.value.add(i.id);
|
|
261
261
|
try {
|
|
262
|
-
const u =
|
|
262
|
+
const u = i.url.replace(/\/$/, ""), r = await fetch(`${u}?f=json`);
|
|
263
263
|
if (!r.ok)
|
|
264
264
|
return;
|
|
265
265
|
const x = await r.json();
|
|
266
|
-
let
|
|
266
|
+
let k = x.minScale || 0, z = x.maxScale || 0;
|
|
267
267
|
if (x.layers && x.layers.length > 0)
|
|
268
|
-
for (const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
...
|
|
272
|
-
[
|
|
268
|
+
for (const R of x.layers)
|
|
269
|
+
R.maxScale && R.maxScale > 0 && (z === 0 || R.maxScale < z) && (z = R.maxScale);
|
|
270
|
+
z === 0 && (z = 72e3), ze.value = {
|
|
271
|
+
...ze.value,
|
|
272
|
+
[i.id]: { minScale: k, maxScale: z }
|
|
273
273
|
};
|
|
274
274
|
} catch {
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
|
|
278
|
+
Ve(() => {
|
|
279
279
|
if (t.tiledLayers)
|
|
280
|
-
for (const
|
|
281
|
-
|
|
280
|
+
for (const i of t.tiledLayers)
|
|
281
|
+
i.scaleBasedRendering && Te(i);
|
|
282
282
|
});
|
|
283
|
-
function
|
|
284
|
-
if (!
|
|
283
|
+
function Re(i) {
|
|
284
|
+
if (!i.scaleBasedRendering)
|
|
285
285
|
return "tiled";
|
|
286
|
-
const u =
|
|
286
|
+
const u = ze.value[i.id];
|
|
287
287
|
if (!u)
|
|
288
288
|
return "tiled";
|
|
289
289
|
const r = c.value;
|
|
290
290
|
return r === 0 || r > u.maxScale ? "tiled" : "dynamic";
|
|
291
291
|
}
|
|
292
|
-
const qe =
|
|
293
|
-
function Ce(
|
|
292
|
+
const qe = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => Le(i.id) ? i.scaleBasedRendering ? Re(i) === "tiled" : !0 : !1) : []), Ge = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => Le(i.id) && i.scaleBasedRendering ? Re(i) === "dynamic" : !1) : []);
|
|
293
|
+
function Ce(i) {
|
|
294
294
|
return {
|
|
295
295
|
type: "raster",
|
|
296
|
-
tiles: [`${
|
|
296
|
+
tiles: [`${i.url.replace(/\/$/, "")}/export?bbox={bbox-epsg-3857}&bboxSR=3857&imageSR=3857&size=256,256&format=png32&transparent=true&f=image`],
|
|
297
297
|
tileSize: 256,
|
|
298
|
-
attribution:
|
|
298
|
+
attribution: i.attribution || ""
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
return { type: "geojson", data:
|
|
301
|
+
function fe(i) {
|
|
302
|
+
return { type: "geojson", data: M.value[i.id] };
|
|
303
303
|
}
|
|
304
|
-
function ke(
|
|
305
|
-
return t.layerOpacities[
|
|
304
|
+
function ke(i) {
|
|
305
|
+
return t.layerOpacities[i] ?? 1;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const u = ke(
|
|
309
|
-
if (
|
|
310
|
-
return { ...
|
|
311
|
-
const x =
|
|
312
|
-
if (
|
|
307
|
+
function pe(i) {
|
|
308
|
+
const u = ke(i.id), r = i.type === "circle" ? "circle-opacity" : i.type === "fill" ? "fill-opacity" : "line-opacity";
|
|
309
|
+
if (i.type === "fill" && i.paint["fill-opacity"] === 0)
|
|
310
|
+
return { ...i.paint, "fill-opacity": 0 };
|
|
311
|
+
const x = i.type === "circle" ? "circle-color" : i.type === "fill" ? "fill-color" : "line-color", k = { ...i.paint }, z = k[x], R = k[r] === 1, V = typeof z == "string" && z.startsWith("rgba(");
|
|
312
|
+
if (R && V) {
|
|
313
313
|
if (u === 1)
|
|
314
|
-
return
|
|
314
|
+
return k;
|
|
315
315
|
{
|
|
316
|
-
const
|
|
317
|
-
if (
|
|
318
|
-
const [,
|
|
319
|
-
|
|
316
|
+
const N = z.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
317
|
+
if (N && N[4]) {
|
|
318
|
+
const [, X, G, Z, H] = N, Xe = parseFloat(H) * u;
|
|
319
|
+
k[x] = `rgba(${X}, ${G}, ${Z}, ${Xe})`, k[r] = 1;
|
|
320
320
|
}
|
|
321
|
-
return
|
|
321
|
+
return k;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
const [,
|
|
328
|
-
|
|
324
|
+
if (V) {
|
|
325
|
+
const N = z.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
326
|
+
if (N) {
|
|
327
|
+
const [, X, G, Z] = N;
|
|
328
|
+
k[x] = `rgb(${X}, ${G}, ${Z})`;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
return
|
|
331
|
+
return k[r] = u, k;
|
|
332
332
|
}
|
|
333
|
-
function He(
|
|
334
|
-
const u = ke(
|
|
335
|
-
return { ...
|
|
333
|
+
function He(i) {
|
|
334
|
+
const u = ke(i.id);
|
|
335
|
+
return { ...i.outlinePaint, "line-opacity": u };
|
|
336
336
|
}
|
|
337
|
-
const oe =
|
|
338
|
-
function $e(
|
|
339
|
-
const u =
|
|
337
|
+
const oe = C([]), ye = C(null), J = C(0);
|
|
338
|
+
function $e(i) {
|
|
339
|
+
const u = i.replace(/-outline$/, "");
|
|
340
340
|
return t.layerList.find((x) => x.config.id === u)?.config;
|
|
341
341
|
}
|
|
342
|
-
function ve(
|
|
343
|
-
return
|
|
344
|
-
const
|
|
345
|
-
return
|
|
342
|
+
function ve(i, u) {
|
|
343
|
+
return i.replace(/\{([^}]+)\}/g, (r, x) => {
|
|
344
|
+
const k = u[x];
|
|
345
|
+
return k == null ? "" : String(k);
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
function Je(
|
|
349
|
-
if (
|
|
350
|
-
if (u?.dateFormat && typeof
|
|
351
|
-
const r = new Date(
|
|
348
|
+
function Je(i, u) {
|
|
349
|
+
if (i == null) return "-";
|
|
350
|
+
if (u?.dateFormat && typeof i == "number") {
|
|
351
|
+
const r = new Date(i);
|
|
352
352
|
switch (u.dateFormat) {
|
|
353
353
|
case "shortDateShortTime":
|
|
354
354
|
return r.toLocaleString();
|
|
@@ -362,51 +362,51 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
362
362
|
return r.toLocaleDateString();
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
if (typeof
|
|
366
|
-
if (
|
|
367
|
-
return new Date(
|
|
365
|
+
if (typeof i == "number") {
|
|
366
|
+
if (i > 1e12 && !u)
|
|
367
|
+
return new Date(i).toLocaleDateString();
|
|
368
368
|
const r = u?.places, x = u?.digitSeparator ?? !0;
|
|
369
369
|
if (r !== void 0) {
|
|
370
|
-
const
|
|
370
|
+
const k = i.toFixed(r);
|
|
371
371
|
if (x) {
|
|
372
|
-
const
|
|
373
|
-
return
|
|
372
|
+
const z = k.split("."), R = z[0] || "0", V = z[1], N = R.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
373
|
+
return V ? `${N}.${V}` : N;
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return k;
|
|
376
376
|
}
|
|
377
|
-
return x ?
|
|
377
|
+
return x ? i.toLocaleString() : String(i);
|
|
378
378
|
}
|
|
379
|
-
return String(
|
|
379
|
+
return String(i);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function De(i) {
|
|
382
382
|
const u = /* @__PURE__ */ new Set();
|
|
383
|
-
return
|
|
384
|
-
const
|
|
385
|
-
return u.has(
|
|
383
|
+
return i.filter((r) => {
|
|
384
|
+
const k = `${r.layer.id.replace(/-outline$/, "")}:${JSON.stringify(r.properties)}`;
|
|
385
|
+
return u.has(k) ? !1 : (u.add(k), !0);
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function ge(i, u) {
|
|
389
389
|
const r = /* @__PURE__ */ new Map();
|
|
390
|
-
return u.forEach((x,
|
|
391
|
-
r.set(x.id,
|
|
392
|
-
}),
|
|
393
|
-
const
|
|
394
|
-
return (r.get(
|
|
390
|
+
return u.forEach((x, k) => {
|
|
391
|
+
r.set(x.id, k);
|
|
392
|
+
}), i.sort((x, k) => {
|
|
393
|
+
const z = x.layer.id.replace(/-outline$/, ""), R = k.layer.id.replace(/-outline$/, ""), V = r.get(z) ?? -1;
|
|
394
|
+
return (r.get(R) ?? -1) - V;
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
function xe(
|
|
398
|
-
const u =
|
|
397
|
+
function xe(i) {
|
|
398
|
+
const u = l.value;
|
|
399
399
|
if (!u) return;
|
|
400
400
|
const r = [];
|
|
401
401
|
t.layerList.forEach((G) => {
|
|
402
402
|
const Z = G.config;
|
|
403
403
|
t.visibleLayers.has(Z.id) && (r.push(Z.id), Z.outlinePaint && r.push(`${Z.id}-outline`));
|
|
404
404
|
});
|
|
405
|
-
const x = u.project([
|
|
405
|
+
const x = u.project([i.lngLat.lng, i.lngLat.lat]), k = u.queryRenderedFeatures(x, {
|
|
406
406
|
layers: r
|
|
407
407
|
});
|
|
408
|
-
if (
|
|
409
|
-
const
|
|
408
|
+
if (k.length === 0) return;
|
|
409
|
+
const z = De(k), R = t.layerList.map((G) => G.config), V = ge(z, R), N = V.map((G) => {
|
|
410
410
|
const Z = G.layer.id.replace(/-outline$/, ""), H = $e(Z);
|
|
411
411
|
return H ? {
|
|
412
412
|
layerId: H.id,
|
|
@@ -415,78 +415,78 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
415
415
|
popupConfig: H.popup
|
|
416
416
|
} : null;
|
|
417
417
|
}).filter((G) => G !== null);
|
|
418
|
-
if (
|
|
419
|
-
oe.value =
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
422
|
-
const G =
|
|
418
|
+
if (N.length === 0) return;
|
|
419
|
+
oe.value = N, J.value = 0, ye.value = [i.lngLat.lng, i.lngLat.lat];
|
|
420
|
+
const X = V[0];
|
|
421
|
+
if (X && X.geometry) {
|
|
422
|
+
const G = X.layer.id.replace(/-outline$/, ""), Z = $e(G);
|
|
423
423
|
if (Z) {
|
|
424
|
-
const H = rt(
|
|
425
|
-
|
|
426
|
-
geometry:
|
|
424
|
+
const H = rt(X.geometry), Xe = st(Z.id, Z.type);
|
|
425
|
+
he.value = {
|
|
426
|
+
geometry: X.geometry,
|
|
427
427
|
geometryType: H,
|
|
428
428
|
layerId: Z.id,
|
|
429
|
-
properties:
|
|
429
|
+
properties: X.properties || {},
|
|
430
430
|
originalStyle: Xe
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
function te() {
|
|
436
|
-
oe.value = [],
|
|
436
|
+
oe.value = [], ye.value = null, J.value = 0, he.value = null;
|
|
437
437
|
}
|
|
438
|
-
function be(
|
|
438
|
+
function be(i) {
|
|
439
439
|
if (oe.value.length === 0) return;
|
|
440
|
-
const u =
|
|
440
|
+
const u = i.target;
|
|
441
441
|
if (!(u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.isContentEditable))
|
|
442
|
-
switch (
|
|
442
|
+
switch (i.key) {
|
|
443
443
|
case "ArrowLeft":
|
|
444
444
|
case "ArrowUp":
|
|
445
|
-
|
|
445
|
+
i.preventDefault(), Ze();
|
|
446
446
|
break;
|
|
447
447
|
case "ArrowRight":
|
|
448
448
|
case "ArrowDown":
|
|
449
|
-
|
|
449
|
+
i.preventDefault(), le();
|
|
450
450
|
break;
|
|
451
451
|
case "Escape":
|
|
452
|
-
|
|
452
|
+
i.preventDefault(), te();
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
Ve(() => {
|
|
457
457
|
window.addEventListener("keydown", be);
|
|
458
458
|
}), Lt(() => {
|
|
459
459
|
window.removeEventListener("keydown", be);
|
|
460
460
|
});
|
|
461
461
|
function le() {
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
function
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
const L =
|
|
470
|
-
const
|
|
471
|
-
return !
|
|
472
|
-
}),
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
462
|
+
const i = oe.value.length;
|
|
463
|
+
i <= 1 || (J.value = (J.value + 1) % i);
|
|
464
|
+
}
|
|
465
|
+
function Ze() {
|
|
466
|
+
const i = oe.value.length;
|
|
467
|
+
i <= 1 || (J.value = (J.value - 1 + i) % i);
|
|
468
|
+
}
|
|
469
|
+
const L = I(() => oe.value.length === 0 ? null : oe.value[J.value]), F = I(() => {
|
|
470
|
+
const i = L.value;
|
|
471
|
+
return !i || !i.popupConfig ? i?.layerTitle || "" : ve(i.popupConfig.title, i.properties);
|
|
472
|
+
}), re = I(() => {
|
|
473
|
+
const i = L.value;
|
|
474
|
+
if (!i) return "";
|
|
475
475
|
let u = '<div class="popup-content">';
|
|
476
|
-
if (u += `<h3 class="popup-title">${
|
|
476
|
+
if (u += `<h3 class="popup-title">${F.value}</h3>`, i.popupConfig?.fields?.length) {
|
|
477
477
|
u += '<table class="popup-table">';
|
|
478
|
-
for (const r of
|
|
479
|
-
const x = Je(
|
|
478
|
+
for (const r of i.popupConfig.fields) {
|
|
479
|
+
const x = Je(i.properties[r.field], r.format);
|
|
480
480
|
u += `<tr><th>${r.label}</th><td>${x}</td></tr>`;
|
|
481
481
|
}
|
|
482
482
|
u += "</table>";
|
|
483
483
|
} else
|
|
484
484
|
u += '<p class="popup-no-fields">No additional information available.</p>';
|
|
485
485
|
return u += "</div>", u;
|
|
486
|
-
}),
|
|
486
|
+
}), A = C({
|
|
487
487
|
type: "FeatureCollection",
|
|
488
488
|
features: []
|
|
489
|
-
}), Q =
|
|
489
|
+
}), Q = C({
|
|
490
490
|
type: "FeatureCollection",
|
|
491
491
|
features: []
|
|
492
492
|
}), Qe = {
|
|
@@ -499,90 +499,90 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
499
499
|
"line-width": ["get", "highlightWidth"],
|
|
500
500
|
"line-color": "#00FFFF",
|
|
501
501
|
"line-opacity": 0.9
|
|
502
|
-
},
|
|
503
|
-
function rt(
|
|
504
|
-
return
|
|
502
|
+
}, he = C(null);
|
|
503
|
+
function rt(i) {
|
|
504
|
+
return i.type;
|
|
505
505
|
}
|
|
506
|
-
function st(
|
|
507
|
-
const r = $e(
|
|
506
|
+
function st(i, u) {
|
|
507
|
+
const r = $e(i);
|
|
508
508
|
if (!r) return { radius: 5, width: 2 };
|
|
509
509
|
const x = r.paint || {};
|
|
510
510
|
if (u === "circle") {
|
|
511
|
-
const
|
|
512
|
-
return typeof
|
|
511
|
+
const k = x["circle-radius"];
|
|
512
|
+
return typeof k == "number" ? { radius: k } : { radius: 5 };
|
|
513
513
|
}
|
|
514
514
|
if (u === "line" || u === "fill") {
|
|
515
|
-
const
|
|
516
|
-
if (typeof
|
|
517
|
-
return { width:
|
|
515
|
+
const k = x["line-width"];
|
|
516
|
+
if (typeof k == "number")
|
|
517
|
+
return { width: k };
|
|
518
518
|
if (r.outlinePaint && r.outlinePaint["line-width"]) {
|
|
519
|
-
const
|
|
520
|
-
if (typeof
|
|
521
|
-
return { width:
|
|
519
|
+
const z = r.outlinePaint["line-width"];
|
|
520
|
+
if (typeof z == "number")
|
|
521
|
+
return { width: z };
|
|
522
522
|
}
|
|
523
523
|
return { width: 2 };
|
|
524
524
|
}
|
|
525
525
|
return { radius: 5, width: 2 };
|
|
526
526
|
}
|
|
527
|
-
function ct(
|
|
528
|
-
return !
|
|
527
|
+
function ct(i) {
|
|
528
|
+
return !i || i.length === 0 ? [] : i[0] ?? [];
|
|
529
529
|
}
|
|
530
|
-
function $t(
|
|
531
|
-
const { geometry: u, geometryType: r, originalStyle: x } =
|
|
530
|
+
function $t(i) {
|
|
531
|
+
const { geometry: u, geometryType: r, originalStyle: x } = i;
|
|
532
532
|
if (r === "Point" || r === "MultiPoint") {
|
|
533
|
-
const
|
|
533
|
+
const z = (x.radius || 5) + 3;
|
|
534
534
|
return {
|
|
535
535
|
type: "FeatureCollection",
|
|
536
536
|
features: [{
|
|
537
537
|
type: "Feature",
|
|
538
538
|
geometry: u,
|
|
539
539
|
properties: {
|
|
540
|
-
highlightRadius:
|
|
540
|
+
highlightRadius: z
|
|
541
541
|
}
|
|
542
542
|
}]
|
|
543
543
|
};
|
|
544
544
|
}
|
|
545
545
|
if (r === "LineString" || r === "MultiLineString") {
|
|
546
|
-
const
|
|
546
|
+
const z = (x.width || 2) + 3;
|
|
547
547
|
return {
|
|
548
548
|
type: "FeatureCollection",
|
|
549
549
|
features: [{
|
|
550
550
|
type: "Feature",
|
|
551
551
|
geometry: u,
|
|
552
552
|
properties: {
|
|
553
|
-
highlightWidth:
|
|
553
|
+
highlightWidth: z
|
|
554
554
|
}
|
|
555
555
|
}]
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
558
|
if (r === "Polygon") {
|
|
559
|
-
const
|
|
559
|
+
const k = u.coordinates, z = ct(k), V = (x.width || 2) + 3;
|
|
560
560
|
return {
|
|
561
561
|
type: "FeatureCollection",
|
|
562
562
|
features: [{
|
|
563
563
|
type: "Feature",
|
|
564
564
|
geometry: {
|
|
565
565
|
type: "LineString",
|
|
566
|
-
coordinates:
|
|
566
|
+
coordinates: z
|
|
567
567
|
},
|
|
568
568
|
properties: {
|
|
569
|
-
highlightWidth:
|
|
569
|
+
highlightWidth: V
|
|
570
570
|
}
|
|
571
571
|
}]
|
|
572
572
|
};
|
|
573
573
|
}
|
|
574
574
|
if (r === "MultiPolygon") {
|
|
575
|
-
const
|
|
575
|
+
const k = u.coordinates, R = (x.width || 2) + 3;
|
|
576
576
|
return {
|
|
577
577
|
type: "FeatureCollection",
|
|
578
|
-
features:
|
|
578
|
+
features: k.map((N) => ({
|
|
579
579
|
type: "Feature",
|
|
580
580
|
geometry: {
|
|
581
581
|
type: "LineString",
|
|
582
|
-
coordinates: ct(
|
|
582
|
+
coordinates: ct(N)
|
|
583
583
|
},
|
|
584
584
|
properties: {
|
|
585
|
-
highlightWidth:
|
|
585
|
+
highlightWidth: R
|
|
586
586
|
}
|
|
587
587
|
}))
|
|
588
588
|
};
|
|
@@ -592,64 +592,64 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
592
592
|
features: []
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
|
-
function xt(
|
|
596
|
-
if (!
|
|
595
|
+
function xt(i) {
|
|
596
|
+
if (!i) {
|
|
597
597
|
Pt();
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
|
-
const u = $t(
|
|
601
|
-
|
|
600
|
+
const u = $t(i);
|
|
601
|
+
i.geometryType === "Point" || i.geometryType === "MultiPoint" ? (A.value = u, Q.value = { type: "FeatureCollection", features: [] }) : (Q.value = u, A.value = { type: "FeatureCollection", features: [] });
|
|
602
602
|
}
|
|
603
603
|
function Pt() {
|
|
604
|
-
|
|
604
|
+
A.value = { type: "FeatureCollection", features: [] }, Q.value = { type: "FeatureCollection", features: [] };
|
|
605
605
|
}
|
|
606
|
-
Pe(
|
|
607
|
-
xt(
|
|
606
|
+
Pe(he, (i) => {
|
|
607
|
+
xt(i);
|
|
608
608
|
}), Pe(
|
|
609
609
|
() => t.visibleLayers,
|
|
610
|
-
(
|
|
611
|
-
|
|
610
|
+
(i) => {
|
|
611
|
+
he.value && !i.has(he.value.layerId) && (he.value = null, te());
|
|
612
612
|
},
|
|
613
613
|
{ deep: !0 }
|
|
614
614
|
), Pe(J, () => {
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
617
|
-
|
|
615
|
+
const i = L.value;
|
|
616
|
+
if (!i) {
|
|
617
|
+
he.value = null;
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
|
-
const u =
|
|
621
|
-
if (!u || !
|
|
620
|
+
const u = l.value;
|
|
621
|
+
if (!u || !ye.value) return;
|
|
622
622
|
const r = [];
|
|
623
|
-
t.layerList.forEach((
|
|
624
|
-
const
|
|
625
|
-
t.visibleLayers.has(
|
|
623
|
+
t.layerList.forEach((R) => {
|
|
624
|
+
const V = R.config;
|
|
625
|
+
t.visibleLayers.has(V.id) && (r.push(V.id), V.outlinePaint && r.push(`${V.id}-outline`));
|
|
626
626
|
});
|
|
627
|
-
const x = u.project(
|
|
627
|
+
const x = u.project(ye.value), z = u.queryRenderedFeatures(x, {
|
|
628
628
|
layers: r
|
|
629
|
-
}).find((
|
|
630
|
-
if (
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
geometry:
|
|
636
|
-
geometryType:
|
|
637
|
-
layerId:
|
|
638
|
-
properties:
|
|
639
|
-
originalStyle:
|
|
629
|
+
}).find((R) => R.layer.id.replace(/-outline$/, "") === i.layerId && JSON.stringify(R.properties) === JSON.stringify(i.properties));
|
|
630
|
+
if (z && z.geometry) {
|
|
631
|
+
const R = $e(i.layerId);
|
|
632
|
+
if (R) {
|
|
633
|
+
const V = rt(z.geometry), N = st(R.id, R.type);
|
|
634
|
+
he.value = {
|
|
635
|
+
geometry: z.geometry,
|
|
636
|
+
geometryType: V,
|
|
637
|
+
layerId: R.id,
|
|
638
|
+
properties: z.properties || {},
|
|
639
|
+
originalStyle: N
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
const ut =
|
|
645
|
-
function Mt(
|
|
646
|
-
const [u, r] =
|
|
644
|
+
const ut = C(null);
|
|
645
|
+
function Mt(i) {
|
|
646
|
+
const [u, r] = i.geometry.coordinates;
|
|
647
647
|
ut.value = [u, r];
|
|
648
648
|
}
|
|
649
|
-
return (
|
|
650
|
-
|
|
649
|
+
return (i, u) => (p(), w("div", Qt, [
|
|
650
|
+
K(_(It), {
|
|
651
651
|
ref_key: "mapRef",
|
|
652
|
-
ref:
|
|
652
|
+
ref: a,
|
|
653
653
|
zoom: t.initialZoom,
|
|
654
654
|
center: t.initialCenter,
|
|
655
655
|
"navigation-controls": { position: t.navigationControlPosition },
|
|
@@ -664,18 +664,18 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
664
664
|
"pictometry-button-position": t.pictometryButtonPosition,
|
|
665
665
|
"tool-panel-layout": "vertical",
|
|
666
666
|
"tool-panel-split-ratio": 50,
|
|
667
|
-
onZoom:
|
|
667
|
+
onZoom: h,
|
|
668
668
|
onClick: te,
|
|
669
|
-
onMoveend:
|
|
670
|
-
onLoad:
|
|
669
|
+
onMoveend: S,
|
|
670
|
+
onLoad: g,
|
|
671
671
|
onSearchResult: Mt
|
|
672
672
|
}, {
|
|
673
|
-
default:
|
|
674
|
-
t.drawControlPosition !== null ? (
|
|
673
|
+
default: Ee(() => [
|
|
674
|
+
t.drawControlPosition !== null ? (p(), Y(_(Rt), {
|
|
675
675
|
key: 0,
|
|
676
676
|
position: t.drawControlPosition
|
|
677
677
|
}, null, 8, ["position"])) : O("", !0),
|
|
678
|
-
(
|
|
678
|
+
(p(!0), w(ie, null, se(qe.value, (r) => (p(), Y(_(pt), {
|
|
679
679
|
key: "tiled-" + r.id,
|
|
680
680
|
id: "tiled-" + r.id,
|
|
681
681
|
source: je(r),
|
|
@@ -683,7 +683,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
683
683
|
minzoom: r.minZoom,
|
|
684
684
|
maxzoom: r.maxZoom
|
|
685
685
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
686
|
-
(
|
|
686
|
+
(p(!0), w(ie, null, se(Ge.value, (r) => (p(), Y(_(pt), {
|
|
687
687
|
key: "dynamic-" + r.id,
|
|
688
688
|
id: "dynamic-" + r.id,
|
|
689
689
|
source: Ce(r),
|
|
@@ -691,66 +691,66 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
691
691
|
minzoom: r.minZoom,
|
|
692
692
|
maxzoom: r.maxZoom
|
|
693
693
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
694
|
-
(
|
|
694
|
+
(p(!0), w(ie, null, se(T.value, (r) => (p(), Y(_(yt), {
|
|
695
695
|
key: r.id,
|
|
696
696
|
id: r.id,
|
|
697
|
-
source:
|
|
698
|
-
paint:
|
|
697
|
+
source: fe(r),
|
|
698
|
+
paint: pe(r),
|
|
699
699
|
minzoom: r.minZoom,
|
|
700
700
|
maxzoom: r.maxZoom,
|
|
701
701
|
"before-id": "highlight-circles",
|
|
702
702
|
onClick: xe
|
|
703
703
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
704
|
-
(
|
|
704
|
+
(p(!0), w(ie, null, se(B.value, (r) => (p(), Y(_(Dt), {
|
|
705
705
|
key: r.id,
|
|
706
706
|
id: r.id,
|
|
707
|
-
source:
|
|
708
|
-
paint:
|
|
707
|
+
source: fe(r),
|
|
708
|
+
paint: pe(r),
|
|
709
709
|
minzoom: r.minZoom,
|
|
710
710
|
maxzoom: r.maxZoom,
|
|
711
711
|
"before-id": "highlight-circles",
|
|
712
712
|
onClick: xe
|
|
713
713
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
714
|
-
(
|
|
714
|
+
(p(!0), w(ie, null, se(q.value, (r) => (p(), Y(_(Ye), {
|
|
715
715
|
key: r.id + "-outline",
|
|
716
716
|
id: r.id + "-outline",
|
|
717
|
-
source:
|
|
717
|
+
source: fe(r),
|
|
718
718
|
paint: He(r),
|
|
719
719
|
minzoom: r.minZoom,
|
|
720
720
|
maxzoom: r.maxZoom,
|
|
721
721
|
"before-id": "highlight-lines",
|
|
722
722
|
onClick: xe
|
|
723
723
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
724
|
-
(
|
|
724
|
+
(p(!0), w(ie, null, se(ce.value, (r) => (p(), Y(_(Ye), {
|
|
725
725
|
key: r.id,
|
|
726
726
|
id: r.id,
|
|
727
|
-
source:
|
|
728
|
-
paint:
|
|
727
|
+
source: fe(r),
|
|
728
|
+
paint: pe(r),
|
|
729
729
|
minzoom: r.minZoom,
|
|
730
730
|
maxzoom: r.maxZoom,
|
|
731
731
|
"before-id": "highlight-lines",
|
|
732
732
|
onClick: xe
|
|
733
733
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
734
|
-
|
|
734
|
+
K(_(yt), {
|
|
735
735
|
key: "highlight-circles-layer",
|
|
736
736
|
id: "highlight-circles",
|
|
737
|
-
source: { type: "geojson", data:
|
|
737
|
+
source: { type: "geojson", data: A.value },
|
|
738
738
|
paint: Qe
|
|
739
739
|
}, null, 8, ["source"]),
|
|
740
|
-
|
|
740
|
+
K(_(Ye), {
|
|
741
741
|
key: "highlight-lines-layer",
|
|
742
742
|
id: "highlight-lines",
|
|
743
743
|
source: { type: "geojson", data: Q.value },
|
|
744
744
|
paint: Ke
|
|
745
745
|
}, null, 8, ["source"]),
|
|
746
|
-
|
|
746
|
+
K(_(Zt), {
|
|
747
747
|
"lng-lat": ut.value,
|
|
748
748
|
color: "#2176d2"
|
|
749
749
|
}, null, 8, ["lng-lat"]),
|
|
750
|
-
L.value &&
|
|
750
|
+
L.value && ye.value ? (p(), Y(_(Bt), {
|
|
751
751
|
key: 1,
|
|
752
|
-
"lng-lat":
|
|
753
|
-
html:
|
|
752
|
+
"lng-lat": ye.value,
|
|
753
|
+
html: re.value,
|
|
754
754
|
"close-on-click": !1,
|
|
755
755
|
"show-navigation": oe.value.length > 1,
|
|
756
756
|
"current-feature-index": J.value,
|
|
@@ -758,19 +758,19 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
758
758
|
"layer-name": L.value.layerTitle,
|
|
759
759
|
onClose: te,
|
|
760
760
|
onNext: le,
|
|
761
|
-
onPrevious:
|
|
761
|
+
onPrevious: Ze
|
|
762
762
|
}, null, 8, ["lng-lat", "html", "show-navigation", "current-feature-index", "total-features", "layer-name"])) : O("", !0)
|
|
763
763
|
]),
|
|
764
764
|
_: 1
|
|
765
765
|
}, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
|
|
766
766
|
]));
|
|
767
767
|
}
|
|
768
|
-
}),
|
|
768
|
+
}), Oe = (e, n) => {
|
|
769
769
|
const t = e.__vccOpts || e;
|
|
770
|
-
for (const [o,
|
|
771
|
-
t[o] =
|
|
770
|
+
for (const [o, a] of n)
|
|
771
|
+
t[o] = a;
|
|
772
772
|
return t;
|
|
773
|
-
}, Xt = /* @__PURE__ */
|
|
773
|
+
}, Xt = /* @__PURE__ */ Oe(Kt, [["__scopeId", "data-v-c7524a9f"]]), Yt = ["disabled"], eo = /* @__PURE__ */ we({
|
|
774
774
|
inheritAttrs: !1,
|
|
775
775
|
__name: "PhlButton",
|
|
776
776
|
props: {
|
|
@@ -792,56 +792,57 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
792
792
|
svgRaw: {}
|
|
793
793
|
},
|
|
794
794
|
setup(e) {
|
|
795
|
-
const
|
|
795
|
+
const n = e, t = (c) => "href" in c && c.href !== void 0 || "to" in c && c.to !== void 0, o = I(() => ot(
|
|
796
796
|
"phila-button",
|
|
797
|
-
`phila-button--${
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
)),
|
|
803
|
-
to:
|
|
804
|
-
disabled:
|
|
797
|
+
`phila-button--${n.variant}`,
|
|
798
|
+
n.size && `is-${n.size}`,
|
|
799
|
+
n.iconOnly && "icon-button",
|
|
800
|
+
n.iconOnly && n.variant === "standard" && "icon-button--standard",
|
|
801
|
+
n.className
|
|
802
|
+
)), a = I(() => t(n) ? "to" in n && n.to !== void 0 ? {
|
|
803
|
+
to: n.to,
|
|
804
|
+
disabled: n.disabled,
|
|
805
805
|
className: o.value
|
|
806
806
|
} : {
|
|
807
|
-
href:
|
|
808
|
-
target:
|
|
809
|
-
rel:
|
|
810
|
-
disabled:
|
|
807
|
+
href: n.href,
|
|
808
|
+
target: n.target,
|
|
809
|
+
rel: n.rel,
|
|
810
|
+
disabled: n.disabled,
|
|
811
811
|
className: o.value
|
|
812
|
-
} : {}),
|
|
812
|
+
} : {}), l = I(
|
|
813
813
|
() => ({
|
|
814
|
-
iconDefinition:
|
|
815
|
-
iconClass:
|
|
816
|
-
src:
|
|
817
|
-
iconRight:
|
|
818
|
-
iconOnly:
|
|
819
|
-
text:
|
|
820
|
-
size:
|
|
814
|
+
iconDefinition: n.iconDefinition,
|
|
815
|
+
iconClass: n.iconClass,
|
|
816
|
+
src: n.src,
|
|
817
|
+
iconRight: n.iconRight,
|
|
818
|
+
iconOnly: n.iconOnly,
|
|
819
|
+
text: n.text,
|
|
820
|
+
size: n.size,
|
|
821
|
+
shadow: n.iconOnly && n.variant === "standard"
|
|
821
822
|
})
|
|
822
823
|
);
|
|
823
|
-
return (c,
|
|
824
|
-
default:
|
|
825
|
-
|
|
826
|
-
default:
|
|
827
|
-
|
|
828
|
-
me(j(
|
|
824
|
+
return (c, h) => t(n) ? (p(), Y(_(Vt), tt({ key: 0 }, { ...a.value, ...c.$attrs }, { role: "button" }), {
|
|
825
|
+
default: Ee(() => [
|
|
826
|
+
K(_(gt), dt(ft(l.value)), {
|
|
827
|
+
default: Ee(() => [
|
|
828
|
+
ae(c.$slots, "default", {}, () => [
|
|
829
|
+
me(j(n.text), 1)
|
|
829
830
|
])
|
|
830
831
|
]),
|
|
831
832
|
_: 3
|
|
832
833
|
}, 16)
|
|
833
834
|
]),
|
|
834
835
|
_: 3
|
|
835
|
-
}, 16)) : (
|
|
836
|
+
}, 16)) : (p(), w("button", tt({
|
|
836
837
|
key: 1,
|
|
837
838
|
type: "button",
|
|
838
|
-
disabled:
|
|
839
|
+
disabled: n.disabled,
|
|
839
840
|
class: o.value
|
|
840
841
|
}, c.$attrs), [
|
|
841
|
-
|
|
842
|
-
default:
|
|
843
|
-
|
|
844
|
-
me(j(
|
|
842
|
+
K(_(gt), dt(ft(l.value)), {
|
|
843
|
+
default: Ee(() => [
|
|
844
|
+
ae(c.$slots, "default", {}, () => [
|
|
845
|
+
me(j(n.text), 1)
|
|
845
846
|
])
|
|
846
847
|
]),
|
|
847
848
|
_: 3
|
|
@@ -858,7 +859,7 @@ var to = {
|
|
|
858
859
|
iconName: "xmark",
|
|
859
860
|
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
|
|
860
861
|
}, io = no;
|
|
861
|
-
const
|
|
862
|
+
const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so = { class: "input-text-container" }, co = ["id", "placeholder"], uo = {
|
|
862
863
|
key: 1,
|
|
863
864
|
class: "has-text-body-small phila-supporting-text"
|
|
864
865
|
}, fo = {
|
|
@@ -868,6 +869,7 @@ const lo = ["for"], ao = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
868
869
|
inheritAttrs: !1,
|
|
869
870
|
__name: "TextField",
|
|
870
871
|
props: {
|
|
872
|
+
modelValue: { default: void 0 },
|
|
871
873
|
className: { default: "" },
|
|
872
874
|
label: { default: "" },
|
|
873
875
|
id: { default: `phila-text-field-${Math.random().toString(36).substring(2, 9)}` },
|
|
@@ -879,75 +881,97 @@ const lo = ["for"], ao = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
879
881
|
return [];
|
|
880
882
|
} }
|
|
881
883
|
},
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
})
|
|
890
|
-
|
|
891
|
-
|
|
884
|
+
emits: ["update:modelValue"],
|
|
885
|
+
setup(e, { emit: n }) {
|
|
886
|
+
const t = Ft(), o = e, a = I(() => typeof o.error == "string" ? o.error : o.error[0]), l = zt(o, "id"), c = n, h = C(""), f = I({
|
|
887
|
+
get: () => o.modelValue !== void 0 ? o.modelValue : h.value,
|
|
888
|
+
set: (d) => {
|
|
889
|
+
c("update:modelValue", d), h.value = d;
|
|
890
|
+
}
|
|
891
|
+
}), M = I(() => {
|
|
892
|
+
const d = ["default-class"];
|
|
893
|
+
return t.disabled != null && d.push("phila-input--disabled"), a.value && d.push("phila-input--error"), t.required != null && d.push("phila-input--required"), ot(...d);
|
|
894
|
+
}), m = I(() => {
|
|
895
|
+
const d = [];
|
|
896
|
+
return f.value !== "" && d.push("phila-text-field--filled"), o.className && d.push(o.className), ot(...d);
|
|
897
|
+
}), v = C(null), s = (d) => {
|
|
898
|
+
d.target.closest("button") || v.value?.focus();
|
|
899
|
+
};
|
|
900
|
+
return (d, $) => (p(), w("div", {
|
|
901
|
+
class: ne(["phila-input", M.value])
|
|
892
902
|
}, [
|
|
893
|
-
o.label ? (
|
|
903
|
+
o.label ? (p(), w("label", {
|
|
894
904
|
key: 0,
|
|
895
|
-
for:
|
|
905
|
+
for: l.value,
|
|
896
906
|
class: "has-text-label-small phila-label"
|
|
897
|
-
}, j(o.label), 9,
|
|
907
|
+
}, j(o.label), 9, ao)) : O("", !0),
|
|
898
908
|
P("div", {
|
|
899
|
-
class: ne(["phila-text-field",
|
|
909
|
+
class: ne(["phila-text-field", m.value]),
|
|
910
|
+
onClick: s
|
|
900
911
|
}, [
|
|
901
|
-
P("div",
|
|
902
|
-
o.leadingIcon ? (
|
|
912
|
+
P("div", lo, [
|
|
913
|
+
o.leadingIcon ? (p(), Y(_(ue), {
|
|
903
914
|
key: 0,
|
|
904
915
|
"icon-class": o.leadingIcon,
|
|
905
|
-
inline: ""
|
|
916
|
+
inline: "",
|
|
917
|
+
decorative: "",
|
|
918
|
+
shadow: ""
|
|
906
919
|
}, null, 8, ["icon-class"])) : O("", !0),
|
|
907
920
|
P("div", ro, [
|
|
908
921
|
P("div", so, [
|
|
909
922
|
St(P("input", tt({
|
|
910
|
-
id:
|
|
911
|
-
|
|
923
|
+
id: l.value,
|
|
924
|
+
ref_key: "inputRef",
|
|
925
|
+
ref: v,
|
|
926
|
+
"onUpdate:modelValue": $[0] || ($[0] = (y) => f.value = y),
|
|
912
927
|
class: "phila-text-field-input has-text-body-default",
|
|
913
928
|
placeholder: o.placeholder
|
|
914
929
|
}, _(t)), null, 16, co), [
|
|
915
|
-
[
|
|
930
|
+
[Tt, f.value]
|
|
916
931
|
])
|
|
917
932
|
])
|
|
918
933
|
]),
|
|
919
|
-
f.value != "" ? (
|
|
934
|
+
f.value != "" ? (p(), Y(_(eo), {
|
|
920
935
|
key: 1,
|
|
921
936
|
variant: "standard",
|
|
922
|
-
size: "
|
|
937
|
+
size: "small",
|
|
923
938
|
"icon-only": "",
|
|
924
|
-
icon: _(io),
|
|
925
|
-
onClick:
|
|
926
|
-
}, null, 8, ["icon"])) : O("", !0),
|
|
927
|
-
o.trailingIcon ? (
|
|
939
|
+
"icon-definition": _(io),
|
|
940
|
+
onClick: $[1] || ($[1] = (y) => f.value = "")
|
|
941
|
+
}, null, 8, ["icon-definition"])) : O("", !0),
|
|
942
|
+
o.trailingIcon ? (p(), Y(_(ue), {
|
|
928
943
|
key: 2,
|
|
944
|
+
size: "small",
|
|
929
945
|
"icon-class": o.trailingIcon,
|
|
930
|
-
inline: ""
|
|
931
|
-
|
|
946
|
+
inline: "",
|
|
947
|
+
decorative: "",
|
|
948
|
+
shadow: ""
|
|
949
|
+
}, null, 8, ["icon-class"])) : O("", !0),
|
|
950
|
+
ae(d.$slots, "trailing-action")
|
|
932
951
|
])
|
|
933
952
|
], 2),
|
|
934
|
-
o.supportingText ? (
|
|
935
|
-
|
|
936
|
-
|
|
953
|
+
o.supportingText ? (p(), w("div", uo, j(o.supportingText), 1)) : O("", !0),
|
|
954
|
+
a.value ? (p(), w("div", fo, [
|
|
955
|
+
K(_(ue), {
|
|
937
956
|
"icon-definition": _(oo),
|
|
938
957
|
size: "small",
|
|
939
|
-
inline: ""
|
|
958
|
+
inline: "",
|
|
959
|
+
decorative: ""
|
|
940
960
|
}, null, 8, ["icon-definition"]),
|
|
941
|
-
me(" " + j(
|
|
961
|
+
me(" " + j(a.value), 1)
|
|
942
962
|
])) : O("", !0)
|
|
943
963
|
], 2));
|
|
944
964
|
}
|
|
945
965
|
});
|
|
946
966
|
var yo = {
|
|
967
|
+
prefix: "fas",
|
|
968
|
+
iconName: "filter",
|
|
969
|
+
icon: [512, 512, [], "f0b0", "M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z"]
|
|
970
|
+
}, go = {
|
|
947
971
|
prefix: "fas",
|
|
948
972
|
iconName: "caret-right",
|
|
949
973
|
icon: [256, 512, [], "f0da", "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z"]
|
|
950
|
-
},
|
|
974
|
+
}, ho = {
|
|
951
975
|
prefix: "fas",
|
|
952
976
|
iconName: "caret-left",
|
|
953
977
|
icon: [256, 512, [], "f0d9", "M7.7 235.8c-10.3 12.6-9.5 31.1 2.2 42.8l128 128c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-256c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-128 128-2.2 2.4z"]
|
|
@@ -955,40 +979,40 @@ var yo = {
|
|
|
955
979
|
prefix: "fas",
|
|
956
980
|
iconName: "xmark",
|
|
957
981
|
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
|
|
958
|
-
},
|
|
982
|
+
}, mo = {
|
|
959
983
|
prefix: "fas",
|
|
960
984
|
iconName: "bars",
|
|
961
985
|
icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
|
|
962
|
-
},
|
|
986
|
+
}, vo = {
|
|
963
987
|
prefix: "fas",
|
|
964
988
|
iconName: "circle-info",
|
|
965
989
|
icon: [512, 512, ["info-circle"], "f05a", "M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
|
|
966
990
|
};
|
|
967
|
-
const
|
|
991
|
+
const bo = { class: "layer-panel" }, wo = {
|
|
968
992
|
key: 0,
|
|
969
993
|
class: "search-box"
|
|
970
|
-
},
|
|
994
|
+
}, Lo = {
|
|
971
995
|
key: 1,
|
|
972
996
|
class: "topics-container"
|
|
973
|
-
},
|
|
997
|
+
}, So = { class: "layer-row" }, Co = ["href"], ko = {
|
|
974
998
|
key: 1,
|
|
975
999
|
class: "metadata-placeholder"
|
|
976
|
-
},
|
|
1000
|
+
}, $o = ["checked", "disabled", "onChange"], xo = { class: "layer-title" }, Po = {
|
|
977
1001
|
key: 0,
|
|
978
1002
|
class: "loading-indicator"
|
|
979
|
-
},
|
|
1003
|
+
}, Mo = ["title"], Fo = {
|
|
980
1004
|
key: 2,
|
|
981
1005
|
class: "zoom-indicator"
|
|
982
|
-
},
|
|
1006
|
+
}, zo = {
|
|
983
1007
|
key: 0,
|
|
984
1008
|
class: "opacity-control"
|
|
985
|
-
}, To = { class: "opacity-label" },
|
|
1009
|
+
}, To = { class: "opacity-label" }, Eo = ["value", "onInput"], _o = {
|
|
986
1010
|
key: 1,
|
|
987
1011
|
class: "layer-legend"
|
|
988
|
-
},
|
|
1012
|
+
}, Oo = { class: "legend-label" }, Io = {
|
|
989
1013
|
key: 0,
|
|
990
1014
|
class: "no-results"
|
|
991
|
-
},
|
|
1015
|
+
}, Ro = /* @__PURE__ */ we({
|
|
992
1016
|
__name: "LayerPanel",
|
|
993
1017
|
props: {
|
|
994
1018
|
layerList: {},
|
|
@@ -1003,179 +1027,189 @@ const vo = { class: "layer-panel" }, bo = {
|
|
|
1003
1027
|
showSearch: { type: Boolean, default: !0 },
|
|
1004
1028
|
showOpacity: { type: Boolean, default: !0 },
|
|
1005
1029
|
showLegend: { type: Boolean, default: !0 },
|
|
1006
|
-
searchPlaceholder: { default: "
|
|
1030
|
+
searchPlaceholder: { default: "Filter layers..." }
|
|
1007
1031
|
},
|
|
1008
1032
|
emits: ["toggleLayer", "setOpacity", "updateSearch"],
|
|
1009
|
-
setup(e, { emit:
|
|
1010
|
-
const t = e, o =
|
|
1033
|
+
setup(e, { emit: n }) {
|
|
1034
|
+
const t = e, o = n, a = I(() => {
|
|
1011
1035
|
if (!t.searchQuery.trim())
|
|
1012
1036
|
return t.layerList;
|
|
1013
|
-
const
|
|
1037
|
+
const S = t.searchQuery.toLowerCase();
|
|
1014
1038
|
return t.layerList.filter(
|
|
1015
|
-
(
|
|
1039
|
+
(g) => g.config.title.toLowerCase().includes(S)
|
|
1016
1040
|
);
|
|
1017
1041
|
});
|
|
1018
|
-
function
|
|
1019
|
-
let
|
|
1020
|
-
return
|
|
1042
|
+
function l(S) {
|
|
1043
|
+
let g = S.split("?")[0] || S;
|
|
1044
|
+
return g = g.replace(/\/query$/, ""), g = g.replace(/\/$/, ""), g.toLowerCase();
|
|
1021
1045
|
}
|
|
1022
|
-
function c(
|
|
1023
|
-
const
|
|
1024
|
-
return t.layerMetadata[
|
|
1046
|
+
function c(S) {
|
|
1047
|
+
const g = l(S);
|
|
1048
|
+
return t.layerMetadata[g] || null;
|
|
1025
1049
|
}
|
|
1026
|
-
const
|
|
1027
|
-
function
|
|
1028
|
-
return t.visibleLayers.has(
|
|
1050
|
+
const h = I(() => t.layerList.some((S) => c(S.config.url)));
|
|
1051
|
+
function f(S) {
|
|
1052
|
+
return t.visibleLayers.has(S);
|
|
1029
1053
|
}
|
|
1030
|
-
function S
|
|
1031
|
-
return t.layerOpacities[
|
|
1054
|
+
function M(S) {
|
|
1055
|
+
return t.layerOpacities[S] ?? 1;
|
|
1032
1056
|
}
|
|
1033
|
-
function
|
|
1034
|
-
return t.loadingLayers.has(
|
|
1057
|
+
function m(S) {
|
|
1058
|
+
return t.loadingLayers.has(S);
|
|
1035
1059
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return t.layerErrors[
|
|
1060
|
+
function v(S) {
|
|
1061
|
+
return t.layerErrors[S] || null;
|
|
1038
1062
|
}
|
|
1039
|
-
function s(
|
|
1040
|
-
const
|
|
1041
|
-
return !(b !== void 0 &&
|
|
1063
|
+
function s(S) {
|
|
1064
|
+
const g = t.currentZoom, b = S.minZoom, E = S.maxZoom;
|
|
1065
|
+
return !(b !== void 0 && g < b || E !== void 0 && g > E);
|
|
1042
1066
|
}
|
|
1043
|
-
const
|
|
1067
|
+
const d = I({
|
|
1044
1068
|
get: () => t.searchQuery,
|
|
1045
|
-
set: (
|
|
1069
|
+
set: (S) => o("updateSearch", S)
|
|
1046
1070
|
});
|
|
1047
|
-
function
|
|
1048
|
-
o("toggleLayer",
|
|
1049
|
-
}
|
|
1050
|
-
function
|
|
1051
|
-
const b =
|
|
1052
|
-
o("setOpacity",
|
|
1053
|
-
}
|
|
1054
|
-
return (
|
|
1055
|
-
e.showSearch ? (
|
|
1056
|
-
|
|
1057
|
-
modelValue:
|
|
1058
|
-
"onUpdate:modelValue":
|
|
1071
|
+
function $(S) {
|
|
1072
|
+
o("toggleLayer", S);
|
|
1073
|
+
}
|
|
1074
|
+
function y(S, g) {
|
|
1075
|
+
const b = g.target, E = parseFloat(b.value);
|
|
1076
|
+
o("setOpacity", S, E);
|
|
1077
|
+
}
|
|
1078
|
+
return (S, g) => (p(), w("aside", bo, [
|
|
1079
|
+
e.showSearch ? (p(), w("div", wo, [
|
|
1080
|
+
K(_(po), {
|
|
1081
|
+
modelValue: d.value,
|
|
1082
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => d.value = b),
|
|
1059
1083
|
placeholder: e.searchPlaceholder,
|
|
1060
1084
|
"class-name": "layer-search-field"
|
|
1061
|
-
},
|
|
1085
|
+
}, {
|
|
1086
|
+
"trailing-action": Ee(() => [
|
|
1087
|
+
K(_(ue), {
|
|
1088
|
+
"icon-definition": _(yo),
|
|
1089
|
+
size: "small",
|
|
1090
|
+
inline: "",
|
|
1091
|
+
decorative: ""
|
|
1092
|
+
}, null, 8, ["icon-definition"])
|
|
1093
|
+
]),
|
|
1094
|
+
_: 1
|
|
1095
|
+
}, 8, ["modelValue", "placeholder"])
|
|
1062
1096
|
])) : O("", !0),
|
|
1063
|
-
e.mode === "topics" ? (
|
|
1064
|
-
|
|
1065
|
-
|
|
1097
|
+
e.mode === "topics" ? (p(), w("div", Lo, [
|
|
1098
|
+
ae(S.$slots, "topics", {}, () => [
|
|
1099
|
+
g[2] || (g[2] = P("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
|
|
1066
1100
|
], !0)
|
|
1067
|
-
])) : (
|
|
1101
|
+
])) : (p(), w("div", {
|
|
1068
1102
|
key: 2,
|
|
1069
|
-
class: ne(["layer-list", { "has-metadata":
|
|
1103
|
+
class: ne(["layer-list", { "has-metadata": h.value }])
|
|
1070
1104
|
}, [
|
|
1071
|
-
(
|
|
1105
|
+
(p(!0), w(ie, null, se(a.value, (b) => (p(), w("div", {
|
|
1072
1106
|
key: b.config.id,
|
|
1073
1107
|
class: "layer-item"
|
|
1074
1108
|
}, [
|
|
1075
|
-
P("div",
|
|
1076
|
-
c(b.config.url) ? (
|
|
1109
|
+
P("div", So, [
|
|
1110
|
+
c(b.config.url) ? (p(), w("a", {
|
|
1077
1111
|
key: 0,
|
|
1078
1112
|
href: c(b.config.url) || "",
|
|
1079
1113
|
target: "_blank",
|
|
1080
1114
|
rel: "noopener noreferrer",
|
|
1081
1115
|
class: "metadata-link",
|
|
1082
1116
|
title: "View metadata",
|
|
1083
|
-
onClick:
|
|
1117
|
+
onClick: g[1] || (g[1] = Et(() => {
|
|
1084
1118
|
}, ["stop"]))
|
|
1085
1119
|
}, [
|
|
1086
|
-
|
|
1087
|
-
"icon-definition": _(
|
|
1120
|
+
K(_(ue), {
|
|
1121
|
+
"icon-definition": _(vo),
|
|
1088
1122
|
size: "small",
|
|
1089
1123
|
inline: "",
|
|
1090
1124
|
decorative: ""
|
|
1091
1125
|
}, null, 8, ["icon-definition"])
|
|
1092
|
-
], 8,
|
|
1126
|
+
], 8, Co)) : h.value ? (p(), w("span", ko)) : O("", !0),
|
|
1093
1127
|
P("label", {
|
|
1094
1128
|
class: ne(["layer-checkbox", {
|
|
1095
1129
|
"layer-unavailable": !s(b.config),
|
|
1096
|
-
"layer-error":
|
|
1130
|
+
"layer-error": v(b.config.id)
|
|
1097
1131
|
}])
|
|
1098
1132
|
}, [
|
|
1099
1133
|
P("input", {
|
|
1100
1134
|
type: "checkbox",
|
|
1101
|
-
checked:
|
|
1135
|
+
checked: f(b.config.id),
|
|
1102
1136
|
disabled: !s(b.config),
|
|
1103
|
-
onChange: (E) =>
|
|
1104
|
-
}, null, 40,
|
|
1105
|
-
P("span",
|
|
1137
|
+
onChange: (E) => $(b.config.id)
|
|
1138
|
+
}, null, 40, $o),
|
|
1139
|
+
P("span", xo, [
|
|
1106
1140
|
me(j(b.config.title) + " ", 1),
|
|
1107
|
-
|
|
1108
|
-
|
|
1141
|
+
m(b.config.id) ? (p(), w("span", Po, " Loading... ")) : O("", !0),
|
|
1142
|
+
v(b.config.id) ? (p(), w("span", {
|
|
1109
1143
|
key: 1,
|
|
1110
1144
|
class: "error-indicator",
|
|
1111
|
-
title:
|
|
1112
|
-
}, " Error ", 8,
|
|
1113
|
-
s(b.config) ? O("", !0) : (
|
|
1145
|
+
title: v(b.config.id) || ""
|
|
1146
|
+
}, " Error ", 8, Mo)) : O("", !0),
|
|
1147
|
+
s(b.config) ? O("", !0) : (p(), w("span", Fo, " (zoom in) "))
|
|
1114
1148
|
])
|
|
1115
1149
|
], 2)
|
|
1116
1150
|
]),
|
|
1117
|
-
e.showOpacity &&
|
|
1118
|
-
P("label", To, " Opacity: " + j(Math.round(
|
|
1151
|
+
e.showOpacity && f(b.config.id) ? (p(), w("div", zo, [
|
|
1152
|
+
P("label", To, " Opacity: " + j(Math.round(M(b.config.id) * 100)) + "% ", 1),
|
|
1119
1153
|
P("input", {
|
|
1120
1154
|
type: "range",
|
|
1121
1155
|
min: "0",
|
|
1122
1156
|
max: "1",
|
|
1123
1157
|
step: "0.05",
|
|
1124
|
-
value:
|
|
1158
|
+
value: M(b.config.id),
|
|
1125
1159
|
class: "opacity-slider",
|
|
1126
|
-
onInput: (E) =>
|
|
1127
|
-
}, null, 40,
|
|
1160
|
+
onInput: (E) => y(b.config.id, E)
|
|
1161
|
+
}, null, 40, Eo)
|
|
1128
1162
|
])) : O("", !0),
|
|
1129
|
-
e.showLegend &&
|
|
1130
|
-
(
|
|
1131
|
-
key:
|
|
1163
|
+
e.showLegend && f(b.config.id) && b.config.legend?.length ? (p(), w("ul", _o, [
|
|
1164
|
+
(p(!0), w(ie, null, se(b.config.legend, (E, T) => (p(), w("li", {
|
|
1165
|
+
key: T,
|
|
1132
1166
|
class: "legend-item"
|
|
1133
1167
|
}, [
|
|
1134
|
-
E.type === "circle" ? (
|
|
1168
|
+
E.type === "circle" ? (p(), w("span", {
|
|
1135
1169
|
key: 0,
|
|
1136
1170
|
class: "legend-symbol legend-circle",
|
|
1137
|
-
style:
|
|
1138
|
-
}, null, 4)) : E.type === "line" ? (
|
|
1171
|
+
style: ee({ backgroundColor: E.color })
|
|
1172
|
+
}, null, 4)) : E.type === "line" ? (p(), w("span", {
|
|
1139
1173
|
key: 1,
|
|
1140
1174
|
class: "legend-symbol legend-line",
|
|
1141
|
-
style:
|
|
1175
|
+
style: ee({
|
|
1142
1176
|
backgroundColor: E.color,
|
|
1143
1177
|
height: `${E.width || 2}px`
|
|
1144
1178
|
})
|
|
1145
|
-
}, null, 4)) : E.type === "fill" ? (
|
|
1179
|
+
}, null, 4)) : E.type === "fill" ? (p(), w("span", {
|
|
1146
1180
|
key: 2,
|
|
1147
1181
|
class: "legend-symbol legend-fill",
|
|
1148
|
-
style:
|
|
1182
|
+
style: ee({ backgroundColor: E.color })
|
|
1149
1183
|
}, null, 4)) : O("", !0),
|
|
1150
|
-
P("span",
|
|
1184
|
+
P("span", Oo, j(E.label), 1)
|
|
1151
1185
|
]))), 128))
|
|
1152
1186
|
])) : O("", !0)
|
|
1153
1187
|
]))), 128)),
|
|
1154
|
-
|
|
1188
|
+
a.value.length === 0 ? (p(), w("div", Io, ' No layers match "' + j(e.searchQuery) + '" ', 1)) : O("", !0)
|
|
1155
1189
|
], 2))
|
|
1156
1190
|
]));
|
|
1157
1191
|
}
|
|
1158
|
-
}),
|
|
1192
|
+
}), Do = /* @__PURE__ */ Oe(Ro, [["__scopeId", "data-v-d2e878e2"]]);
|
|
1159
1193
|
function D(e) {
|
|
1160
1194
|
if (!e || !Array.isArray(e) || e.length < 3) return "#888888";
|
|
1161
|
-
const
|
|
1162
|
-
return
|
|
1195
|
+
const n = e[0], t = e[1], o = e[2], l = (e[3] ?? 255) / 255;
|
|
1196
|
+
return l === 1 ? `#${n.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}` : `rgba(${n}, ${t}, ${o}, ${l.toFixed(2)})`;
|
|
1163
1197
|
}
|
|
1164
|
-
function
|
|
1198
|
+
function de(e) {
|
|
1165
1199
|
return e !== void 0 ? e : 1;
|
|
1166
1200
|
}
|
|
1167
|
-
const
|
|
1201
|
+
const Zo = 559082264;
|
|
1168
1202
|
function vt(e) {
|
|
1169
|
-
return !e || e <= 0 ? null : Math.round(Math.log2(
|
|
1203
|
+
return !e || e <= 0 ? null : Math.round(Math.log2(Zo / e) * 100) / 100;
|
|
1170
1204
|
}
|
|
1171
|
-
function
|
|
1205
|
+
function Bo(e, n) {
|
|
1172
1206
|
const t = {};
|
|
1173
1207
|
if (e && e > 0) {
|
|
1174
1208
|
const o = vt(e);
|
|
1175
1209
|
o !== null && (t.minZoom = o);
|
|
1176
1210
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
const o = vt(
|
|
1211
|
+
if (n && n > 0) {
|
|
1212
|
+
const o = vt(n);
|
|
1179
1213
|
o !== null && (t.maxZoom = o);
|
|
1180
1214
|
}
|
|
1181
1215
|
return t;
|
|
@@ -1203,19 +1237,19 @@ function Fe(e) {
|
|
|
1203
1237
|
function et(e) {
|
|
1204
1238
|
return String(e);
|
|
1205
1239
|
}
|
|
1206
|
-
function Ct(e,
|
|
1207
|
-
const o = e.symbol,
|
|
1208
|
-
let
|
|
1209
|
-
if (
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
"fill-color":
|
|
1213
|
-
"fill-opacity":
|
|
1240
|
+
function Ct(e, n, t) {
|
|
1241
|
+
const o = e.symbol, a = Ue(o);
|
|
1242
|
+
let l = {}, c = [], h = null;
|
|
1243
|
+
if (a === "fill" && o) {
|
|
1244
|
+
const f = o.color === null ? 0 : o.color?.[3] ?? 255, M = f === 0 ? "rgba(0, 0, 0, 0)" : D(o.color), m = f === 0 ? 0 : f < 255 ? 1 : de(n);
|
|
1245
|
+
if (l = {
|
|
1246
|
+
"fill-color": M,
|
|
1247
|
+
"fill-opacity": m
|
|
1214
1248
|
}, Fe(o.outline)) {
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1249
|
+
const v = o.outline.width || 1, s = D(o.outline.color);
|
|
1250
|
+
f !== 0 && (l["fill-outline-color"] = s), (v > 1 || f === 0) && (h = {
|
|
1217
1251
|
"line-color": s,
|
|
1218
|
-
"line-width":
|
|
1252
|
+
"line-width": v
|
|
1219
1253
|
});
|
|
1220
1254
|
}
|
|
1221
1255
|
c = [{
|
|
@@ -1223,240 +1257,240 @@ function Ct(e, i, t) {
|
|
|
1223
1257
|
color: D(o.color),
|
|
1224
1258
|
label: e.label || "Feature"
|
|
1225
1259
|
}];
|
|
1226
|
-
} else if (
|
|
1227
|
-
|
|
1260
|
+
} else if (a === "line" && o)
|
|
1261
|
+
l = {
|
|
1228
1262
|
"line-color": D(o.color),
|
|
1229
1263
|
"line-width": o.width || 1,
|
|
1230
|
-
"line-opacity":
|
|
1264
|
+
"line-opacity": de(n)
|
|
1231
1265
|
}, c = [{
|
|
1232
1266
|
type: "line",
|
|
1233
1267
|
color: D(o.color),
|
|
1234
1268
|
width: o.width || 1,
|
|
1235
1269
|
label: e.label || "Feature"
|
|
1236
1270
|
}];
|
|
1237
|
-
else if (
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1271
|
+
else if (a === "circle" && o) {
|
|
1272
|
+
const f = Math.round((o.size || 6) * 0.71 * 100) / 100;
|
|
1273
|
+
l = {
|
|
1240
1274
|
"circle-color": D(o.color),
|
|
1241
|
-
"circle-radius":
|
|
1242
|
-
"circle-opacity":
|
|
1243
|
-
}, Fe(o.outline) && (
|
|
1275
|
+
"circle-radius": f,
|
|
1276
|
+
"circle-opacity": de(n)
|
|
1277
|
+
}, Fe(o.outline) && (l["circle-stroke-color"] = D(o.outline.color), l["circle-stroke-width"] = o.outline.width || 1), c = [{
|
|
1244
1278
|
type: "circle",
|
|
1245
1279
|
color: D(o.color),
|
|
1246
1280
|
label: e.label || "Feature"
|
|
1247
1281
|
}];
|
|
1248
1282
|
}
|
|
1249
|
-
return { paint:
|
|
1283
|
+
return { paint: l, legend: c, geomType: a, outlinePaint: h };
|
|
1250
1284
|
}
|
|
1251
|
-
function
|
|
1252
|
-
const o = e.field1,
|
|
1253
|
-
if (
|
|
1254
|
-
return Ct({ ...e, symbol:
|
|
1255
|
-
const c =
|
|
1256
|
-
let
|
|
1257
|
-
if (
|
|
1258
|
-
const
|
|
1259
|
-
for (const s of
|
|
1260
|
-
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1285
|
+
function Vo(e, n, t) {
|
|
1286
|
+
const o = e.field1, a = e.uniqueValueInfos || [], l = e.defaultSymbol;
|
|
1287
|
+
if (a.length === 0)
|
|
1288
|
+
return Ct({ ...e, symbol: l }, n);
|
|
1289
|
+
const c = a[0]?.symbol || l, h = Ue(c);
|
|
1290
|
+
let f = {}, M = [], m = null;
|
|
1291
|
+
if (h === "fill") {
|
|
1292
|
+
const v = ["match", ["to-string", ["get", o]]];
|
|
1293
|
+
for (const s of a) {
|
|
1294
|
+
v.push(et(s.value)), v.push(D(s.symbol?.color));
|
|
1295
|
+
const d = String(s.value), y = t?.get(d) || s.label || d;
|
|
1296
|
+
M.push({
|
|
1263
1297
|
type: "fill",
|
|
1264
1298
|
color: D(s.symbol?.color),
|
|
1265
|
-
label:
|
|
1299
|
+
label: y
|
|
1266
1300
|
});
|
|
1267
1301
|
}
|
|
1268
|
-
if (
|
|
1269
|
-
"fill-color":
|
|
1270
|
-
"fill-opacity":
|
|
1302
|
+
if (v.push(l ? D(l.color) : "#888888"), f = {
|
|
1303
|
+
"fill-color": v,
|
|
1304
|
+
"fill-opacity": de(n)
|
|
1271
1305
|
}, Fe(c?.outline)) {
|
|
1272
|
-
const s = c.outline.width || 1,
|
|
1273
|
-
|
|
1274
|
-
"line-color":
|
|
1306
|
+
const s = c.outline.width || 1, d = D(c.outline.color);
|
|
1307
|
+
f["fill-outline-color"] = d, s > 1 && (m = {
|
|
1308
|
+
"line-color": d,
|
|
1275
1309
|
"line-width": s
|
|
1276
1310
|
});
|
|
1277
1311
|
}
|
|
1278
|
-
} else if (
|
|
1279
|
-
const
|
|
1280
|
-
for (const s of
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1312
|
+
} else if (h === "line") {
|
|
1313
|
+
const v = ["match", ["to-string", ["get", o]]];
|
|
1314
|
+
for (const s of a) {
|
|
1315
|
+
v.push(et(s.value)), v.push(D(s.symbol?.color));
|
|
1316
|
+
const d = String(s.value), y = t?.get(d) || s.label || d;
|
|
1317
|
+
M.push({
|
|
1284
1318
|
type: "line",
|
|
1285
1319
|
color: D(s.symbol?.color),
|
|
1286
1320
|
width: s.symbol?.width || 1,
|
|
1287
|
-
label:
|
|
1321
|
+
label: y
|
|
1288
1322
|
});
|
|
1289
1323
|
}
|
|
1290
|
-
|
|
1291
|
-
"line-color":
|
|
1324
|
+
v.push(l ? D(l.color) : "#888888"), f = {
|
|
1325
|
+
"line-color": v,
|
|
1292
1326
|
"line-width": c?.width || 2,
|
|
1293
|
-
"line-opacity":
|
|
1327
|
+
"line-opacity": de(n)
|
|
1294
1328
|
};
|
|
1295
|
-
} else if (
|
|
1296
|
-
const
|
|
1297
|
-
for (const
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1329
|
+
} else if (h === "circle") {
|
|
1330
|
+
const v = ["match", ["to-string", ["get", o]]];
|
|
1331
|
+
for (const d of a) {
|
|
1332
|
+
v.push(et(d.value)), v.push(D(d.symbol?.color));
|
|
1333
|
+
const $ = String(d.value), S = t?.get($) || d.label || $;
|
|
1334
|
+
M.push({
|
|
1301
1335
|
type: "circle",
|
|
1302
|
-
color: D(
|
|
1303
|
-
label:
|
|
1336
|
+
color: D(d.symbol?.color),
|
|
1337
|
+
label: S
|
|
1304
1338
|
});
|
|
1305
1339
|
}
|
|
1306
|
-
|
|
1340
|
+
v.push(l ? D(l.color) : "#888888");
|
|
1307
1341
|
const s = Math.round((c?.size || 6) * 0.71 * 100) / 100;
|
|
1308
|
-
|
|
1309
|
-
"circle-color":
|
|
1342
|
+
f = {
|
|
1343
|
+
"circle-color": v,
|
|
1310
1344
|
"circle-radius": s,
|
|
1311
|
-
"circle-opacity":
|
|
1312
|
-
}, Fe(c?.outline) && (
|
|
1345
|
+
"circle-opacity": de(n)
|
|
1346
|
+
}, Fe(c?.outline) && (f["circle-stroke-color"] = D(c.outline.color), f["circle-stroke-width"] = c.outline.width || 1);
|
|
1313
1347
|
}
|
|
1314
|
-
return { paint:
|
|
1348
|
+
return { paint: f, legend: M, geomType: h, outlinePaint: m };
|
|
1315
1349
|
}
|
|
1316
|
-
function Ao(e,
|
|
1317
|
-
const t = e.field, o = e.classBreakInfos || [],
|
|
1318
|
-
if (
|
|
1319
|
-
return No(
|
|
1350
|
+
function Ao(e, n) {
|
|
1351
|
+
const t = e.field, o = e.classBreakInfos || [], a = e.visualVariables?.find((m) => m.type === "colorInfo");
|
|
1352
|
+
if (a?.stops && a.stops.length > 0)
|
|
1353
|
+
return No(a, t, e, n);
|
|
1320
1354
|
if (o.length === 0)
|
|
1321
1355
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1322
|
-
const
|
|
1323
|
-
let
|
|
1356
|
+
const l = o[0]?.symbol, c = Ue(l);
|
|
1357
|
+
let h = {}, f = [], M = null;
|
|
1324
1358
|
if (c === "fill") {
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
for (let
|
|
1328
|
-
const s = o[
|
|
1329
|
-
|
|
1359
|
+
const m = ["step", ["get", t]];
|
|
1360
|
+
m.push(D(o[0]?.symbol?.color));
|
|
1361
|
+
for (let v = 0; v < o.length; v++) {
|
|
1362
|
+
const s = o[v];
|
|
1363
|
+
v > 0 && (m.push(o[v - 1].classMaxValue), m.push(D(s.symbol?.color))), f.push({
|
|
1330
1364
|
type: "fill",
|
|
1331
1365
|
color: D(s.symbol?.color),
|
|
1332
1366
|
label: s.label || `${s.classMaxValue}`
|
|
1333
1367
|
});
|
|
1334
1368
|
}
|
|
1335
|
-
if (
|
|
1336
|
-
"fill-color":
|
|
1337
|
-
"fill-opacity":
|
|
1338
|
-
}, Fe(
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1369
|
+
if (h = {
|
|
1370
|
+
"fill-color": m,
|
|
1371
|
+
"fill-opacity": de(n)
|
|
1372
|
+
}, Fe(l?.outline)) {
|
|
1373
|
+
const v = l.outline.width || 1, s = D(l.outline.color);
|
|
1374
|
+
h["fill-outline-color"] = s, v > 1 && (M = {
|
|
1341
1375
|
"line-color": s,
|
|
1342
|
-
"line-width":
|
|
1376
|
+
"line-width": v
|
|
1343
1377
|
});
|
|
1344
1378
|
}
|
|
1345
1379
|
} else if (c === "line") {
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1348
|
-
let
|
|
1349
|
-
for (let
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1380
|
+
const m = ["step", ["get", t]];
|
|
1381
|
+
m.push(D(o[0]?.symbol?.color));
|
|
1382
|
+
let v = e.minValue ?? 0;
|
|
1383
|
+
for (let d = 0; d < o.length; d++) {
|
|
1384
|
+
const $ = o[d];
|
|
1385
|
+
d > 0 && (m.push(o[d - 1].classMaxValue), m.push(D($.symbol?.color))), f.push({
|
|
1352
1386
|
type: "line",
|
|
1353
|
-
color: D(
|
|
1354
|
-
width:
|
|
1355
|
-
label:
|
|
1356
|
-
}),
|
|
1387
|
+
color: D($.symbol?.color),
|
|
1388
|
+
width: $.symbol?.width || l?.width || 2,
|
|
1389
|
+
label: $.label || `${v} - ${$.classMaxValue}`
|
|
1390
|
+
}), v = $.classMaxValue + 1;
|
|
1357
1391
|
}
|
|
1358
|
-
const s =
|
|
1359
|
-
|
|
1360
|
-
"line-color":
|
|
1392
|
+
const s = l?.width || 2;
|
|
1393
|
+
h = {
|
|
1394
|
+
"line-color": m,
|
|
1361
1395
|
"line-width": s,
|
|
1362
|
-
"line-opacity":
|
|
1396
|
+
"line-opacity": de(n)
|
|
1363
1397
|
};
|
|
1364
1398
|
}
|
|
1365
|
-
return { paint:
|
|
1399
|
+
return { paint: h, legend: f, geomType: c, outlinePaint: M };
|
|
1366
1400
|
}
|
|
1367
|
-
function No(e,
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1401
|
+
function No(e, n, t, o) {
|
|
1402
|
+
const a = e.stops || [];
|
|
1403
|
+
if (a.length === 0)
|
|
1370
1404
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1371
|
-
const
|
|
1372
|
-
let
|
|
1405
|
+
const l = t.classBreakInfos?.[0]?.symbol || t.defaultSymbol, c = Ue(l);
|
|
1406
|
+
let h = {}, f = [], M = null;
|
|
1373
1407
|
if (c === "fill") {
|
|
1374
|
-
const
|
|
1375
|
-
for (const s of
|
|
1376
|
-
|
|
1408
|
+
const m = ["interpolate", ["linear"], ["get", n]];
|
|
1409
|
+
for (const s of a)
|
|
1410
|
+
m.push(s.value), m.push(D(s.color)), f.push({
|
|
1377
1411
|
type: "fill",
|
|
1378
1412
|
color: D(s.color),
|
|
1379
1413
|
label: s.label || `${s.value}`
|
|
1380
1414
|
});
|
|
1381
|
-
if (
|
|
1415
|
+
if (h = {
|
|
1382
1416
|
"fill-color": [
|
|
1383
1417
|
"case",
|
|
1384
|
-
["==", ["get",
|
|
1418
|
+
["==", ["get", n], null],
|
|
1385
1419
|
"rgba(0, 0, 0, 0)",
|
|
1386
1420
|
// Transparent for null/no-data values
|
|
1387
|
-
|
|
1421
|
+
m
|
|
1388
1422
|
// Otherwise use the interpolated color
|
|
1389
1423
|
],
|
|
1390
|
-
"fill-opacity":
|
|
1391
|
-
}, Fe(
|
|
1392
|
-
const s =
|
|
1393
|
-
|
|
1394
|
-
"line-color":
|
|
1424
|
+
"fill-opacity": de(o)
|
|
1425
|
+
}, Fe(l?.outline)) {
|
|
1426
|
+
const s = l.outline.width || 1, d = D(l.outline.color);
|
|
1427
|
+
h["fill-outline-color"] = d, s > 1 && (M = {
|
|
1428
|
+
"line-color": d,
|
|
1395
1429
|
"line-width": s
|
|
1396
1430
|
});
|
|
1397
1431
|
}
|
|
1398
1432
|
}
|
|
1399
|
-
return { paint:
|
|
1433
|
+
return { paint: h, legend: f, geomType: c, outlinePaint: M };
|
|
1400
1434
|
}
|
|
1401
|
-
function
|
|
1435
|
+
function Uo(e, n, t, o) {
|
|
1402
1436
|
if (!e?.renderer)
|
|
1403
1437
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1404
|
-
const
|
|
1405
|
-
switch (
|
|
1438
|
+
const a = e.renderer;
|
|
1439
|
+
switch (a.type) {
|
|
1406
1440
|
case "simple":
|
|
1407
|
-
return Ct(
|
|
1441
|
+
return Ct(a, n);
|
|
1408
1442
|
case "uniqueValue":
|
|
1409
|
-
return
|
|
1443
|
+
return Vo(a, n, t);
|
|
1410
1444
|
case "classBreaks":
|
|
1411
|
-
return Ao(
|
|
1445
|
+
return Ao(a, n);
|
|
1412
1446
|
default:
|
|
1413
1447
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1414
1448
|
}
|
|
1415
1449
|
}
|
|
1416
|
-
function
|
|
1450
|
+
function Wo(e) {
|
|
1417
1451
|
if (!e) return null;
|
|
1418
|
-
const
|
|
1419
|
-
const
|
|
1420
|
-
field:
|
|
1421
|
-
label:
|
|
1452
|
+
const n = e.title || "", o = (e.fieldInfos || []).filter((a) => a.visible === !0).map((a) => {
|
|
1453
|
+
const l = {
|
|
1454
|
+
field: a.fieldName,
|
|
1455
|
+
label: a.label || a.fieldName
|
|
1422
1456
|
};
|
|
1423
|
-
return
|
|
1457
|
+
return a.format && (l.format = {}, a.format.dateFormat && (l.format.dateFormat = a.format.dateFormat), a.format.digitSeparator !== void 0 && (l.format.digitSeparator = a.format.digitSeparator), a.format.places !== void 0 && (l.format.places = a.format.places), Object.keys(l.format).length === 0 && delete l.format), l;
|
|
1424
1458
|
});
|
|
1425
1459
|
return {
|
|
1426
|
-
title:
|
|
1460
|
+
title: n,
|
|
1427
1461
|
fields: o
|
|
1428
1462
|
};
|
|
1429
1463
|
}
|
|
1430
|
-
function
|
|
1464
|
+
function jo(e) {
|
|
1431
1465
|
return e?.definitionExpression;
|
|
1432
1466
|
}
|
|
1433
|
-
function
|
|
1467
|
+
function qo(e) {
|
|
1434
1468
|
return (e.includes("_") ? e.split("_").slice(1).join(" ") : e).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1435
1469
|
}
|
|
1436
|
-
function
|
|
1470
|
+
function Go(e) {
|
|
1437
1471
|
return e.includes("_") ? e.split("_").slice(1).join(" ") : e;
|
|
1438
1472
|
}
|
|
1439
|
-
function
|
|
1440
|
-
const
|
|
1473
|
+
function Ho(e) {
|
|
1474
|
+
const n = /* @__PURE__ */ new Map();
|
|
1441
1475
|
if (!e)
|
|
1442
|
-
return
|
|
1476
|
+
return n;
|
|
1443
1477
|
const t = e.split(`
|
|
1444
1478
|
`), o = /^(\d{1,3})\s+(.+)$/;
|
|
1445
|
-
for (const
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1448
|
-
const [, c,
|
|
1449
|
-
c &&
|
|
1479
|
+
for (const a of t) {
|
|
1480
|
+
const l = a.trim().match(o);
|
|
1481
|
+
if (l) {
|
|
1482
|
+
const [, c, h] = l;
|
|
1483
|
+
c && h && n.set(c, h.trim());
|
|
1450
1484
|
}
|
|
1451
1485
|
}
|
|
1452
|
-
return
|
|
1486
|
+
return n;
|
|
1453
1487
|
}
|
|
1454
|
-
async function
|
|
1488
|
+
async function Jo(e) {
|
|
1455
1489
|
try {
|
|
1456
|
-
const
|
|
1457
|
-
if (!
|
|
1490
|
+
const n = await fetch(`${e}?f=json`);
|
|
1491
|
+
if (!n.ok)
|
|
1458
1492
|
return null;
|
|
1459
|
-
const t = await
|
|
1493
|
+
const t = await n.json();
|
|
1460
1494
|
return t.drawingInfo ? {
|
|
1461
1495
|
drawingInfo: t.drawingInfo,
|
|
1462
1496
|
description: t.description
|
|
@@ -1466,59 +1500,59 @@ async function Ho(e) {
|
|
|
1466
1500
|
}
|
|
1467
1501
|
}
|
|
1468
1502
|
async function kt(e) {
|
|
1469
|
-
const
|
|
1470
|
-
for (const
|
|
1471
|
-
if (
|
|
1503
|
+
const n = e.operationalLayers || [], t = [], o = ["Zoning and Planning_Land Use"];
|
|
1504
|
+
for (const a of n)
|
|
1505
|
+
if (a.url && a.itemId !== "4f39b829b96d437da9231727d9c91fab")
|
|
1472
1506
|
try {
|
|
1473
|
-
let
|
|
1474
|
-
const
|
|
1475
|
-
if ((
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1507
|
+
let l = a.layerDefinition?.drawingInfo, c;
|
|
1508
|
+
const h = !l || !l.renderer, f = o.includes(a.title);
|
|
1509
|
+
if ((h || f) && a.url) {
|
|
1510
|
+
const T = await Jo(a.url);
|
|
1511
|
+
T && (l = T.drawingInfo, T.description && (c = Ho(T.description), c.size > 0));
|
|
1478
1512
|
}
|
|
1479
|
-
const { paint:
|
|
1480
|
-
|
|
1481
|
-
|
|
1513
|
+
const { paint: M, legend: m, geomType: v, outlinePaint: s } = Uo(
|
|
1514
|
+
l,
|
|
1515
|
+
a.opacity,
|
|
1482
1516
|
c,
|
|
1483
|
-
|
|
1484
|
-
),
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
),
|
|
1488
|
-
let b =
|
|
1517
|
+
a.title
|
|
1518
|
+
), d = Wo(a.popupInfo), $ = jo(a.layerDefinition), y = Bo(
|
|
1519
|
+
a.layerDefinition?.minScale,
|
|
1520
|
+
a.layerDefinition?.maxScale
|
|
1521
|
+
), S = qo(a.title), g = Go(a.title);
|
|
1522
|
+
let b = a.opacity ?? 1;
|
|
1489
1523
|
const E = {
|
|
1490
|
-
id:
|
|
1491
|
-
title:
|
|
1492
|
-
type:
|
|
1493
|
-
url:
|
|
1524
|
+
id: S,
|
|
1525
|
+
title: g,
|
|
1526
|
+
type: v,
|
|
1527
|
+
url: a.url,
|
|
1494
1528
|
opacity: b,
|
|
1495
|
-
paint:
|
|
1496
|
-
legend:
|
|
1497
|
-
popup:
|
|
1529
|
+
paint: M,
|
|
1530
|
+
legend: m,
|
|
1531
|
+
popup: d
|
|
1498
1532
|
};
|
|
1499
|
-
|
|
1533
|
+
$ && (E.where = $), y.minZoom !== void 0 && (E.minZoom = y.minZoom), y.maxZoom !== void 0 && (E.maxZoom = y.maxZoom), s && (E.outlinePaint = s), t.push(E);
|
|
1500
1534
|
} catch {
|
|
1501
1535
|
}
|
|
1502
|
-
return t.sort((
|
|
1536
|
+
return t.sort((a, l) => a.title.localeCompare(l.title)), t;
|
|
1503
1537
|
}
|
|
1504
|
-
const bt = {},
|
|
1505
|
-
function
|
|
1538
|
+
const bt = {}, at = "376af635c84643cd816a8c5d017a53aa", Zn = at;
|
|
1539
|
+
function lt(e, n) {
|
|
1506
1540
|
let t = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
|
|
1507
|
-
return
|
|
1541
|
+
return n && (t += `&token=${n}`), t;
|
|
1508
1542
|
}
|
|
1509
|
-
function
|
|
1510
|
-
return at
|
|
1543
|
+
function Bn() {
|
|
1544
|
+
return lt(at);
|
|
1511
1545
|
}
|
|
1512
|
-
const
|
|
1513
|
-
function
|
|
1514
|
-
e ? (
|
|
1546
|
+
const Ae = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
|
|
1547
|
+
function Qo(e) {
|
|
1548
|
+
e ? (Ae.delete(e), _e.delete(e)) : (Ae.clear(), _e.clear());
|
|
1515
1549
|
}
|
|
1516
|
-
let
|
|
1517
|
-
async function
|
|
1518
|
-
const e = typeof import.meta < "u" && bt?.VITE_AGO_USERNAME,
|
|
1519
|
-
if (!(!e || !
|
|
1520
|
-
if (
|
|
1521
|
-
return
|
|
1550
|
+
let Be, wt = 0;
|
|
1551
|
+
async function Ko() {
|
|
1552
|
+
const e = typeof import.meta < "u" && bt?.VITE_AGO_USERNAME, n = typeof import.meta < "u" && bt?.VITE_AGO_PASSWORD;
|
|
1553
|
+
if (!(!e || !n)) {
|
|
1554
|
+
if (Be && Date.now() < wt - 3e5)
|
|
1555
|
+
return Be;
|
|
1522
1556
|
try {
|
|
1523
1557
|
const o = await (await fetch("https://www.arcgis.com/sharing/rest/generateToken", {
|
|
1524
1558
|
method: "POST",
|
|
@@ -1528,183 +1562,183 @@ async function Qo() {
|
|
|
1528
1562
|
body: new URLSearchParams({
|
|
1529
1563
|
f: "json",
|
|
1530
1564
|
username: e,
|
|
1531
|
-
password:
|
|
1565
|
+
password: n,
|
|
1532
1566
|
referer: window.location.origin || "https://localhost",
|
|
1533
1567
|
expiration: "120"
|
|
1534
1568
|
// 2 hours
|
|
1535
1569
|
})
|
|
1536
1570
|
})).json();
|
|
1537
|
-
return o.error ? void 0 : (
|
|
1571
|
+
return o.error ? void 0 : (Be = o.token, wt = o.expires, Be);
|
|
1538
1572
|
} catch {
|
|
1539
1573
|
return;
|
|
1540
1574
|
}
|
|
1541
1575
|
}
|
|
1542
1576
|
}
|
|
1543
|
-
async function
|
|
1544
|
-
const t =
|
|
1577
|
+
async function Xo(e, n) {
|
|
1578
|
+
const t = lt(e, n), o = await fetch(t);
|
|
1545
1579
|
if (!o.ok)
|
|
1546
1580
|
throw new Error(`Failed to fetch WebMap: ${o.status} ${o.statusText}`);
|
|
1547
|
-
const
|
|
1548
|
-
if (
|
|
1549
|
-
throw new Error(`ArcGIS error: ${
|
|
1550
|
-
return
|
|
1581
|
+
const a = await o.json();
|
|
1582
|
+
if (a.error)
|
|
1583
|
+
throw new Error(`ArcGIS error: ${a.error.message || a.error.code || "Unknown error"}`);
|
|
1584
|
+
return a;
|
|
1551
1585
|
}
|
|
1552
|
-
async function
|
|
1586
|
+
async function Yo(e) {
|
|
1553
1587
|
try {
|
|
1554
|
-
const
|
|
1588
|
+
const n = await Ko(), t = await Xo(e, n);
|
|
1555
1589
|
return await kt(t);
|
|
1556
|
-
} catch (
|
|
1557
|
-
throw new Error(`Failed to load dynamic layer configs: ${
|
|
1590
|
+
} catch (n) {
|
|
1591
|
+
throw new Error(`Failed to load dynamic layer configs: ${n instanceof Error ? n.message : "Unknown error"}`);
|
|
1558
1592
|
}
|
|
1559
1593
|
}
|
|
1560
|
-
async function it(e =
|
|
1561
|
-
const
|
|
1562
|
-
if (
|
|
1563
|
-
return
|
|
1564
|
-
const t =
|
|
1594
|
+
async function it(e = at) {
|
|
1595
|
+
const n = Ae.get(e);
|
|
1596
|
+
if (n)
|
|
1597
|
+
return n;
|
|
1598
|
+
const t = _e.get(e);
|
|
1565
1599
|
if (t)
|
|
1566
1600
|
return t;
|
|
1567
1601
|
const o = (async () => {
|
|
1568
1602
|
try {
|
|
1569
|
-
const
|
|
1570
|
-
return
|
|
1603
|
+
const a = await Yo(e);
|
|
1604
|
+
return Ae.set(e, a), a;
|
|
1571
1605
|
} finally {
|
|
1572
|
-
|
|
1606
|
+
_e.delete(e);
|
|
1573
1607
|
}
|
|
1574
1608
|
})();
|
|
1575
|
-
return
|
|
1609
|
+
return _e.set(e, o), o;
|
|
1576
1610
|
}
|
|
1577
|
-
function
|
|
1578
|
-
const
|
|
1611
|
+
function en(e) {
|
|
1612
|
+
const n = C({}), t = /* @__PURE__ */ new Map();
|
|
1579
1613
|
for (const s of e)
|
|
1580
|
-
|
|
1614
|
+
n.value[s.id] = {
|
|
1581
1615
|
data: null,
|
|
1582
1616
|
loading: !1,
|
|
1583
1617
|
error: null,
|
|
1584
1618
|
lastFetched: null
|
|
1585
1619
|
};
|
|
1586
1620
|
async function o(s) {
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
...
|
|
1590
|
-
[
|
|
1591
|
-
data:
|
|
1592
|
-
lastFetched:
|
|
1621
|
+
const d = s.id;
|
|
1622
|
+
n.value = {
|
|
1623
|
+
...n.value,
|
|
1624
|
+
[d]: {
|
|
1625
|
+
data: n.value[d]?.data ?? null,
|
|
1626
|
+
lastFetched: n.value[d]?.lastFetched ?? null,
|
|
1593
1627
|
loading: !0,
|
|
1594
1628
|
error: null
|
|
1595
1629
|
}
|
|
1596
1630
|
};
|
|
1597
1631
|
try {
|
|
1598
|
-
let
|
|
1632
|
+
let $;
|
|
1599
1633
|
if (s.type === "http-get") {
|
|
1600
|
-
const
|
|
1634
|
+
const y = await fetch(s.url, {
|
|
1601
1635
|
method: "GET",
|
|
1602
1636
|
...s.options
|
|
1603
1637
|
});
|
|
1604
|
-
if (!
|
|
1605
|
-
throw new Error(`HTTP ${
|
|
1606
|
-
|
|
1638
|
+
if (!y.ok)
|
|
1639
|
+
throw new Error(`HTTP ${y.status}: ${y.statusText}`);
|
|
1640
|
+
$ = await y.json();
|
|
1607
1641
|
} else if (s.type === "http-post") {
|
|
1608
|
-
const
|
|
1642
|
+
const y = await fetch(s.url, {
|
|
1609
1643
|
method: "POST",
|
|
1610
1644
|
...s.options
|
|
1611
1645
|
});
|
|
1612
|
-
if (!h.ok)
|
|
1613
|
-
throw new Error(`HTTP ${h.status}: ${h.statusText}`);
|
|
1614
|
-
T = await h.json();
|
|
1615
|
-
} else if (s.type === "esri") {
|
|
1616
|
-
const C = `${s.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, y = await fetch(C, s.options);
|
|
1617
1646
|
if (!y.ok)
|
|
1618
1647
|
throw new Error(`HTTP ${y.status}: ${y.statusText}`);
|
|
1619
|
-
|
|
1648
|
+
$ = await y.json();
|
|
1649
|
+
} else if (s.type === "esri") {
|
|
1650
|
+
const S = `${s.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, g = await fetch(S, s.options);
|
|
1651
|
+
if (!g.ok)
|
|
1652
|
+
throw new Error(`HTTP ${g.status}: ${g.statusText}`);
|
|
1653
|
+
$ = (await g.json()).features?.map((E) => E.attributes) || [];
|
|
1620
1654
|
} else
|
|
1621
1655
|
throw new Error(`Unknown data source type: ${s.type}`);
|
|
1622
|
-
s.transform && (
|
|
1623
|
-
...
|
|
1624
|
-
[
|
|
1625
|
-
data:
|
|
1656
|
+
s.transform && ($ = s.transform($)), n.value = {
|
|
1657
|
+
...n.value,
|
|
1658
|
+
[d]: {
|
|
1659
|
+
data: $,
|
|
1626
1660
|
loading: !1,
|
|
1627
1661
|
error: null,
|
|
1628
1662
|
lastFetched: Date.now()
|
|
1629
1663
|
}
|
|
1630
1664
|
};
|
|
1631
|
-
} catch (
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1634
|
-
...
|
|
1635
|
-
[
|
|
1636
|
-
data:
|
|
1637
|
-
lastFetched:
|
|
1665
|
+
} catch ($) {
|
|
1666
|
+
const y = $ instanceof Error ? $.message : "Unknown error";
|
|
1667
|
+
n.value = {
|
|
1668
|
+
...n.value,
|
|
1669
|
+
[d]: {
|
|
1670
|
+
data: n.value[d]?.data ?? null,
|
|
1671
|
+
lastFetched: n.value[d]?.lastFetched ?? null,
|
|
1638
1672
|
loading: !1,
|
|
1639
|
-
error:
|
|
1673
|
+
error: y
|
|
1640
1674
|
}
|
|
1641
1675
|
};
|
|
1642
1676
|
}
|
|
1643
1677
|
}
|
|
1644
|
-
async function
|
|
1678
|
+
async function a() {
|
|
1645
1679
|
await Promise.all(e.map((s) => o(s)));
|
|
1646
1680
|
}
|
|
1647
|
-
async function
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1681
|
+
async function l(s) {
|
|
1682
|
+
const d = e.find(($) => $.id === s);
|
|
1683
|
+
d && await o(d);
|
|
1650
1684
|
}
|
|
1651
1685
|
function c(s) {
|
|
1652
|
-
return
|
|
1686
|
+
return n.value[s]?.data ?? null;
|
|
1653
1687
|
}
|
|
1654
|
-
const
|
|
1655
|
-
function
|
|
1656
|
-
return
|
|
1688
|
+
const h = I(() => Object.values(n.value).some((s) => s.loading));
|
|
1689
|
+
function f(s) {
|
|
1690
|
+
return n.value[s]?.loading ?? !1;
|
|
1657
1691
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return
|
|
1692
|
+
function M(s) {
|
|
1693
|
+
return n.value[s]?.error ?? null;
|
|
1660
1694
|
}
|
|
1661
|
-
function
|
|
1695
|
+
function m() {
|
|
1662
1696
|
for (const s of e)
|
|
1663
1697
|
if (s.pollInterval && s.pollInterval > 0) {
|
|
1664
|
-
const
|
|
1698
|
+
const d = window.setInterval(() => {
|
|
1665
1699
|
o(s);
|
|
1666
1700
|
}, s.pollInterval);
|
|
1667
|
-
t.set(s.id,
|
|
1701
|
+
t.set(s.id, d);
|
|
1668
1702
|
}
|
|
1669
1703
|
}
|
|
1670
|
-
function
|
|
1704
|
+
function v() {
|
|
1671
1705
|
for (const [, s] of t)
|
|
1672
1706
|
window.clearInterval(s);
|
|
1673
1707
|
t.clear();
|
|
1674
1708
|
}
|
|
1675
|
-
return
|
|
1676
|
-
|
|
1709
|
+
return Ve(() => {
|
|
1710
|
+
a(), m();
|
|
1677
1711
|
}), Lt(() => {
|
|
1678
|
-
|
|
1712
|
+
v();
|
|
1679
1713
|
}), {
|
|
1680
1714
|
/** Reactive state for all data sources */
|
|
1681
|
-
state: W(
|
|
1715
|
+
state: W(n),
|
|
1682
1716
|
/** Whether any data source is currently loading */
|
|
1683
|
-
isLoading:
|
|
1717
|
+
isLoading: h,
|
|
1684
1718
|
/** Fetch all data sources */
|
|
1685
|
-
fetchAll:
|
|
1719
|
+
fetchAll: a,
|
|
1686
1720
|
/** Refetch a specific data source by id */
|
|
1687
|
-
refetch:
|
|
1721
|
+
refetch: l,
|
|
1688
1722
|
/** Get data for a specific source */
|
|
1689
1723
|
getData: c,
|
|
1690
1724
|
/** Check if a specific source is loading */
|
|
1691
|
-
isSourceLoading:
|
|
1725
|
+
isSourceLoading: f,
|
|
1692
1726
|
/** Get error for a specific source */
|
|
1693
|
-
getError:
|
|
1727
|
+
getError: M,
|
|
1694
1728
|
/** Stop all polling (useful for cleanup) */
|
|
1695
|
-
stopPolling:
|
|
1729
|
+
stopPolling: v
|
|
1696
1730
|
};
|
|
1697
1731
|
}
|
|
1698
|
-
const
|
|
1732
|
+
const tn = { class: "layerboard-layout" }, on = {
|
|
1699
1733
|
key: 0,
|
|
1700
1734
|
class: "layerboard-subtitle"
|
|
1701
|
-
},
|
|
1735
|
+
}, nn = { class: "layerboard-mobile-menu-content" }, an = { class: "layerboard-main" }, ln = {
|
|
1702
1736
|
key: 0,
|
|
1703
1737
|
class: "layerboard-loading"
|
|
1704
|
-
},
|
|
1738
|
+
}, rn = {
|
|
1705
1739
|
key: 1,
|
|
1706
1740
|
class: "layerboard-error"
|
|
1707
|
-
},
|
|
1741
|
+
}, sn = { key: 0 }, cn = { key: 1 }, un = { class: "layerboard-modal" }, dn = /* @__PURE__ */ we({
|
|
1708
1742
|
__name: "Layerboard",
|
|
1709
1743
|
props: {
|
|
1710
1744
|
title: {},
|
|
@@ -1732,181 +1766,181 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1732
1766
|
initialCenter: {}
|
|
1733
1767
|
},
|
|
1734
1768
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
1735
|
-
setup(e, { expose:
|
|
1736
|
-
const o = e,
|
|
1737
|
-
function
|
|
1769
|
+
setup(e, { expose: n, emit: t }) {
|
|
1770
|
+
const o = e, a = t, l = C([]), c = C(!0), h = C(null), f = C(12), M = C(""), m = C(/* @__PURE__ */ new Set()), v = C({}), s = C(/* @__PURE__ */ new Set()), d = C({}), $ = C({}), y = C(/* @__PURE__ */ new Set()), S = C({});
|
|
1771
|
+
function g() {
|
|
1738
1772
|
const L = {};
|
|
1739
|
-
for (const
|
|
1740
|
-
L[
|
|
1741
|
-
|
|
1773
|
+
for (const F of o.tiledLayers)
|
|
1774
|
+
L[F.id] = F.opacity ?? 1;
|
|
1775
|
+
S.value = L;
|
|
1742
1776
|
}
|
|
1743
1777
|
function b(L) {
|
|
1744
|
-
|
|
1778
|
+
y.value.has(L) ? y.value.delete(L) : y.value.add(L), y.value = new Set(y.value);
|
|
1745
1779
|
}
|
|
1746
|
-
function E(L,
|
|
1747
|
-
|
|
1780
|
+
function E(L, F) {
|
|
1781
|
+
F ? y.value.add(L) : y.value.delete(L), y.value = new Set(y.value);
|
|
1748
1782
|
}
|
|
1749
|
-
function
|
|
1750
|
-
|
|
1783
|
+
function T(L, F) {
|
|
1784
|
+
S.value = { ...S.value, [L]: F };
|
|
1751
1785
|
}
|
|
1752
|
-
const B = o.dataSources.length > 0 ?
|
|
1786
|
+
const B = o.dataSources.length > 0 ? en(o.dataSources) : null, q = I(() => B?.state.value ?? {}), ce = I(() => B?.isLoading.value ?? !1);
|
|
1753
1787
|
function Le(L) {
|
|
1754
1788
|
return B?.getData(L) ?? null;
|
|
1755
1789
|
}
|
|
1756
1790
|
function Se(L) {
|
|
1757
1791
|
return B?.refetch(L) ?? Promise.resolve();
|
|
1758
1792
|
}
|
|
1759
|
-
U("layerboard-layers", W(
|
|
1760
|
-
const We =
|
|
1793
|
+
U("layerboard-layers", W(l)), U("layerboard-visible", m), U("layerboard-opacities", v), U("layerboard-loading", W(s)), U("layerboard-errors", W(d)), U("layerboard-zoom", W(f)), U("layerboard-toggle-layer", Ce), U("layerboard-set-layer-visible", fe), U("layerboard-set-layers-visible", ke), U("layerboard-set-opacity", pe), U("layerboard-tiled-layers", W(I(() => o.tiledLayers))), U("layerboard-visible-tiled", y), U("layerboard-tiled-opacities", S), U("layerboard-toggle-tiled", b), U("layerboard-set-tiled-opacity", T), U("layerboard-set-tiled-visible", E), U("layerboard-data-sources-state", q), U("layerboard-data-sources-loading", ce), U("layerboard-get-data-source", Le), U("layerboard-refetch-data-source", Se);
|
|
1794
|
+
const We = I(() => ({
|
|
1761
1795
|
backgroundColor: o.themeColor
|
|
1762
|
-
})), je =
|
|
1796
|
+
})), je = I(() => ({
|
|
1763
1797
|
backgroundColor: o.themeColor
|
|
1764
|
-
})),
|
|
1798
|
+
})), ze = I(() => ({
|
|
1765
1799
|
backgroundColor: o.themeColor
|
|
1766
|
-
})),
|
|
1767
|
-
width:
|
|
1800
|
+
})), Ie = I(() => ({
|
|
1801
|
+
width: ge.value ? "0" : o.sidebarWidth
|
|
1768
1802
|
}));
|
|
1769
|
-
async function
|
|
1803
|
+
async function Te() {
|
|
1770
1804
|
try {
|
|
1771
|
-
c.value = !0,
|
|
1772
|
-
const
|
|
1773
|
-
const Q = o.layerStyleOverrides[
|
|
1805
|
+
c.value = !0, h.value = null;
|
|
1806
|
+
const F = (await it(o.webMapId)).map((A) => {
|
|
1807
|
+
const Q = o.layerStyleOverrides[A.id];
|
|
1774
1808
|
return Q ? {
|
|
1775
|
-
...
|
|
1776
|
-
paint: Q.paint ??
|
|
1777
|
-
outlinePaint: Q.outlinePaint ??
|
|
1778
|
-
legend: Q.legend ??
|
|
1779
|
-
type: Q.type ??
|
|
1780
|
-
} :
|
|
1809
|
+
...A,
|
|
1810
|
+
paint: Q.paint ?? A.paint,
|
|
1811
|
+
outlinePaint: Q.outlinePaint ?? A.outlinePaint,
|
|
1812
|
+
legend: Q.legend ?? A.legend,
|
|
1813
|
+
type: Q.type ?? A.type
|
|
1814
|
+
} : A;
|
|
1781
1815
|
});
|
|
1782
|
-
|
|
1783
|
-
config:
|
|
1784
|
-
component:
|
|
1816
|
+
l.value = F.map((A) => ({
|
|
1817
|
+
config: A,
|
|
1818
|
+
component: A.type
|
|
1785
1819
|
}));
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
}),
|
|
1820
|
+
const re = {};
|
|
1821
|
+
F.forEach((A) => {
|
|
1822
|
+
re[A.id] = A.opacity ?? 1;
|
|
1823
|
+
}), v.value = re, a("configs-loaded", F);
|
|
1790
1824
|
} catch (L) {
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1825
|
+
const F = L instanceof Error ? L.message : "Failed to load layer configurations";
|
|
1826
|
+
h.value = F, a("load-error", F);
|
|
1793
1827
|
} finally {
|
|
1794
1828
|
c.value = !1;
|
|
1795
1829
|
}
|
|
1796
1830
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let
|
|
1799
|
-
return
|
|
1831
|
+
function Re(L) {
|
|
1832
|
+
let F = L.split("?")[0] || L;
|
|
1833
|
+
return F = F.replace(/\/query$/, ""), F = F.replace(/\/$/, ""), F.toLowerCase();
|
|
1800
1834
|
}
|
|
1801
1835
|
async function qe() {
|
|
1802
1836
|
if (o.fetchMetadata)
|
|
1803
1837
|
try {
|
|
1804
1838
|
const L = "https://phl.carto.com/api/v2/sql?q=" + encodeURIComponent(
|
|
1805
1839
|
"select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
|
|
1806
|
-
),
|
|
1807
|
-
if (!
|
|
1808
|
-
const
|
|
1809
|
-
for (const Q of
|
|
1840
|
+
), F = await fetch(L);
|
|
1841
|
+
if (!F.ok) return;
|
|
1842
|
+
const re = await F.json(), A = {};
|
|
1843
|
+
for (const Q of re.rows || [])
|
|
1810
1844
|
if (Q.url_text && Q.representation) {
|
|
1811
|
-
const Qe =
|
|
1812
|
-
|
|
1845
|
+
const Qe = Re(Q.url_text), Ke = `https://metadata.phila.gov/#home/representationdetails/${Q.representation}/`;
|
|
1846
|
+
A[Qe] = Ke;
|
|
1813
1847
|
}
|
|
1814
|
-
|
|
1848
|
+
$.value = A;
|
|
1815
1849
|
} catch {
|
|
1816
1850
|
}
|
|
1817
1851
|
}
|
|
1818
1852
|
function Ge(L) {
|
|
1819
|
-
|
|
1853
|
+
f.value = L, a("zoom", L);
|
|
1820
1854
|
}
|
|
1821
1855
|
function Ce(L) {
|
|
1822
|
-
|
|
1856
|
+
m.value.has(L) ? m.value.delete(L) : m.value.add(L), m.value = new Set(m.value);
|
|
1823
1857
|
}
|
|
1824
|
-
function
|
|
1825
|
-
|
|
1858
|
+
function fe(L, F) {
|
|
1859
|
+
F ? m.value.add(L) : m.value.delete(L), m.value = new Set(m.value);
|
|
1826
1860
|
}
|
|
1827
|
-
function ke(L,
|
|
1828
|
-
for (const
|
|
1829
|
-
|
|
1830
|
-
|
|
1861
|
+
function ke(L, F) {
|
|
1862
|
+
for (const re of L)
|
|
1863
|
+
F ? m.value.add(re) : m.value.delete(re);
|
|
1864
|
+
m.value = new Set(m.value);
|
|
1831
1865
|
}
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1866
|
+
function pe(L, F) {
|
|
1867
|
+
v.value = { ...v.value, [L]: F };
|
|
1834
1868
|
}
|
|
1835
|
-
function He(L,
|
|
1836
|
-
|
|
1869
|
+
function He(L, F) {
|
|
1870
|
+
F ? s.value.add(L) : s.value.delete(L), s.value = new Set(s.value);
|
|
1837
1871
|
}
|
|
1838
|
-
function oe(L,
|
|
1839
|
-
if (
|
|
1840
|
-
|
|
1872
|
+
function oe(L, F) {
|
|
1873
|
+
if (F)
|
|
1874
|
+
d.value = { ...d.value, [L]: F };
|
|
1841
1875
|
else {
|
|
1842
|
-
const { [L]:
|
|
1843
|
-
|
|
1876
|
+
const { [L]: re, ...A } = d.value;
|
|
1877
|
+
d.value = A;
|
|
1844
1878
|
}
|
|
1845
1879
|
}
|
|
1846
|
-
function
|
|
1847
|
-
|
|
1880
|
+
function ye(L) {
|
|
1881
|
+
M.value = L;
|
|
1848
1882
|
}
|
|
1849
|
-
const J =
|
|
1883
|
+
const J = C("map");
|
|
1850
1884
|
function $e() {
|
|
1851
1885
|
J.value = J.value === "sidebar" ? "map" : "sidebar";
|
|
1852
1886
|
}
|
|
1853
|
-
const ve =
|
|
1887
|
+
const ve = C(!1);
|
|
1854
1888
|
function Je() {
|
|
1855
1889
|
ve.value = !ve.value;
|
|
1856
1890
|
}
|
|
1857
|
-
function
|
|
1891
|
+
function De() {
|
|
1858
1892
|
ve.value = !1;
|
|
1859
1893
|
}
|
|
1860
|
-
const
|
|
1894
|
+
const ge = C(!1);
|
|
1861
1895
|
function xe() {
|
|
1862
|
-
|
|
1896
|
+
ge.value = !ge.value;
|
|
1863
1897
|
}
|
|
1864
|
-
const te =
|
|
1898
|
+
const te = C(!1);
|
|
1865
1899
|
function be() {
|
|
1866
1900
|
te.value = !0;
|
|
1867
1901
|
}
|
|
1868
1902
|
function le() {
|
|
1869
1903
|
te.value = !1;
|
|
1870
1904
|
}
|
|
1871
|
-
function
|
|
1905
|
+
function Ze(L) {
|
|
1872
1906
|
L.target.classList.contains("layerboard-modal-backdrop") && le();
|
|
1873
1907
|
}
|
|
1874
|
-
return U("layerboard-open-modal", be), U("layerboard-close-modal", le), U("layerboard-is-modal-open", W(te)),
|
|
1908
|
+
return U("layerboard-open-modal", be), U("layerboard-close-modal", le), U("layerboard-is-modal-open", W(te)), n({
|
|
1875
1909
|
/** Layer configurations */
|
|
1876
|
-
layerList:
|
|
1910
|
+
layerList: l,
|
|
1877
1911
|
/** Set of visible layer IDs */
|
|
1878
|
-
visibleLayers:
|
|
1912
|
+
visibleLayers: m,
|
|
1879
1913
|
/** Layer opacity values */
|
|
1880
|
-
layerOpacities:
|
|
1914
|
+
layerOpacities: v,
|
|
1881
1915
|
/** Set of currently loading layer IDs */
|
|
1882
1916
|
loadingLayers: s,
|
|
1883
1917
|
/** Map of layer errors by ID */
|
|
1884
|
-
layerErrors:
|
|
1918
|
+
layerErrors: d,
|
|
1885
1919
|
/** Current map zoom level */
|
|
1886
|
-
currentZoom:
|
|
1920
|
+
currentZoom: f,
|
|
1887
1921
|
/** Toggle a layer's visibility */
|
|
1888
1922
|
toggleLayer: Ce,
|
|
1889
1923
|
/** Set a layer's visibility explicitly */
|
|
1890
|
-
setLayerVisible:
|
|
1924
|
+
setLayerVisible: fe,
|
|
1891
1925
|
/** Set multiple layers' visibility at once */
|
|
1892
1926
|
setLayersVisible: ke,
|
|
1893
1927
|
/** Set a layer's opacity */
|
|
1894
|
-
setLayerOpacity:
|
|
1928
|
+
setLayerOpacity: pe,
|
|
1895
1929
|
/** Reload layer configurations */
|
|
1896
|
-
reloadConfigs:
|
|
1930
|
+
reloadConfigs: Te,
|
|
1897
1931
|
/** Clear configuration cache */
|
|
1898
|
-
clearCache: () =>
|
|
1932
|
+
clearCache: () => Qo(o.webMapId),
|
|
1899
1933
|
// Tiled layer APIs
|
|
1900
1934
|
/** Set of visible tiled layer IDs */
|
|
1901
|
-
visibleTiledLayers:
|
|
1935
|
+
visibleTiledLayers: y,
|
|
1902
1936
|
/** Tiled layer opacity values */
|
|
1903
|
-
tiledLayerOpacities:
|
|
1937
|
+
tiledLayerOpacities: S,
|
|
1904
1938
|
/** Toggle a tiled layer's visibility */
|
|
1905
1939
|
toggleTiledLayer: b,
|
|
1906
1940
|
/** Set a tiled layer's visibility explicitly */
|
|
1907
1941
|
setTiledLayerVisible: E,
|
|
1908
1942
|
/** Set a tiled layer's opacity */
|
|
1909
|
-
setTiledLayerOpacity:
|
|
1943
|
+
setTiledLayerOpacity: T,
|
|
1910
1944
|
// Data source APIs
|
|
1911
1945
|
/** State of all data sources */
|
|
1912
1946
|
dataSourcesState: q,
|
|
@@ -1923,14 +1957,14 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1923
1957
|
openModal: be,
|
|
1924
1958
|
/** Close the modal */
|
|
1925
1959
|
closeModal: le
|
|
1926
|
-
}),
|
|
1927
|
-
|
|
1928
|
-
}), (L,
|
|
1960
|
+
}), Ve(() => {
|
|
1961
|
+
Te(), qe(), g();
|
|
1962
|
+
}), (L, F) => (p(), w("div", tn, [
|
|
1929
1963
|
P("header", {
|
|
1930
1964
|
class: "layerboard-header",
|
|
1931
|
-
style:
|
|
1965
|
+
style: ee(We.value)
|
|
1932
1966
|
}, [
|
|
1933
|
-
|
|
1967
|
+
F[1] || (F[1] = P("a", {
|
|
1934
1968
|
href: "https://www.phila.gov/",
|
|
1935
1969
|
class: "layerboard-logo layerboard-desktop-only"
|
|
1936
1970
|
}, [
|
|
@@ -1939,122 +1973,122 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1939
1973
|
alt: "City of Philadelphia"
|
|
1940
1974
|
})
|
|
1941
1975
|
], -1)),
|
|
1942
|
-
|
|
1976
|
+
F[2] || (F[2] = P("span", { class: "layerboard-header-divider layerboard-desktop-only" }, null, -1)),
|
|
1943
1977
|
P("button", {
|
|
1944
1978
|
class: "layerboard-hamburger layerboard-mobile-only",
|
|
1945
1979
|
onClick: Je,
|
|
1946
1980
|
"aria-label": "Toggle menu"
|
|
1947
1981
|
}, [
|
|
1948
|
-
|
|
1949
|
-
"icon-definition": _(
|
|
1982
|
+
K(_(ue), {
|
|
1983
|
+
"icon-definition": _(mo),
|
|
1950
1984
|
size: "medium",
|
|
1951
1985
|
decorative: ""
|
|
1952
1986
|
}, null, 8, ["icon-definition"])
|
|
1953
1987
|
]),
|
|
1954
|
-
|
|
1988
|
+
ae(L.$slots, "header", {}, () => [
|
|
1955
1989
|
P("h1", null, j(e.title), 1),
|
|
1956
|
-
e.subtitle ? (
|
|
1990
|
+
e.subtitle ? (p(), w("span", on, j(e.subtitle), 1)) : O("", !0)
|
|
1957
1991
|
], !0),
|
|
1958
|
-
ve.value ? (
|
|
1992
|
+
ve.value ? (p(), w("div", {
|
|
1959
1993
|
key: 0,
|
|
1960
1994
|
class: "layerboard-mobile-menu",
|
|
1961
|
-
style:
|
|
1995
|
+
style: ee({ backgroundColor: e.themeColor })
|
|
1962
1996
|
}, [
|
|
1963
|
-
P("div",
|
|
1964
|
-
|
|
1997
|
+
P("div", nn, [
|
|
1998
|
+
ae(L.$slots, "footer", {
|
|
1965
1999
|
openModal: be,
|
|
1966
2000
|
closeModal: le,
|
|
1967
2001
|
isModalOpen: te.value
|
|
1968
2002
|
}, () => [
|
|
1969
|
-
|
|
2003
|
+
F[0] || (F[0] = me(" City of Philadelphia ", -1))
|
|
1970
2004
|
], !0)
|
|
1971
2005
|
]),
|
|
1972
2006
|
P("button", {
|
|
1973
2007
|
class: "layerboard-mobile-menu-close",
|
|
1974
|
-
onClick:
|
|
2008
|
+
onClick: De,
|
|
1975
2009
|
"aria-label": "Close menu"
|
|
1976
2010
|
}, [
|
|
1977
|
-
|
|
2011
|
+
K(_(ue), {
|
|
1978
2012
|
"icon-definition": _(mt),
|
|
1979
2013
|
size: "medium",
|
|
1980
2014
|
decorative: ""
|
|
1981
2015
|
}, null, 8, ["icon-definition"])
|
|
1982
2016
|
])
|
|
1983
2017
|
], 4)) : O("", !0),
|
|
1984
|
-
ve.value ? (
|
|
2018
|
+
ve.value ? (p(), w("div", {
|
|
1985
2019
|
key: 1,
|
|
1986
2020
|
class: "layerboard-mobile-menu-backdrop",
|
|
1987
|
-
onClick:
|
|
2021
|
+
onClick: De
|
|
1988
2022
|
})) : O("", !0)
|
|
1989
2023
|
], 4),
|
|
1990
|
-
P("div",
|
|
1991
|
-
c.value ? (
|
|
2024
|
+
P("div", an, [
|
|
2025
|
+
c.value ? (p(), w("div", ln, [
|
|
1992
2026
|
P("div", {
|
|
1993
2027
|
class: "layerboard-spinner",
|
|
1994
|
-
style:
|
|
2028
|
+
style: ee({ borderTopColor: e.themeColor })
|
|
1995
2029
|
}, null, 4),
|
|
1996
2030
|
P("p", null, "Loading " + j(e.title) + "...", 1)
|
|
1997
|
-
])) :
|
|
1998
|
-
|
|
1999
|
-
P("p", null, j(
|
|
2031
|
+
])) : h.value ? (p(), w("div", rn, [
|
|
2032
|
+
F[3] || (F[3] = P("h2", null, "Error Loading Layers", -1)),
|
|
2033
|
+
P("p", null, j(h.value), 1),
|
|
2000
2034
|
P("button", {
|
|
2001
2035
|
class: "layerboard-retry-button",
|
|
2002
|
-
style:
|
|
2003
|
-
onClick:
|
|
2036
|
+
style: ee({ backgroundColor: e.themeColor }),
|
|
2037
|
+
onClick: Te
|
|
2004
2038
|
}, " Retry ", 4)
|
|
2005
|
-
])) : (
|
|
2039
|
+
])) : (p(), w(ie, { key: 2 }, [
|
|
2006
2040
|
P("aside", {
|
|
2007
2041
|
class: ne(["layerboard-sidebar", { "is-active": J.value === "sidebar" }]),
|
|
2008
|
-
style:
|
|
2042
|
+
style: ee(Ie.value)
|
|
2009
2043
|
}, [
|
|
2010
|
-
|
|
2011
|
-
layers:
|
|
2012
|
-
visibleLayers:
|
|
2013
|
-
layerOpacities:
|
|
2044
|
+
ae(L.$slots, "sidebar", {
|
|
2045
|
+
layers: l.value,
|
|
2046
|
+
visibleLayers: m.value,
|
|
2047
|
+
layerOpacities: v.value,
|
|
2014
2048
|
loadingLayers: s.value,
|
|
2015
|
-
layerErrors:
|
|
2016
|
-
currentZoom:
|
|
2049
|
+
layerErrors: d.value,
|
|
2050
|
+
currentZoom: f.value,
|
|
2017
2051
|
toggleLayer: Ce,
|
|
2018
|
-
setLayerVisible:
|
|
2052
|
+
setLayerVisible: fe,
|
|
2019
2053
|
setLayersVisible: ke,
|
|
2020
|
-
setOpacity:
|
|
2054
|
+
setOpacity: pe,
|
|
2021
2055
|
tiledLayers: e.tiledLayers,
|
|
2022
|
-
visibleTiledLayers:
|
|
2023
|
-
tiledLayerOpacities:
|
|
2056
|
+
visibleTiledLayers: y.value,
|
|
2057
|
+
tiledLayerOpacities: S.value,
|
|
2024
2058
|
toggleTiledLayer: b,
|
|
2025
2059
|
setTiledLayerVisible: E,
|
|
2026
|
-
setTiledLayerOpacity:
|
|
2060
|
+
setTiledLayerOpacity: T,
|
|
2027
2061
|
dataSourcesState: q.value,
|
|
2028
2062
|
dataSourcesLoading: ce.value,
|
|
2029
2063
|
getDataSource: Le,
|
|
2030
2064
|
refetchDataSource: Se
|
|
2031
2065
|
}, () => [
|
|
2032
|
-
e.showDefaultSidebar ? (
|
|
2066
|
+
e.showDefaultSidebar ? (p(), Y(Do, {
|
|
2033
2067
|
key: 0,
|
|
2034
|
-
"layer-list":
|
|
2035
|
-
"visible-layers":
|
|
2036
|
-
"layer-opacities":
|
|
2068
|
+
"layer-list": l.value,
|
|
2069
|
+
"visible-layers": m.value,
|
|
2070
|
+
"layer-opacities": v.value,
|
|
2037
2071
|
"loading-layers": s.value,
|
|
2038
|
-
"layer-errors":
|
|
2039
|
-
"current-zoom":
|
|
2040
|
-
"search-query":
|
|
2041
|
-
"layer-metadata":
|
|
2072
|
+
"layer-errors": d.value,
|
|
2073
|
+
"current-zoom": f.value,
|
|
2074
|
+
"search-query": M.value,
|
|
2075
|
+
"layer-metadata": $.value,
|
|
2042
2076
|
onToggleLayer: Ce,
|
|
2043
|
-
onSetOpacity:
|
|
2044
|
-
onUpdateSearch:
|
|
2077
|
+
onSetOpacity: pe,
|
|
2078
|
+
onUpdateSearch: ye
|
|
2045
2079
|
}, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : O("", !0)
|
|
2046
2080
|
], !0)
|
|
2047
2081
|
], 6),
|
|
2048
2082
|
P("div", {
|
|
2049
2083
|
class: ne(["layerboard-map", { "is-active": J.value === "map" }])
|
|
2050
2084
|
}, [
|
|
2051
|
-
|
|
2052
|
-
"visible-layers":
|
|
2053
|
-
"layer-opacities":
|
|
2054
|
-
"layer-list":
|
|
2085
|
+
K(Xt, {
|
|
2086
|
+
"visible-layers": m.value,
|
|
2087
|
+
"layer-opacities": v.value,
|
|
2088
|
+
"layer-list": l.value,
|
|
2055
2089
|
"tiled-layers": e.tiledLayers,
|
|
2056
|
-
"visible-tiled-layers":
|
|
2057
|
-
"tiled-layer-opacities":
|
|
2090
|
+
"visible-tiled-layers": y.value,
|
|
2091
|
+
"tiled-layer-opacities": S.value,
|
|
2058
2092
|
"cyclomedia-config": e.cyclomediaConfig,
|
|
2059
2093
|
"pictometry-credentials": e.pictometryCredentials,
|
|
2060
2094
|
"basemap-control-position": e.basemapControlPosition,
|
|
@@ -2072,13 +2106,13 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2072
2106
|
}, null, 8, ["visible-layers", "layer-opacities", "layer-list", "tiled-layers", "visible-tiled-layers", "tiled-layer-opacities", "cyclomedia-config", "pictometry-credentials", "basemap-control-position", "navigation-control-position", "geolocation-control-position", "search-control-position", "draw-control-position", "cyclomedia-button-position", "pictometry-button-position", "initial-zoom", "initial-center"])
|
|
2073
2107
|
], 2),
|
|
2074
2108
|
P("button", {
|
|
2075
|
-
class: ne(["layerboard-sidebar-toggle", { "is-collapsed":
|
|
2076
|
-
style:
|
|
2109
|
+
class: ne(["layerboard-sidebar-toggle", { "is-collapsed": ge.value }]),
|
|
2110
|
+
style: ee({ left: ge.value ? "0" : o.sidebarWidth }),
|
|
2077
2111
|
onClick: xe,
|
|
2078
2112
|
"aria-label": "Toggle sidebar"
|
|
2079
2113
|
}, [
|
|
2080
|
-
|
|
2081
|
-
"icon-definition":
|
|
2114
|
+
K(_(ue), {
|
|
2115
|
+
"icon-definition": ge.value ? _(go) : _(ho),
|
|
2082
2116
|
size: "medium",
|
|
2083
2117
|
decorative: ""
|
|
2084
2118
|
}, null, 8, ["icon-definition"])
|
|
@@ -2087,49 +2121,49 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2087
2121
|
]),
|
|
2088
2122
|
P("button", {
|
|
2089
2123
|
class: "layerboard-mobile-toggle",
|
|
2090
|
-
style:
|
|
2124
|
+
style: ee(ze.value),
|
|
2091
2125
|
onClick: $e
|
|
2092
2126
|
}, [
|
|
2093
|
-
J.value === "map" ? (
|
|
2127
|
+
J.value === "map" ? (p(), w("span", sn, j(e.sidebarLabel), 1)) : (p(), w("span", cn, j(e.mapLabel), 1))
|
|
2094
2128
|
], 4),
|
|
2095
2129
|
P("footer", {
|
|
2096
2130
|
class: "layerboard-footer",
|
|
2097
|
-
style:
|
|
2131
|
+
style: ee(je.value)
|
|
2098
2132
|
}, [
|
|
2099
|
-
|
|
2133
|
+
ae(L.$slots, "footer", {
|
|
2100
2134
|
openModal: be,
|
|
2101
2135
|
closeModal: le,
|
|
2102
2136
|
isModalOpen: te.value
|
|
2103
2137
|
}, () => [
|
|
2104
|
-
|
|
2138
|
+
F[4] || (F[4] = me(" City of Philadelphia ", -1))
|
|
2105
2139
|
], !0)
|
|
2106
2140
|
], 4),
|
|
2107
|
-
te.value ? (
|
|
2141
|
+
te.value ? (p(), w("div", {
|
|
2108
2142
|
key: 0,
|
|
2109
2143
|
class: "layerboard-modal-backdrop",
|
|
2110
|
-
onClick:
|
|
2144
|
+
onClick: Ze
|
|
2111
2145
|
}, [
|
|
2112
|
-
P("div",
|
|
2146
|
+
P("div", un, [
|
|
2113
2147
|
P("button", {
|
|
2114
2148
|
class: "layerboard-modal-close",
|
|
2115
2149
|
onClick: le,
|
|
2116
2150
|
"aria-label": "Close modal"
|
|
2117
2151
|
}, [
|
|
2118
|
-
|
|
2152
|
+
K(_(ue), {
|
|
2119
2153
|
"icon-definition": _(mt),
|
|
2120
2154
|
size: "medium",
|
|
2121
2155
|
decorative: ""
|
|
2122
2156
|
}, null, 8, ["icon-definition"])
|
|
2123
2157
|
]),
|
|
2124
|
-
|
|
2158
|
+
ae(L.$slots, "modal", { closeModal: le }, void 0, !0)
|
|
2125
2159
|
])
|
|
2126
2160
|
])) : O("", !0)
|
|
2127
2161
|
]));
|
|
2128
2162
|
}
|
|
2129
|
-
}),
|
|
2163
|
+
}), Vn = /* @__PURE__ */ Oe(dn, [["__scopeId", "data-v-dac16679"]]), fn = ["aria-expanded"], pn = {
|
|
2130
2164
|
key: 0,
|
|
2131
2165
|
class: "topic-icon"
|
|
2132
|
-
},
|
|
2166
|
+
}, yn = { class: "topic-title" }, gn = { class: "topic-content" }, hn = /* @__PURE__ */ we({
|
|
2133
2167
|
__name: "TopicAccordion",
|
|
2134
2168
|
props: {
|
|
2135
2169
|
title: {},
|
|
@@ -2139,40 +2173,40 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2139
2173
|
headerClass: {}
|
|
2140
2174
|
},
|
|
2141
2175
|
emits: ["toggle", "layerChange"],
|
|
2142
|
-
setup(e, { emit:
|
|
2143
|
-
const t = e, o =
|
|
2176
|
+
setup(e, { emit: n }) {
|
|
2177
|
+
const t = e, o = n, a = C(t.expanded);
|
|
2144
2178
|
Pe(
|
|
2145
2179
|
() => t.expanded,
|
|
2146
2180
|
(c) => {
|
|
2147
|
-
|
|
2181
|
+
a.value = c;
|
|
2148
2182
|
}
|
|
2149
2183
|
);
|
|
2150
|
-
function
|
|
2151
|
-
|
|
2184
|
+
function l() {
|
|
2185
|
+
a.value = !a.value, o("toggle", a.value);
|
|
2152
2186
|
}
|
|
2153
|
-
return (c,
|
|
2154
|
-
const
|
|
2155
|
-
return
|
|
2156
|
-
class: ne(["topic-accordion", { "is-expanded":
|
|
2187
|
+
return (c, h) => {
|
|
2188
|
+
const f = _t("font-awesome-icon");
|
|
2189
|
+
return p(), w("div", {
|
|
2190
|
+
class: ne(["topic-accordion", { "is-expanded": a.value }])
|
|
2157
2191
|
}, [
|
|
2158
2192
|
P("button", {
|
|
2159
2193
|
class: ne(["topic-header", e.headerClass]),
|
|
2160
2194
|
type: "button",
|
|
2161
|
-
"aria-expanded":
|
|
2162
|
-
onClick:
|
|
2195
|
+
"aria-expanded": a.value,
|
|
2196
|
+
onClick: l
|
|
2163
2197
|
}, [
|
|
2164
|
-
e.icon || c.$slots.icon ? (
|
|
2165
|
-
|
|
2166
|
-
e.icon ? (
|
|
2198
|
+
e.icon || c.$slots.icon ? (p(), w("span", pn, [
|
|
2199
|
+
ae(c.$slots, "icon", {}, () => [
|
|
2200
|
+
e.icon ? (p(), Y(f, {
|
|
2167
2201
|
key: 0,
|
|
2168
2202
|
icon: ["fas", e.icon]
|
|
2169
2203
|
}, null, 8, ["icon"])) : O("", !0)
|
|
2170
2204
|
], !0)
|
|
2171
2205
|
])) : O("", !0),
|
|
2172
|
-
P("span",
|
|
2206
|
+
P("span", yn, j(e.title), 1),
|
|
2173
2207
|
P("span", {
|
|
2174
|
-
class: ne(["topic-chevron", { "is-rotated":
|
|
2175
|
-
}, [...
|
|
2208
|
+
class: ne(["topic-chevron", { "is-rotated": a.value }])
|
|
2209
|
+
}, [...h[0] || (h[0] = [
|
|
2176
2210
|
P("svg", {
|
|
2177
2211
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2178
2212
|
width: "20",
|
|
@@ -2187,39 +2221,39 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2187
2221
|
P("polyline", { points: "6 9 12 15 18 9" })
|
|
2188
2222
|
], -1)
|
|
2189
2223
|
])], 2)
|
|
2190
|
-
], 10,
|
|
2191
|
-
St(P("div",
|
|
2192
|
-
|
|
2193
|
-
|
|
2224
|
+
], 10, fn),
|
|
2225
|
+
St(P("div", gn, [
|
|
2226
|
+
ae(c.$slots, "default", {}, () => [
|
|
2227
|
+
h[1] || (h[1] = P("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
|
|
2194
2228
|
], !0)
|
|
2195
2229
|
], 512), [
|
|
2196
|
-
[Ot,
|
|
2230
|
+
[Ot, a.value]
|
|
2197
2231
|
])
|
|
2198
2232
|
], 2);
|
|
2199
2233
|
};
|
|
2200
2234
|
}
|
|
2201
|
-
}), An = /* @__PURE__ */
|
|
2235
|
+
}), An = /* @__PURE__ */ Oe(hn, [["__scopeId", "data-v-fb48c75b"]]), mn = { class: "layer-checkbox-set" }, vn = ["checked", "disabled", "onChange"], bn = { class: "layer-title" }, wn = {
|
|
2202
2236
|
key: 0,
|
|
2203
2237
|
class: "loading-indicator"
|
|
2204
|
-
},
|
|
2238
|
+
}, Ln = ["title"], Sn = {
|
|
2205
2239
|
key: 2,
|
|
2206
2240
|
class: "zoom-indicator"
|
|
2207
|
-
},
|
|
2241
|
+
}, Cn = { class: "layer-title" }, kn = {
|
|
2208
2242
|
key: 0,
|
|
2209
2243
|
class: "loading-indicator"
|
|
2210
|
-
},
|
|
2244
|
+
}, $n = ["title"], xn = {
|
|
2211
2245
|
key: 2,
|
|
2212
2246
|
class: "zoom-indicator"
|
|
2213
|
-
},
|
|
2247
|
+
}, Pn = {
|
|
2214
2248
|
key: 2,
|
|
2215
2249
|
class: "opacity-control"
|
|
2216
|
-
},
|
|
2250
|
+
}, Mn = { class: "opacity-label" }, Fn = ["value", "onInput"], zn = {
|
|
2217
2251
|
key: 3,
|
|
2218
2252
|
class: "layer-legend"
|
|
2219
|
-
}, Tn = { class: "legend-label" },
|
|
2253
|
+
}, Tn = { class: "legend-label" }, En = {
|
|
2220
2254
|
key: 0,
|
|
2221
2255
|
class: "empty-state"
|
|
2222
|
-
},
|
|
2256
|
+
}, _n = /* @__PURE__ */ we({
|
|
2223
2257
|
__name: "LayerCheckboxSet",
|
|
2224
2258
|
props: {
|
|
2225
2259
|
layers: {},
|
|
@@ -2232,303 +2266,303 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2232
2266
|
showLegend: { type: Boolean, default: !0 }
|
|
2233
2267
|
},
|
|
2234
2268
|
emits: ["toggleLayer", "setOpacity"],
|
|
2235
|
-
setup(e, { emit:
|
|
2236
|
-
const t = e, o =
|
|
2237
|
-
function
|
|
2238
|
-
return t.visibleLayerIds.has(
|
|
2269
|
+
setup(e, { emit: n }) {
|
|
2270
|
+
const t = e, o = n;
|
|
2271
|
+
function a(y) {
|
|
2272
|
+
return t.visibleLayerIds.has(y);
|
|
2239
2273
|
}
|
|
2240
|
-
function
|
|
2241
|
-
return t.layerOpacities[
|
|
2274
|
+
function l(y) {
|
|
2275
|
+
return t.layerOpacities[y] ?? 1;
|
|
2242
2276
|
}
|
|
2243
|
-
function c(
|
|
2244
|
-
return t.loadingLayerIds.has(
|
|
2277
|
+
function c(y) {
|
|
2278
|
+
return t.loadingLayerIds.has(y);
|
|
2245
2279
|
}
|
|
2246
|
-
function
|
|
2247
|
-
return t.layerErrors[
|
|
2280
|
+
function h(y) {
|
|
2281
|
+
return t.layerErrors[y] || null;
|
|
2248
2282
|
}
|
|
2249
|
-
function
|
|
2250
|
-
const
|
|
2251
|
-
return !(
|
|
2283
|
+
function f(y) {
|
|
2284
|
+
const S = t.currentZoom, g = y.minZoom, b = y.maxZoom;
|
|
2285
|
+
return !(g !== void 0 && S < g || b !== void 0 && S > b);
|
|
2252
2286
|
}
|
|
2253
|
-
function
|
|
2254
|
-
return
|
|
2287
|
+
function M(y) {
|
|
2288
|
+
return y.displayOptions?.shouldShowCheckbox !== !1;
|
|
2255
2289
|
}
|
|
2256
|
-
function
|
|
2257
|
-
return t.showOpacity ?
|
|
2290
|
+
function m(y) {
|
|
2291
|
+
return t.showOpacity ? y.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
2258
2292
|
}
|
|
2259
|
-
function
|
|
2260
|
-
return t.showLegend ?
|
|
2293
|
+
function v(y) {
|
|
2294
|
+
return t.showLegend ? y.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
2261
2295
|
}
|
|
2262
|
-
function s(
|
|
2263
|
-
return
|
|
2296
|
+
function s(y) {
|
|
2297
|
+
return y.displayOptions?.layerNameChange || y.title;
|
|
2264
2298
|
}
|
|
2265
|
-
function
|
|
2266
|
-
o("toggleLayer",
|
|
2299
|
+
function d(y) {
|
|
2300
|
+
o("toggleLayer", y);
|
|
2267
2301
|
}
|
|
2268
|
-
function
|
|
2269
|
-
const
|
|
2270
|
-
o("setOpacity",
|
|
2302
|
+
function $(y, S) {
|
|
2303
|
+
const g = S.target;
|
|
2304
|
+
o("setOpacity", y, parseFloat(g.value));
|
|
2271
2305
|
}
|
|
2272
|
-
return (
|
|
2273
|
-
(
|
|
2274
|
-
key:
|
|
2306
|
+
return (y, S) => (p(), w("div", mn, [
|
|
2307
|
+
(p(!0), w(ie, null, se(e.layers, (g) => (p(), w("div", {
|
|
2308
|
+
key: g.id,
|
|
2275
2309
|
class: "layer-item"
|
|
2276
2310
|
}, [
|
|
2277
|
-
|
|
2311
|
+
M(g) ? (p(), w("label", {
|
|
2278
2312
|
key: 0,
|
|
2279
2313
|
class: ne(["layer-checkbox", {
|
|
2280
|
-
"layer-unavailable": !
|
|
2281
|
-
"layer-error":
|
|
2314
|
+
"layer-unavailable": !f(g),
|
|
2315
|
+
"layer-error": h(g.id)
|
|
2282
2316
|
}])
|
|
2283
2317
|
}, [
|
|
2284
2318
|
P("input", {
|
|
2285
2319
|
type: "checkbox",
|
|
2286
|
-
checked:
|
|
2287
|
-
disabled: !
|
|
2288
|
-
onChange: (b) =>
|
|
2289
|
-
}, null, 40,
|
|
2290
|
-
P("span",
|
|
2291
|
-
me(j(s(
|
|
2292
|
-
c(
|
|
2293
|
-
|
|
2320
|
+
checked: a(g.id),
|
|
2321
|
+
disabled: !f(g),
|
|
2322
|
+
onChange: (b) => d(g.id)
|
|
2323
|
+
}, null, 40, vn),
|
|
2324
|
+
P("span", bn, [
|
|
2325
|
+
me(j(s(g)) + " ", 1),
|
|
2326
|
+
c(g.id) ? (p(), w("span", wn, " Loading... ")) : O("", !0),
|
|
2327
|
+
h(g.id) ? (p(), w("span", {
|
|
2294
2328
|
key: 1,
|
|
2295
2329
|
class: "error-indicator",
|
|
2296
|
-
title:
|
|
2297
|
-
}, " Error ", 8,
|
|
2298
|
-
|
|
2330
|
+
title: h(g.id) || ""
|
|
2331
|
+
}, " Error ", 8, Ln)) : O("", !0),
|
|
2332
|
+
f(g) ? O("", !0) : (p(), w("span", Sn, " (zoom in) "))
|
|
2299
2333
|
])
|
|
2300
|
-
], 2)) : (
|
|
2334
|
+
], 2)) : (p(), w("div", {
|
|
2301
2335
|
key: 1,
|
|
2302
2336
|
class: ne(["layer-label-only", {
|
|
2303
|
-
"layer-unavailable": !
|
|
2304
|
-
"layer-error":
|
|
2337
|
+
"layer-unavailable": !f(g),
|
|
2338
|
+
"layer-error": h(g.id)
|
|
2305
2339
|
}])
|
|
2306
2340
|
}, [
|
|
2307
|
-
P("span",
|
|
2308
|
-
me(j(s(
|
|
2309
|
-
c(
|
|
2310
|
-
|
|
2341
|
+
P("span", Cn, [
|
|
2342
|
+
me(j(s(g)) + " ", 1),
|
|
2343
|
+
c(g.id) ? (p(), w("span", kn, " Loading... ")) : O("", !0),
|
|
2344
|
+
h(g.id) ? (p(), w("span", {
|
|
2311
2345
|
key: 1,
|
|
2312
2346
|
class: "error-indicator",
|
|
2313
|
-
title:
|
|
2314
|
-
}, " Error ", 8,
|
|
2315
|
-
|
|
2347
|
+
title: h(g.id) || ""
|
|
2348
|
+
}, " Error ", 8, $n)) : O("", !0),
|
|
2349
|
+
f(g) ? O("", !0) : (p(), w("span", xn, " (zoom in) "))
|
|
2316
2350
|
])
|
|
2317
2351
|
], 2)),
|
|
2318
|
-
g
|
|
2319
|
-
P("label",
|
|
2352
|
+
m(g) && a(g.id) ? (p(), w("div", Pn, [
|
|
2353
|
+
P("label", Mn, " Opacity: " + j(Math.round(l(g.id) * 100)) + "% ", 1),
|
|
2320
2354
|
P("input", {
|
|
2321
2355
|
type: "range",
|
|
2322
2356
|
min: "0",
|
|
2323
2357
|
max: "1",
|
|
2324
2358
|
step: "0.05",
|
|
2325
|
-
value:
|
|
2359
|
+
value: l(g.id),
|
|
2326
2360
|
class: "opacity-slider",
|
|
2327
|
-
onInput: (b) =>
|
|
2328
|
-
}, null, 40,
|
|
2361
|
+
onInput: (b) => $(g.id, b)
|
|
2362
|
+
}, null, 40, Fn)
|
|
2329
2363
|
])) : O("", !0),
|
|
2330
|
-
|
|
2331
|
-
(
|
|
2364
|
+
v(g) && a(g.id) && g.legend?.length ? (p(), w("ul", zn, [
|
|
2365
|
+
(p(!0), w(ie, null, se(g.legend, (b, E) => (p(), w("li", {
|
|
2332
2366
|
key: E,
|
|
2333
2367
|
class: "legend-item"
|
|
2334
2368
|
}, [
|
|
2335
|
-
b.type === "circle" ? (
|
|
2369
|
+
b.type === "circle" ? (p(), w("span", {
|
|
2336
2370
|
key: 0,
|
|
2337
2371
|
class: "legend-symbol legend-circle",
|
|
2338
|
-
style:
|
|
2339
|
-
}, null, 4)) : b.type === "line" ? (
|
|
2372
|
+
style: ee({ backgroundColor: b.color })
|
|
2373
|
+
}, null, 4)) : b.type === "line" ? (p(), w("span", {
|
|
2340
2374
|
key: 1,
|
|
2341
2375
|
class: "legend-symbol legend-line",
|
|
2342
|
-
style:
|
|
2376
|
+
style: ee({
|
|
2343
2377
|
backgroundColor: b.color,
|
|
2344
2378
|
height: `${b.width || 2}px`
|
|
2345
2379
|
})
|
|
2346
|
-
}, null, 4)) : b.type === "fill" ? (
|
|
2380
|
+
}, null, 4)) : b.type === "fill" ? (p(), w("span", {
|
|
2347
2381
|
key: 2,
|
|
2348
2382
|
class: "legend-symbol legend-fill",
|
|
2349
|
-
style:
|
|
2383
|
+
style: ee({ backgroundColor: b.color })
|
|
2350
2384
|
}, null, 4)) : O("", !0),
|
|
2351
2385
|
P("span", Tn, j(b.label), 1)
|
|
2352
2386
|
]))), 128))
|
|
2353
2387
|
])) : O("", !0)
|
|
2354
2388
|
]))), 128)),
|
|
2355
|
-
e.layers.length === 0 ? (
|
|
2389
|
+
e.layers.length === 0 ? (p(), w("div", En, " No layers available ")) : O("", !0)
|
|
2356
2390
|
]));
|
|
2357
2391
|
}
|
|
2358
|
-
}), Nn = /* @__PURE__ */
|
|
2359
|
-
function
|
|
2360
|
-
const
|
|
2392
|
+
}), Nn = /* @__PURE__ */ Oe(_n, [["__scopeId", "data-v-cc5e50fd"]]);
|
|
2393
|
+
function Un(e) {
|
|
2394
|
+
const n = C([]), t = C(/* @__PURE__ */ new Set()), o = C({}), a = C(/* @__PURE__ */ new Set()), l = C({}), c = C(""), h = C(!1), f = C(!1), M = C(null), m = I(() => {
|
|
2361
2395
|
if (!c.value.trim())
|
|
2362
|
-
return
|
|
2363
|
-
const
|
|
2364
|
-
return
|
|
2365
|
-
(B) => B.title.toLowerCase().includes(
|
|
2396
|
+
return n.value;
|
|
2397
|
+
const T = c.value.toLowerCase();
|
|
2398
|
+
return n.value.filter(
|
|
2399
|
+
(B) => B.title.toLowerCase().includes(T)
|
|
2366
2400
|
);
|
|
2367
|
-
}),
|
|
2368
|
-
config:
|
|
2369
|
-
component:
|
|
2401
|
+
}), v = I(() => n.value.map((T) => ({
|
|
2402
|
+
config: T,
|
|
2403
|
+
component: T.type
|
|
2370
2404
|
// "circle", "fill", or "line"
|
|
2371
2405
|
})));
|
|
2372
2406
|
async function s() {
|
|
2373
|
-
if (!
|
|
2374
|
-
|
|
2407
|
+
if (!f.value) {
|
|
2408
|
+
h.value = !0, M.value = null;
|
|
2375
2409
|
try {
|
|
2376
|
-
let
|
|
2377
|
-
e.mode === "dynamic" || !e.mode ? e.webMapId ?
|
|
2410
|
+
let T;
|
|
2411
|
+
e.mode === "dynamic" || !e.mode ? e.webMapId ? T = await d(e.webMapId) : T = await it() : T = await it(), n.value = T;
|
|
2378
2412
|
const B = {};
|
|
2379
|
-
|
|
2413
|
+
T.forEach((q) => {
|
|
2380
2414
|
B[q.id] = q.opacity ?? 1;
|
|
2381
|
-
}), o.value = B,
|
|
2382
|
-
} catch (
|
|
2383
|
-
|
|
2415
|
+
}), o.value = B, f.value = !0;
|
|
2416
|
+
} catch (T) {
|
|
2417
|
+
M.value = T instanceof Error ? T : new Error("Failed to initialize layerboard");
|
|
2384
2418
|
} finally {
|
|
2385
|
-
|
|
2419
|
+
h.value = !1;
|
|
2386
2420
|
}
|
|
2387
2421
|
}
|
|
2388
2422
|
}
|
|
2389
|
-
async function
|
|
2390
|
-
const B =
|
|
2423
|
+
async function d(T) {
|
|
2424
|
+
const B = lt(T), q = await fetch(B);
|
|
2391
2425
|
if (!q.ok)
|
|
2392
2426
|
throw new Error(`Failed to fetch WebMap: ${q.status} ${q.statusText}`);
|
|
2393
2427
|
const ce = await q.json();
|
|
2394
2428
|
return kt(ce);
|
|
2395
2429
|
}
|
|
2396
|
-
function T
|
|
2430
|
+
function $(T) {
|
|
2397
2431
|
const B = new Set(t.value);
|
|
2398
|
-
B.has(
|
|
2432
|
+
B.has(T) ? B.delete(T) : B.add(T), t.value = B;
|
|
2399
2433
|
}
|
|
2400
|
-
function
|
|
2434
|
+
function y(T, B) {
|
|
2401
2435
|
o.value = {
|
|
2402
2436
|
...o.value,
|
|
2403
|
-
[
|
|
2437
|
+
[T]: Math.max(0, Math.min(1, B))
|
|
2404
2438
|
};
|
|
2405
2439
|
}
|
|
2406
|
-
function
|
|
2407
|
-
c.value =
|
|
2440
|
+
function S(T) {
|
|
2441
|
+
c.value = T;
|
|
2408
2442
|
}
|
|
2409
|
-
function
|
|
2410
|
-
const q = new Set(
|
|
2411
|
-
B ? q.add(
|
|
2443
|
+
function g(T, B) {
|
|
2444
|
+
const q = new Set(a.value);
|
|
2445
|
+
B ? q.add(T) : q.delete(T), a.value = q;
|
|
2412
2446
|
}
|
|
2413
|
-
function b(
|
|
2447
|
+
function b(T, B) {
|
|
2414
2448
|
if (B)
|
|
2415
|
-
|
|
2449
|
+
l.value = { ...l.value, [T]: B };
|
|
2416
2450
|
else {
|
|
2417
|
-
const { [
|
|
2418
|
-
|
|
2451
|
+
const { [T]: q, ...ce } = l.value;
|
|
2452
|
+
l.value = ce;
|
|
2419
2453
|
}
|
|
2420
2454
|
}
|
|
2421
2455
|
function E() {
|
|
2422
|
-
|
|
2456
|
+
n.value = [], t.value = /* @__PURE__ */ new Set(), o.value = {}, a.value = /* @__PURE__ */ new Set(), l.value = {}, c.value = "", h.value = !1, f.value = !1, M.value = null;
|
|
2423
2457
|
}
|
|
2424
2458
|
return {
|
|
2425
2459
|
// State (readonly)
|
|
2426
|
-
layerConfigs: W(
|
|
2460
|
+
layerConfigs: W(n),
|
|
2427
2461
|
visibleLayers: W(t),
|
|
2428
2462
|
layerOpacities: W(o),
|
|
2429
|
-
loadingLayers: W(
|
|
2430
|
-
layerErrors: W(
|
|
2463
|
+
loadingLayers: W(a),
|
|
2464
|
+
layerErrors: W(l),
|
|
2431
2465
|
searchQuery: W(c),
|
|
2432
|
-
isLoading: W(
|
|
2433
|
-
isInitialized: W(
|
|
2434
|
-
error: W(
|
|
2466
|
+
isLoading: W(h),
|
|
2467
|
+
isInitialized: W(f),
|
|
2468
|
+
error: W(M),
|
|
2435
2469
|
// Computed
|
|
2436
|
-
filteredLayerConfigs:
|
|
2437
|
-
layerList:
|
|
2470
|
+
filteredLayerConfigs: m,
|
|
2471
|
+
layerList: v,
|
|
2438
2472
|
// Config
|
|
2439
2473
|
config: e,
|
|
2440
2474
|
// Methods
|
|
2441
2475
|
initialize: s,
|
|
2442
|
-
toggleLayer:
|
|
2443
|
-
setLayerOpacity:
|
|
2444
|
-
filterLayers:
|
|
2445
|
-
setLayerLoading:
|
|
2476
|
+
toggleLayer: $,
|
|
2477
|
+
setLayerOpacity: y,
|
|
2478
|
+
filterLayers: S,
|
|
2479
|
+
setLayerLoading: g,
|
|
2446
2480
|
setLayerError: b,
|
|
2447
2481
|
reset: E
|
|
2448
2482
|
};
|
|
2449
2483
|
}
|
|
2450
|
-
function
|
|
2451
|
-
const e =
|
|
2452
|
-
function o(
|
|
2453
|
-
|
|
2484
|
+
function Wn() {
|
|
2485
|
+
const e = C([]), n = C(/* @__PURE__ */ new Set()), t = C(/* @__PURE__ */ new Set());
|
|
2486
|
+
function o(l) {
|
|
2487
|
+
n.value.has(l) ? n.value.delete(l) : n.value.add(l);
|
|
2454
2488
|
}
|
|
2455
|
-
function l
|
|
2456
|
-
e.value =
|
|
2489
|
+
function a(l) {
|
|
2490
|
+
e.value = l;
|
|
2457
2491
|
}
|
|
2458
2492
|
return {
|
|
2459
|
-
layers:
|
|
2460
|
-
visibleLayerIds:
|
|
2461
|
-
loadingLayerIds:
|
|
2493
|
+
layers: I(() => e.value),
|
|
2494
|
+
visibleLayerIds: I(() => n.value),
|
|
2495
|
+
loadingLayerIds: I(() => t.value),
|
|
2462
2496
|
toggleLayer: o,
|
|
2463
|
-
setLayers:
|
|
2497
|
+
setLayers: a
|
|
2464
2498
|
};
|
|
2465
2499
|
}
|
|
2466
|
-
function
|
|
2467
|
-
const
|
|
2468
|
-
async function
|
|
2500
|
+
function On(e) {
|
|
2501
|
+
const n = C(null), t = C(!1), o = C(null), a = C(0);
|
|
2502
|
+
async function l(f = {}) {
|
|
2469
2503
|
t.value = !0, o.value = null;
|
|
2470
|
-
const
|
|
2471
|
-
let
|
|
2504
|
+
const M = e.pageSize || 2e3;
|
|
2505
|
+
let m = 0, v = [], s = !0;
|
|
2472
2506
|
try {
|
|
2473
2507
|
for (; s; ) {
|
|
2474
|
-
const
|
|
2475
|
-
let
|
|
2476
|
-
if (
|
|
2508
|
+
const $ = e.url.replace(/\/$/, ""), y = encodeURIComponent(f.where || e.where || "1=1");
|
|
2509
|
+
let S = `${$}/query?where=${y}&outFields=*&returnGeometry=true&resultRecordCount=${M}&resultOffset=${m}&f=geojson`;
|
|
2510
|
+
if (f.bounds) {
|
|
2477
2511
|
const E = JSON.stringify({
|
|
2478
|
-
xmin:
|
|
2479
|
-
ymin:
|
|
2480
|
-
xmax:
|
|
2481
|
-
ymax:
|
|
2512
|
+
xmin: f.bounds.west,
|
|
2513
|
+
ymin: f.bounds.south,
|
|
2514
|
+
xmax: f.bounds.east,
|
|
2515
|
+
ymax: f.bounds.north,
|
|
2482
2516
|
spatialReference: { wkid: 4326 }
|
|
2483
2517
|
});
|
|
2484
|
-
|
|
2518
|
+
S += `&geometry=${encodeURIComponent(E)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
|
|
2485
2519
|
}
|
|
2486
|
-
const
|
|
2487
|
-
if (!
|
|
2488
|
-
throw new Error(`HTTP ${
|
|
2489
|
-
const b = await
|
|
2490
|
-
b.features && b.features.length > 0 ? (
|
|
2520
|
+
const g = await fetch(S);
|
|
2521
|
+
if (!g.ok)
|
|
2522
|
+
throw new Error(`HTTP ${g.status}: ${g.statusText}`);
|
|
2523
|
+
const b = await g.json();
|
|
2524
|
+
b.features && b.features.length > 0 ? (v = v.concat(b.features), m += b.features.length, s = b.features.length === M) : s = !1;
|
|
2491
2525
|
}
|
|
2492
|
-
const
|
|
2526
|
+
const d = {
|
|
2493
2527
|
type: "FeatureCollection",
|
|
2494
|
-
features:
|
|
2528
|
+
features: v
|
|
2495
2529
|
};
|
|
2496
|
-
return
|
|
2497
|
-
} catch (
|
|
2498
|
-
const
|
|
2499
|
-
throw o.value =
|
|
2530
|
+
return n.value = d, a.value = v.length, d;
|
|
2531
|
+
} catch (d) {
|
|
2532
|
+
const $ = d instanceof Error ? d : new Error("Failed to fetch features");
|
|
2533
|
+
throw o.value = $, $;
|
|
2500
2534
|
} finally {
|
|
2501
2535
|
t.value = !1;
|
|
2502
2536
|
}
|
|
2503
2537
|
}
|
|
2504
2538
|
function c() {
|
|
2505
|
-
|
|
2539
|
+
n.value = null, a.value = 0, o.value = null;
|
|
2506
2540
|
}
|
|
2507
|
-
async function f
|
|
2508
|
-
return
|
|
2541
|
+
async function h(f = {}) {
|
|
2542
|
+
return l(f);
|
|
2509
2543
|
}
|
|
2510
2544
|
return {
|
|
2511
2545
|
// State (readonly)
|
|
2512
|
-
data: W(
|
|
2546
|
+
data: W(n),
|
|
2513
2547
|
isLoading: W(t),
|
|
2514
2548
|
error: W(o),
|
|
2515
|
-
totalFeatures: W(
|
|
2549
|
+
totalFeatures: W(a),
|
|
2516
2550
|
// Config
|
|
2517
2551
|
config: e,
|
|
2518
2552
|
// Methods
|
|
2519
|
-
fetch:
|
|
2520
|
-
refetch:
|
|
2553
|
+
fetch: l,
|
|
2554
|
+
refetch: h,
|
|
2521
2555
|
clear: c
|
|
2522
2556
|
};
|
|
2523
2557
|
}
|
|
2524
|
-
function
|
|
2525
|
-
const o =
|
|
2558
|
+
function jn(e, n, t) {
|
|
2559
|
+
const o = On(e);
|
|
2526
2560
|
return Pe(
|
|
2527
|
-
|
|
2528
|
-
async (
|
|
2529
|
-
if (
|
|
2530
|
-
const
|
|
2531
|
-
await o.fetch(
|
|
2561
|
+
n,
|
|
2562
|
+
async (a) => {
|
|
2563
|
+
if (a) {
|
|
2564
|
+
const l = t(a);
|
|
2565
|
+
await o.fetch(l);
|
|
2532
2566
|
}
|
|
2533
2567
|
},
|
|
2534
2568
|
{ immediate: !0 }
|
|
@@ -2536,19 +2570,19 @@ function Wn(e, i, t) {
|
|
|
2536
2570
|
}
|
|
2537
2571
|
export {
|
|
2538
2572
|
Nn as LayerCheckboxSet,
|
|
2539
|
-
|
|
2540
|
-
|
|
2573
|
+
Do as LayerPanel,
|
|
2574
|
+
Vn as Layerboard,
|
|
2541
2575
|
Xt as MapPanel,
|
|
2542
2576
|
An as TopicAccordion,
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2577
|
+
Zn as WEBMAP_ID,
|
|
2578
|
+
lt as buildWebMapUrl,
|
|
2579
|
+
Qo as clearCache,
|
|
2546
2580
|
it as getLayerConfigs,
|
|
2547
|
-
|
|
2581
|
+
Bn as getWebMapUrl,
|
|
2548
2582
|
kt as transformWebMapToLayerConfigs,
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2583
|
+
en as useApiDataSources,
|
|
2584
|
+
On as useDataSource,
|
|
2585
|
+
Wn as useLayerConfig,
|
|
2586
|
+
Un as useLayerboard,
|
|
2587
|
+
jn as useReactiveDataSource
|
|
2554
2588
|
};
|