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