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