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