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