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