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