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