@phila/layerboard 3.0.0-beta.6 → 3.0.0-beta.7
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 +1172 -1038
- package/dist/layerboard.css +1 -1
- package/package.json +5 -9
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ve, ref as $, watch as Pe, computed as I, onMounted as Ne, onUnmounted as Lt, createElementBlock as m, openBlock as u, createVNode as X, unref as O, withCtx as Ee, createBlock as ee, createCommentVNode as T, Fragment as oe, renderList as ae, useAttrs as Mt, toRef as zt, normalizeClass as ne, createElementVNode as k, toDisplayString as W, renderSlot as le, withDirectives as St, mergeProps as tt, vModelDynamic as Ft, createTextVNode as fe, normalizeProps as dt, guardReactiveProps as ft, withModifiers as Tt, normalizeStyle as H, readonly as j, provide as U, resolveComponent as Et, vShow as Ot } from "vue";
|
|
2
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 ue, BaseLink as
|
|
4
|
-
function
|
|
3
|
+
import { cn as ot, Icon as ue, BaseLink as Nt, ActionContent as gt } from "@phila/phila-ui-core";
|
|
4
|
+
function Ve(e, n, t = {}) {
|
|
5
5
|
const o = { type: "Feature" };
|
|
6
6
|
return (t.id === 0 || t.id) && (o.id = t.id), t.bbox && (o.bbox = t.bbox), o.properties = n || {}, o.geometry = e, o;
|
|
7
7
|
}
|
|
@@ -17,27 +17,27 @@ function At(e, n, t = {}) {
|
|
|
17
17
|
if (a[a.length - 1][l] !== a[0][l])
|
|
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
|
}, n, t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Vt(e, n, 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
|
}, n, t);
|
|
32
32
|
}
|
|
33
33
|
function Ut(e, n, t = {}) {
|
|
34
|
-
return
|
|
34
|
+
return Ve({
|
|
35
35
|
type: "MultiLineString",
|
|
36
36
|
coordinates: e
|
|
37
37
|
}, n, t);
|
|
38
38
|
}
|
|
39
39
|
function Wt(e, n, t = {}) {
|
|
40
|
-
return
|
|
40
|
+
return Ve({
|
|
41
41
|
type: "MultiPolygon",
|
|
42
42
|
coordinates: e
|
|
43
43
|
}, n, t);
|
|
@@ -46,27 +46,27 @@ function jt(e) {
|
|
|
46
46
|
return e.type === "Feature" ? e.geometry : e;
|
|
47
47
|
}
|
|
48
48
|
function qt(e, n, t) {
|
|
49
|
-
var o = e.length, a =
|
|
50
|
-
let
|
|
49
|
+
var o = e.length, a = _e(e[0], n), l = [], c, v, y;
|
|
50
|
+
let P, w;
|
|
51
51
|
for (t || (t = []), c = 1; c < o; c++) {
|
|
52
|
-
for (
|
|
53
|
-
if (a |
|
|
54
|
-
if (a &
|
|
52
|
+
for (P = e[c - 1], w = e[c], v = y = _e(w, n); ; )
|
|
53
|
+
if (a | v) {
|
|
54
|
+
if (a & v)
|
|
55
55
|
break;
|
|
56
|
-
a ? (
|
|
56
|
+
a ? (P = nt(P, w, a, n), a = _e(P, n)) : (w = nt(P, w, v, n), v = _e(w, n));
|
|
57
57
|
} else {
|
|
58
|
-
l.push(
|
|
58
|
+
l.push(P), v !== y ? (l.push(w), c < o - 1 && (t.push(l), l = [])) : c === o - 1 && l.push(w);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
|
-
a =
|
|
61
|
+
a = y;
|
|
62
62
|
}
|
|
63
63
|
return l.length && t.push(l), t;
|
|
64
64
|
}
|
|
65
65
|
function Gt(e, n) {
|
|
66
|
-
var t, o, a, l, c,
|
|
66
|
+
var t, o, a, l, c, v, y;
|
|
67
67
|
for (o = 1; o <= 8; o *= 2) {
|
|
68
|
-
for (t = [], a = e[e.length - 1], l = !(
|
|
69
|
-
|
|
68
|
+
for (t = [], a = e[e.length - 1], l = !(_e(a, n) & o), c = 0; c < e.length; c++)
|
|
69
|
+
v = e[c], y = !(_e(v, n) & o), y !== l && t.push(nt(a, v, o, n)), y && t.push(v), a = v, l = y;
|
|
70
70
|
if (e = t, !e.length) break;
|
|
71
71
|
}
|
|
72
72
|
return t;
|
|
@@ -74,7 +74,7 @@ function Gt(e, n) {
|
|
|
74
74
|
function nt(e, n, t, o) {
|
|
75
75
|
return t & 8 ? [e[0] + (n[0] - e[0]) * (o[3] - e[1]) / (n[1] - e[1]), o[3]] : t & 4 ? [e[0] + (n[0] - e[0]) * (o[1] - e[1]) / (n[1] - e[1]), o[1]] : t & 2 ? [o[2], e[1] + (n[1] - e[1]) * (o[2] - e[0]) / (n[0] - e[0])] : t & 1 ? [o[0], e[1] + (n[1] - e[1]) * (o[0] - e[0]) / (n[0] - e[0])] : null;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function _e(e, n) {
|
|
78
78
|
var t = 0;
|
|
79
79
|
return e[0] < n[0] ? t |= 1 : e[0] > n[2] && (t |= 2), e[1] < n[1] ? t |= 4 : e[1] > n[3] && (t |= 8), t;
|
|
80
80
|
}
|
|
@@ -85,9 +85,9 @@ function Ht(e, n) {
|
|
|
85
85
|
case "LineString":
|
|
86
86
|
case "MultiLineString": {
|
|
87
87
|
const c = [];
|
|
88
|
-
return o === "LineString" && (l = [l]), l.forEach((
|
|
89
|
-
qt(
|
|
90
|
-
}), c.length === 1 ?
|
|
88
|
+
return o === "LineString" && (l = [l]), l.forEach((v) => {
|
|
89
|
+
qt(v, n, c);
|
|
90
|
+
}), c.length === 1 ? Vt(c[0], a) : Ut(c, a);
|
|
91
91
|
}
|
|
92
92
|
case "Polygon":
|
|
93
93
|
return At(ht(l, n), a);
|
|
@@ -109,7 +109,7 @@ function ht(e, n) {
|
|
|
109
109
|
return t;
|
|
110
110
|
}
|
|
111
111
|
var Jt = Ht;
|
|
112
|
-
const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */
|
|
112
|
+
const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ ve({
|
|
113
113
|
__name: "MapPanel",
|
|
114
114
|
props: {
|
|
115
115
|
visibleLayers: {},
|
|
@@ -132,34 +132,34 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
132
132
|
},
|
|
133
133
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
134
134
|
setup(e, { emit: n }) {
|
|
135
|
-
const t = e, o = n, a =
|
|
136
|
-
function
|
|
137
|
-
o("zoom", i), l.value && (c.value =
|
|
138
|
-
}
|
|
139
|
-
function
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
const
|
|
144
|
-
async function
|
|
145
|
-
const
|
|
146
|
-
xmin:
|
|
147
|
-
ymin:
|
|
148
|
-
xmax:
|
|
149
|
-
ymax:
|
|
135
|
+
const t = e, o = n, a = $(null), l = $(null), c = $(0);
|
|
136
|
+
function v(i) {
|
|
137
|
+
o("zoom", i), l.value && (c.value = y(l.value));
|
|
138
|
+
}
|
|
139
|
+
function y(i) {
|
|
140
|
+
const f = i.getZoom(), _ = i.getCenter().lat, x = 559082264028e-3, z = _ * Math.PI / 180;
|
|
141
|
+
return x * Math.cos(z) / Math.pow(2, f);
|
|
142
|
+
}
|
|
143
|
+
const P = $({}), w = $(null), L = $(/* @__PURE__ */ new Set()), r = ["fema-100-year-floodplain", "fema-500-year-floodplain"];
|
|
144
|
+
async function h(i, f, s, _) {
|
|
145
|
+
const x = encodeURIComponent(_ || "1=1"), z = JSON.stringify({
|
|
146
|
+
xmin: f.west,
|
|
147
|
+
ymin: f.south,
|
|
148
|
+
xmax: f.east,
|
|
149
|
+
ymax: f.north,
|
|
150
150
|
spatialReference: { wkid: 4326 }
|
|
151
151
|
}), R = 2e3;
|
|
152
|
-
let
|
|
153
|
-
for (;
|
|
154
|
-
const G = `${i}/query?where=${
|
|
152
|
+
let N = 0, V = [], Y = !0;
|
|
153
|
+
for (; Y; ) {
|
|
154
|
+
const G = `${i}/query?where=${x}&geometry=${encodeURIComponent(z)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${R}&resultOffset=${N}&f=geojson`, Z = await fetch(G);
|
|
155
155
|
if (!Z.ok)
|
|
156
156
|
throw new Error(`HTTP ${Z.status}: ${Z.statusText}`);
|
|
157
|
-
const
|
|
158
|
-
|
|
157
|
+
const J = await Z.json();
|
|
158
|
+
J.features && J.features.length > 0 ? (V = V.concat(J.features), N += J.features.length, Y = J.features.length === R) : Y = !1;
|
|
159
159
|
}
|
|
160
|
-
if (
|
|
161
|
-
const G = [
|
|
162
|
-
|
|
160
|
+
if (r.includes(s)) {
|
|
161
|
+
const G = [f.west, f.south, f.east, f.north];
|
|
162
|
+
V = V.map((Z) => {
|
|
163
163
|
if (Z.geometry && (Z.geometry.type === "Polygon" || Z.geometry.type === "MultiPolygon"))
|
|
164
164
|
try {
|
|
165
165
|
return Jt(Z, G);
|
|
@@ -171,71 +171,71 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
171
171
|
}
|
|
172
172
|
return {
|
|
173
173
|
type: "FeatureCollection",
|
|
174
|
-
features:
|
|
174
|
+
features: V
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
async function
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
o("layerLoading",
|
|
177
|
+
async function b(i, f) {
|
|
178
|
+
const s = f.map(async (_) => {
|
|
179
|
+
const x = t.layerList.find((z) => z.config.id === _)?.config;
|
|
180
|
+
if (x) {
|
|
181
|
+
o("layerLoading", _, !0);
|
|
182
182
|
try {
|
|
183
|
-
const z = await
|
|
184
|
-
|
|
183
|
+
const z = await h(x.url, i, _, x.where);
|
|
184
|
+
P.value = { ...P.value, [_]: z }, o("layerError", _, null);
|
|
185
185
|
} catch (z) {
|
|
186
186
|
const R = z instanceof Error ? z.message : "Failed to load";
|
|
187
|
-
o("layerError",
|
|
187
|
+
o("layerError", _, R);
|
|
188
188
|
} finally {
|
|
189
|
-
o("layerLoading",
|
|
189
|
+
o("layerLoading", _, !1);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
await Promise.all(
|
|
193
|
+
await Promise.all(s);
|
|
194
194
|
}
|
|
195
|
-
async function
|
|
196
|
-
const
|
|
197
|
-
await
|
|
195
|
+
async function g(i) {
|
|
196
|
+
const f = [...t.visibleLayers];
|
|
197
|
+
await b(i, f);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
199
|
+
function p(i) {
|
|
200
|
+
w.value = i.bounds, g(i.bounds);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function d(i) {
|
|
203
203
|
l.value = i;
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
west:
|
|
207
|
-
south:
|
|
208
|
-
east:
|
|
209
|
-
north:
|
|
204
|
+
const f = i.getBounds();
|
|
205
|
+
w.value = {
|
|
206
|
+
west: f.getWest(),
|
|
207
|
+
south: f.getSouth(),
|
|
208
|
+
east: f.getEast(),
|
|
209
|
+
north: f.getNorth()
|
|
210
210
|
};
|
|
211
|
-
const
|
|
212
|
-
o("zoom",
|
|
211
|
+
const s = i.getZoom();
|
|
212
|
+
o("zoom", s), c.value = y(i), g(w.value);
|
|
213
213
|
}
|
|
214
214
|
Pe(
|
|
215
215
|
() => t.visibleLayers.size,
|
|
216
216
|
async () => {
|
|
217
|
-
if (
|
|
218
|
-
const i = new Set(t.visibleLayers),
|
|
219
|
-
(
|
|
217
|
+
if (ie.value.length > 0 && te(), w.value) {
|
|
218
|
+
const i = new Set(t.visibleLayers), f = [...i].filter(
|
|
219
|
+
(s) => !L.value.has(s)
|
|
220
220
|
);
|
|
221
|
-
|
|
221
|
+
L.value = new Set(i), f.length > 0 && await b(w.value, f);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
|
-
function
|
|
225
|
+
function S(i) {
|
|
226
226
|
return t.visibleLayers.has(i);
|
|
227
227
|
}
|
|
228
228
|
function E(i) {
|
|
229
|
-
return !!
|
|
229
|
+
return !!P.value[i.id];
|
|
230
230
|
}
|
|
231
|
-
const
|
|
232
|
-
() => t.layerList.filter((i) => i.config.type === "circle" &&
|
|
231
|
+
const F = I(
|
|
232
|
+
() => t.layerList.filter((i) => i.config.type === "circle" && S(i.config.id) && E(i.config)).map((i) => i.config)
|
|
233
233
|
), B = I(
|
|
234
|
-
() => t.layerList.filter((i) => i.config.type === "fill" &&
|
|
234
|
+
() => t.layerList.filter((i) => i.config.type === "fill" && S(i.config.id) && E(i.config)).map((i) => i.config)
|
|
235
235
|
), q = I(
|
|
236
|
-
() => t.layerList.filter((i) => i.config.type === "fill" && i.config.outlinePaint &&
|
|
236
|
+
() => t.layerList.filter((i) => i.config.type === "fill" && i.config.outlinePaint && S(i.config.id) && E(i.config)).map((i) => i.config)
|
|
237
237
|
), ce = I(
|
|
238
|
-
() => t.layerList.filter((i) => i.config.type === "line" &&
|
|
238
|
+
() => t.layerList.filter((i) => i.config.type === "line" && S(i.config.id) && E(i.config)).map((i) => i.config)
|
|
239
239
|
);
|
|
240
240
|
function Le(i) {
|
|
241
241
|
return t.visibleTiledLayers?.has(i) ?? !1;
|
|
@@ -254,28 +254,28 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
254
254
|
attribution: i.attribution || ""
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Fe = $({}), Ie = $(/* @__PURE__ */ new Set());
|
|
258
258
|
async function Te(i) {
|
|
259
259
|
if (!Ie.value.has(i.id)) {
|
|
260
260
|
Ie.value.add(i.id);
|
|
261
261
|
try {
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
262
|
+
const f = i.url.replace(/\/$/, ""), s = await fetch(`${f}?f=json`);
|
|
263
|
+
if (!s.ok)
|
|
264
264
|
return;
|
|
265
|
-
const
|
|
266
|
-
let
|
|
267
|
-
if (
|
|
268
|
-
for (const R of
|
|
265
|
+
const _ = await s.json();
|
|
266
|
+
let x = _.minScale || 0, z = _.maxScale || 0;
|
|
267
|
+
if (_.layers && _.layers.length > 0)
|
|
268
|
+
for (const R of _.layers)
|
|
269
269
|
R.maxScale && R.maxScale > 0 && (z === 0 || R.maxScale < z) && (z = R.maxScale);
|
|
270
|
-
z === 0 && (z = 72e3),
|
|
271
|
-
...
|
|
272
|
-
[i.id]: { minScale:
|
|
270
|
+
z === 0 && (z = 72e3), Fe.value = {
|
|
271
|
+
...Fe.value,
|
|
272
|
+
[i.id]: { minScale: x, maxScale: z }
|
|
273
273
|
};
|
|
274
274
|
} catch {
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
|
|
278
|
+
Ne(() => {
|
|
279
279
|
if (t.tiledLayers)
|
|
280
280
|
for (const i of t.tiledLayers)
|
|
281
281
|
i.scaleBasedRendering && Te(i);
|
|
@@ -283,11 +283,11 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
283
283
|
function Re(i) {
|
|
284
284
|
if (!i.scaleBasedRendering)
|
|
285
285
|
return "tiled";
|
|
286
|
-
const
|
|
287
|
-
if (!
|
|
286
|
+
const f = Fe.value[i.id];
|
|
287
|
+
if (!f)
|
|
288
288
|
return "tiled";
|
|
289
|
-
const
|
|
290
|
-
return
|
|
289
|
+
const s = c.value;
|
|
290
|
+
return s === 0 || s > f.maxScale ? "tiled" : "dynamic";
|
|
291
291
|
}
|
|
292
292
|
const qe = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => Le(i.id) ? i.scaleBasedRendering ? Re(i) === "tiled" : !0 : !1) : []), Ge = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => Le(i.id) && i.scaleBasedRendering ? Re(i) === "dynamic" : !1) : []);
|
|
293
293
|
function Ce(i) {
|
|
@@ -298,147 +298,147 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
298
298
|
attribution: i.attribution || ""
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
return { type: "geojson", data:
|
|
301
|
+
function pe(i) {
|
|
302
|
+
return { type: "geojson", data: P.value[i.id] };
|
|
303
303
|
}
|
|
304
304
|
function ke(i) {
|
|
305
305
|
return t.layerOpacities[i] ?? 1;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const
|
|
307
|
+
function ye(i) {
|
|
308
|
+
const f = ke(i.id), s = i.type === "circle" ? "circle-opacity" : i.type === "fill" ? "fill-opacity" : "line-opacity";
|
|
309
309
|
if (i.type === "fill" && i.paint["fill-opacity"] === 0)
|
|
310
310
|
return { ...i.paint, "fill-opacity": 0 };
|
|
311
|
-
const
|
|
312
|
-
if (R &&
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
311
|
+
const _ = i.type === "circle" ? "circle-color" : i.type === "fill" ? "fill-color" : "line-color", x = { ...i.paint }, z = x[_], R = x[s] === 1, N = typeof z == "string" && z.startsWith("rgba(");
|
|
312
|
+
if (R && N) {
|
|
313
|
+
if (f === 1)
|
|
314
|
+
return x;
|
|
315
315
|
{
|
|
316
|
-
const
|
|
317
|
-
if (
|
|
318
|
-
const [,
|
|
319
|
-
|
|
316
|
+
const V = z.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
317
|
+
if (V && V[4]) {
|
|
318
|
+
const [, Y, G, Z, J] = V, Xe = parseFloat(J) * f;
|
|
319
|
+
x[_] = `rgba(${Y}, ${G}, ${Z}, ${Xe})`, x[s] = 1;
|
|
320
320
|
}
|
|
321
|
-
return
|
|
321
|
+
return x;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
const [,
|
|
328
|
-
|
|
324
|
+
if (N) {
|
|
325
|
+
const V = z.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
326
|
+
if (V) {
|
|
327
|
+
const [, Y, G, Z] = V;
|
|
328
|
+
x[_] = `rgb(${Y}, ${G}, ${Z})`;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
return
|
|
331
|
+
return x[s] = f, x;
|
|
332
332
|
}
|
|
333
333
|
function He(i) {
|
|
334
|
-
const
|
|
335
|
-
return { ...i.outlinePaint, "line-opacity":
|
|
334
|
+
const f = ke(i.id);
|
|
335
|
+
return { ...i.outlinePaint, "line-opacity": f };
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const ie = $([]), ge = $(null), Q = $(0);
|
|
338
338
|
function $e(i) {
|
|
339
|
-
const
|
|
340
|
-
return t.layerList.find((
|
|
339
|
+
const f = i.replace(/-outline$/, "");
|
|
340
|
+
return t.layerList.find((_) => _.config.id === f)?.config;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
return i.replace(/\{([^}]+)\}/g, (
|
|
344
|
-
const
|
|
345
|
-
return
|
|
342
|
+
function be(i, f) {
|
|
343
|
+
return i.replace(/\{([^}]+)\}/g, (s, _) => {
|
|
344
|
+
const x = f[_];
|
|
345
|
+
return x == null ? "" : String(x);
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
function Je(i,
|
|
348
|
+
function Je(i, f) {
|
|
349
349
|
if (i == null) return "-";
|
|
350
|
-
if (
|
|
351
|
-
const
|
|
352
|
-
switch (
|
|
350
|
+
if (f?.dateFormat && typeof i == "number") {
|
|
351
|
+
const s = new Date(i);
|
|
352
|
+
switch (f.dateFormat) {
|
|
353
353
|
case "shortDateShortTime":
|
|
354
|
-
return
|
|
354
|
+
return s.toLocaleString();
|
|
355
355
|
case "longMonthDayYear":
|
|
356
|
-
return
|
|
356
|
+
return s.toLocaleDateString(void 0, { month: "long", day: "numeric", year: "numeric" });
|
|
357
357
|
case "shortDate":
|
|
358
|
-
return
|
|
358
|
+
return s.toLocaleDateString();
|
|
359
359
|
case "longDate":
|
|
360
|
-
return
|
|
360
|
+
return s.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric", year: "numeric" });
|
|
361
361
|
default:
|
|
362
|
-
return
|
|
362
|
+
return s.toLocaleDateString();
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
if (typeof i == "number") {
|
|
366
|
-
if (i > 1e12 && !
|
|
366
|
+
if (i > 1e12 && !f)
|
|
367
367
|
return new Date(i).toLocaleDateString();
|
|
368
|
-
const
|
|
369
|
-
if (
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
const z =
|
|
373
|
-
return
|
|
368
|
+
const s = f?.places, _ = f?.digitSeparator ?? !0;
|
|
369
|
+
if (s !== void 0) {
|
|
370
|
+
const x = i.toFixed(s);
|
|
371
|
+
if (_) {
|
|
372
|
+
const z = x.split("."), R = z[0] || "0", N = z[1], V = R.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
373
|
+
return N ? `${V}.${N}` : V;
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return x;
|
|
376
376
|
}
|
|
377
|
-
return
|
|
377
|
+
return _ ? i.toLocaleString() : String(i);
|
|
378
378
|
}
|
|
379
379
|
return String(i);
|
|
380
380
|
}
|
|
381
381
|
function De(i) {
|
|
382
|
-
const
|
|
383
|
-
return i.filter((
|
|
384
|
-
const
|
|
385
|
-
return
|
|
382
|
+
const f = /* @__PURE__ */ new Set();
|
|
383
|
+
return i.filter((s) => {
|
|
384
|
+
const x = `${s.layer.id.replace(/-outline$/, "")}:${JSON.stringify(s.properties)}`;
|
|
385
|
+
return f.has(x) ? !1 : (f.add(x), !0);
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const
|
|
390
|
-
return
|
|
391
|
-
|
|
392
|
-
}), i.sort((
|
|
393
|
-
const z =
|
|
394
|
-
return (
|
|
388
|
+
function he(i, f) {
|
|
389
|
+
const s = /* @__PURE__ */ new Map();
|
|
390
|
+
return f.forEach((_, x) => {
|
|
391
|
+
s.set(_.id, x);
|
|
392
|
+
}), i.sort((_, x) => {
|
|
393
|
+
const z = _.layer.id.replace(/-outline$/, ""), R = x.layer.id.replace(/-outline$/, ""), N = s.get(z) ?? -1;
|
|
394
|
+
return (s.get(R) ?? -1) - N;
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
function xe(i) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
400
|
-
const
|
|
398
|
+
const f = l.value;
|
|
399
|
+
if (!f) return;
|
|
400
|
+
const s = [];
|
|
401
401
|
t.layerList.forEach((G) => {
|
|
402
402
|
const Z = G.config;
|
|
403
|
-
t.visibleLayers.has(Z.id) && (
|
|
403
|
+
t.visibleLayers.has(Z.id) && (s.push(Z.id), Z.outlinePaint && s.push(`${Z.id}-outline`));
|
|
404
404
|
});
|
|
405
|
-
const
|
|
406
|
-
layers:
|
|
405
|
+
const _ = f.project([i.lngLat.lng, i.lngLat.lat]), x = f.queryRenderedFeatures(_, {
|
|
406
|
+
layers: s
|
|
407
407
|
});
|
|
408
|
-
if (
|
|
409
|
-
const z = De(
|
|
410
|
-
const Z = G.layer.id.replace(/-outline$/, ""),
|
|
411
|
-
return
|
|
412
|
-
layerId:
|
|
413
|
-
layerTitle:
|
|
408
|
+
if (x.length === 0) return;
|
|
409
|
+
const z = De(x), R = t.layerList.map((G) => G.config), N = he(z, R), V = N.map((G) => {
|
|
410
|
+
const Z = G.layer.id.replace(/-outline$/, ""), J = $e(Z);
|
|
411
|
+
return J ? {
|
|
412
|
+
layerId: J.id,
|
|
413
|
+
layerTitle: J.title,
|
|
414
414
|
properties: G.properties || {},
|
|
415
|
-
popupConfig:
|
|
415
|
+
popupConfig: J.popup
|
|
416
416
|
} : null;
|
|
417
417
|
}).filter((G) => G !== null);
|
|
418
|
-
if (
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
422
|
-
const G =
|
|
418
|
+
if (V.length === 0) return;
|
|
419
|
+
ie.value = V, Q.value = 0, ge.value = [i.lngLat.lng, i.lngLat.lat];
|
|
420
|
+
const Y = N[0];
|
|
421
|
+
if (Y && Y.geometry) {
|
|
422
|
+
const G = Y.layer.id.replace(/-outline$/, ""), Z = $e(G);
|
|
423
423
|
if (Z) {
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
geometry:
|
|
427
|
-
geometryType:
|
|
424
|
+
const J = rt(Y.geometry), Xe = st(Z.id, Z.type);
|
|
425
|
+
me.value = {
|
|
426
|
+
geometry: Y.geometry,
|
|
427
|
+
geometryType: J,
|
|
428
428
|
layerId: Z.id,
|
|
429
|
-
properties:
|
|
429
|
+
properties: Y.properties || {},
|
|
430
430
|
originalStyle: Xe
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
function te() {
|
|
436
|
-
|
|
436
|
+
ie.value = [], ge.value = null, Q.value = 0, me.value = null;
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
if (
|
|
440
|
-
const
|
|
441
|
-
if (!(
|
|
438
|
+
function we(i) {
|
|
439
|
+
if (ie.value.length === 0) return;
|
|
440
|
+
const f = i.target;
|
|
441
|
+
if (!(f.tagName === "INPUT" || f.tagName === "TEXTAREA" || f.isContentEditable))
|
|
442
442
|
switch (i.key) {
|
|
443
443
|
case "ArrowLeft":
|
|
444
444
|
case "ArrowUp":
|
|
@@ -446,47 +446,47 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
446
446
|
break;
|
|
447
447
|
case "ArrowRight":
|
|
448
448
|
case "ArrowDown":
|
|
449
|
-
i.preventDefault(),
|
|
449
|
+
i.preventDefault(), re();
|
|
450
450
|
break;
|
|
451
451
|
case "Escape":
|
|
452
452
|
i.preventDefault(), te();
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
|
|
457
|
-
window.addEventListener("keydown",
|
|
456
|
+
Ne(() => {
|
|
457
|
+
window.addEventListener("keydown", we);
|
|
458
458
|
}), Lt(() => {
|
|
459
|
-
window.removeEventListener("keydown",
|
|
459
|
+
window.removeEventListener("keydown", we);
|
|
460
460
|
});
|
|
461
|
-
function
|
|
462
|
-
const i =
|
|
463
|
-
i <= 1 || (
|
|
461
|
+
function re() {
|
|
462
|
+
const i = ie.value.length;
|
|
463
|
+
i <= 1 || (Q.value = (Q.value + 1) % i);
|
|
464
464
|
}
|
|
465
465
|
function Ze() {
|
|
466
|
-
const i =
|
|
467
|
-
i <= 1 || (
|
|
468
|
-
}
|
|
469
|
-
const
|
|
470
|
-
const i =
|
|
471
|
-
return !i || !i.popupConfig ? i?.layerTitle || "" :
|
|
472
|
-
}),
|
|
473
|
-
const i =
|
|
466
|
+
const i = ie.value.length;
|
|
467
|
+
i <= 1 || (Q.value = (Q.value - 1 + i) % i);
|
|
468
|
+
}
|
|
469
|
+
const C = I(() => ie.value.length === 0 ? null : ie.value[Q.value]), M = I(() => {
|
|
470
|
+
const i = C.value;
|
|
471
|
+
return !i || !i.popupConfig ? i?.layerTitle || "" : be(i.popupConfig.title, i.properties);
|
|
472
|
+
}), se = I(() => {
|
|
473
|
+
const i = C.value;
|
|
474
474
|
if (!i) return "";
|
|
475
|
-
let
|
|
476
|
-
if (
|
|
477
|
-
|
|
478
|
-
for (const
|
|
479
|
-
const
|
|
480
|
-
|
|
475
|
+
let f = '<div class="popup-content">';
|
|
476
|
+
if (f += `<h3 class="popup-title">${M.value}</h3>`, i.popupConfig?.fields?.length) {
|
|
477
|
+
f += '<table class="popup-table">';
|
|
478
|
+
for (const s of i.popupConfig.fields) {
|
|
479
|
+
const _ = Je(i.properties[s.field], s.format);
|
|
480
|
+
f += `<tr><th>${s.label}</th><td>${_}</td></tr>`;
|
|
481
481
|
}
|
|
482
|
-
|
|
482
|
+
f += "</table>";
|
|
483
483
|
} else
|
|
484
|
-
|
|
485
|
-
return
|
|
486
|
-
}), A =
|
|
484
|
+
f += '<p class="popup-no-fields">No additional information available.</p>';
|
|
485
|
+
return f += "</div>", f;
|
|
486
|
+
}), A = $({
|
|
487
487
|
type: "FeatureCollection",
|
|
488
488
|
features: []
|
|
489
|
-
}),
|
|
489
|
+
}), K = $({
|
|
490
490
|
type: "FeatureCollection",
|
|
491
491
|
features: []
|
|
492
492
|
}), Qe = {
|
|
@@ -499,24 +499,24 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
499
499
|
"line-width": ["get", "highlightWidth"],
|
|
500
500
|
"line-color": "#00FFFF",
|
|
501
501
|
"line-opacity": 0.9
|
|
502
|
-
},
|
|
502
|
+
}, me = $(null);
|
|
503
503
|
function rt(i) {
|
|
504
504
|
return i.type;
|
|
505
505
|
}
|
|
506
|
-
function st(i,
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
return typeof
|
|
506
|
+
function st(i, f) {
|
|
507
|
+
const s = $e(i);
|
|
508
|
+
if (!s) return { radius: 5, width: 2 };
|
|
509
|
+
const _ = s.paint || {};
|
|
510
|
+
if (f === "circle") {
|
|
511
|
+
const x = _["circle-radius"];
|
|
512
|
+
return typeof x == "number" ? { radius: x } : { radius: 5 };
|
|
513
513
|
}
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
if (typeof
|
|
517
|
-
return { width:
|
|
518
|
-
if (
|
|
519
|
-
const z =
|
|
514
|
+
if (f === "line" || f === "fill") {
|
|
515
|
+
const x = _["line-width"];
|
|
516
|
+
if (typeof x == "number")
|
|
517
|
+
return { width: x };
|
|
518
|
+
if (s.outlinePaint && s.outlinePaint["line-width"]) {
|
|
519
|
+
const z = s.outlinePaint["line-width"];
|
|
520
520
|
if (typeof z == "number")
|
|
521
521
|
return { width: z };
|
|
522
522
|
}
|
|
@@ -528,35 +528,35 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
528
528
|
return !i || i.length === 0 ? [] : i[0] ?? [];
|
|
529
529
|
}
|
|
530
530
|
function $t(i) {
|
|
531
|
-
const { geometry:
|
|
532
|
-
if (
|
|
533
|
-
const z = (
|
|
531
|
+
const { geometry: f, geometryType: s, originalStyle: _ } = i;
|
|
532
|
+
if (s === "Point" || s === "MultiPoint") {
|
|
533
|
+
const z = (_.radius || 5) + 3;
|
|
534
534
|
return {
|
|
535
535
|
type: "FeatureCollection",
|
|
536
536
|
features: [{
|
|
537
537
|
type: "Feature",
|
|
538
|
-
geometry:
|
|
538
|
+
geometry: f,
|
|
539
539
|
properties: {
|
|
540
540
|
highlightRadius: z
|
|
541
541
|
}
|
|
542
542
|
}]
|
|
543
543
|
};
|
|
544
544
|
}
|
|
545
|
-
if (
|
|
546
|
-
const z = (
|
|
545
|
+
if (s === "LineString" || s === "MultiLineString") {
|
|
546
|
+
const z = (_.width || 2) + 3;
|
|
547
547
|
return {
|
|
548
548
|
type: "FeatureCollection",
|
|
549
549
|
features: [{
|
|
550
550
|
type: "Feature",
|
|
551
|
-
geometry:
|
|
551
|
+
geometry: f,
|
|
552
552
|
properties: {
|
|
553
553
|
highlightWidth: z
|
|
554
554
|
}
|
|
555
555
|
}]
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
558
|
+
if (s === "Polygon") {
|
|
559
|
+
const x = f.coordinates, z = ct(x), N = (_.width || 2) + 3;
|
|
560
560
|
return {
|
|
561
561
|
type: "FeatureCollection",
|
|
562
562
|
features: [{
|
|
@@ -566,20 +566,20 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
566
566
|
coordinates: z
|
|
567
567
|
},
|
|
568
568
|
properties: {
|
|
569
|
-
highlightWidth:
|
|
569
|
+
highlightWidth: N
|
|
570
570
|
}
|
|
571
571
|
}]
|
|
572
572
|
};
|
|
573
573
|
}
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
574
|
+
if (s === "MultiPolygon") {
|
|
575
|
+
const x = f.coordinates, R = (_.width || 2) + 3;
|
|
576
576
|
return {
|
|
577
577
|
type: "FeatureCollection",
|
|
578
|
-
features:
|
|
578
|
+
features: x.map((V) => ({
|
|
579
579
|
type: "Feature",
|
|
580
580
|
geometry: {
|
|
581
581
|
type: "LineString",
|
|
582
|
-
coordinates: ct(
|
|
582
|
+
coordinates: ct(V)
|
|
583
583
|
},
|
|
584
584
|
properties: {
|
|
585
585
|
highlightWidth: R
|
|
@@ -597,57 +597,57 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
597
597
|
Pt();
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
i.geometryType === "Point" || i.geometryType === "MultiPoint" ? (A.value =
|
|
600
|
+
const f = $t(i);
|
|
601
|
+
i.geometryType === "Point" || i.geometryType === "MultiPoint" ? (A.value = f, K.value = { type: "FeatureCollection", features: [] }) : (K.value = f, A.value = { type: "FeatureCollection", features: [] });
|
|
602
602
|
}
|
|
603
603
|
function Pt() {
|
|
604
|
-
A.value = { type: "FeatureCollection", features: [] },
|
|
604
|
+
A.value = { type: "FeatureCollection", features: [] }, K.value = { type: "FeatureCollection", features: [] };
|
|
605
605
|
}
|
|
606
|
-
Pe(
|
|
606
|
+
Pe(me, (i) => {
|
|
607
607
|
xt(i);
|
|
608
608
|
}), Pe(
|
|
609
609
|
() => t.visibleLayers,
|
|
610
610
|
(i) => {
|
|
611
|
-
|
|
611
|
+
me.value && !i.has(me.value.layerId) && (me.value = null, te());
|
|
612
612
|
},
|
|
613
613
|
{ deep: !0 }
|
|
614
|
-
), Pe(
|
|
615
|
-
const i =
|
|
614
|
+
), Pe(Q, () => {
|
|
615
|
+
const i = C.value;
|
|
616
616
|
if (!i) {
|
|
617
|
-
|
|
617
|
+
me.value = null;
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
|
-
const
|
|
621
|
-
if (!
|
|
622
|
-
const
|
|
620
|
+
const f = l.value;
|
|
621
|
+
if (!f || !ge.value) return;
|
|
622
|
+
const s = [];
|
|
623
623
|
t.layerList.forEach((R) => {
|
|
624
|
-
const
|
|
625
|
-
t.visibleLayers.has(
|
|
624
|
+
const N = R.config;
|
|
625
|
+
t.visibleLayers.has(N.id) && (s.push(N.id), N.outlinePaint && s.push(`${N.id}-outline`));
|
|
626
626
|
});
|
|
627
|
-
const
|
|
628
|
-
layers:
|
|
627
|
+
const _ = f.project(ge.value), z = f.queryRenderedFeatures(_, {
|
|
628
|
+
layers: s
|
|
629
629
|
}).find((R) => R.layer.id.replace(/-outline$/, "") === i.layerId && JSON.stringify(R.properties) === JSON.stringify(i.properties));
|
|
630
630
|
if (z && z.geometry) {
|
|
631
631
|
const R = $e(i.layerId);
|
|
632
632
|
if (R) {
|
|
633
|
-
const
|
|
634
|
-
|
|
633
|
+
const N = rt(z.geometry), V = st(R.id, R.type);
|
|
634
|
+
me.value = {
|
|
635
635
|
geometry: z.geometry,
|
|
636
|
-
geometryType:
|
|
636
|
+
geometryType: N,
|
|
637
637
|
layerId: R.id,
|
|
638
638
|
properties: z.properties || {},
|
|
639
|
-
originalStyle:
|
|
639
|
+
originalStyle: V
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
const ut =
|
|
645
|
-
function
|
|
646
|
-
const [
|
|
647
|
-
ut.value = [
|
|
644
|
+
const ut = $(null);
|
|
645
|
+
function _t(i) {
|
|
646
|
+
const [f, s] = i.geometry.coordinates;
|
|
647
|
+
ut.value = [f, s];
|
|
648
648
|
}
|
|
649
|
-
return (i,
|
|
650
|
-
|
|
649
|
+
return (i, f) => (u(), m("div", Qt, [
|
|
650
|
+
X(O(It), {
|
|
651
651
|
ref_key: "mapRef",
|
|
652
652
|
ref: a,
|
|
653
653
|
zoom: t.initialZoom,
|
|
@@ -664,113 +664,113 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
664
664
|
"pictometry-button-position": t.pictometryButtonPosition,
|
|
665
665
|
"tool-panel-layout": "vertical",
|
|
666
666
|
"tool-panel-split-ratio": 50,
|
|
667
|
-
onZoom:
|
|
667
|
+
onZoom: v,
|
|
668
668
|
onClick: te,
|
|
669
|
-
onMoveend:
|
|
670
|
-
onLoad:
|
|
671
|
-
onSearchResult:
|
|
669
|
+
onMoveend: p,
|
|
670
|
+
onLoad: d,
|
|
671
|
+
onSearchResult: _t
|
|
672
672
|
}, {
|
|
673
673
|
default: Ee(() => [
|
|
674
|
-
t.drawControlPosition !== null ? (
|
|
674
|
+
t.drawControlPosition !== null ? (u(), ee(O(Rt), {
|
|
675
675
|
key: 0,
|
|
676
676
|
position: t.drawControlPosition
|
|
677
|
-
}, null, 8, ["position"])) :
|
|
678
|
-
(
|
|
679
|
-
key: "tiled-" +
|
|
680
|
-
id: "tiled-" +
|
|
681
|
-
source: je(
|
|
682
|
-
paint: { "raster-opacity": Se(
|
|
683
|
-
minzoom:
|
|
684
|
-
maxzoom:
|
|
677
|
+
}, null, 8, ["position"])) : T("", !0),
|
|
678
|
+
(u(!0), m(oe, null, ae(qe.value, (s) => (u(), ee(O(pt), {
|
|
679
|
+
key: "tiled-" + s.id,
|
|
680
|
+
id: "tiled-" + s.id,
|
|
681
|
+
source: je(s),
|
|
682
|
+
paint: { "raster-opacity": Se(s.id) },
|
|
683
|
+
minzoom: s.minZoom,
|
|
684
|
+
maxzoom: s.maxZoom
|
|
685
685
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
686
|
-
(
|
|
687
|
-
key: "dynamic-" +
|
|
688
|
-
id: "dynamic-" +
|
|
689
|
-
source: Ce(
|
|
690
|
-
paint: { "raster-opacity": Se(
|
|
691
|
-
minzoom:
|
|
692
|
-
maxzoom:
|
|
686
|
+
(u(!0), m(oe, null, ae(Ge.value, (s) => (u(), ee(O(pt), {
|
|
687
|
+
key: "dynamic-" + s.id,
|
|
688
|
+
id: "dynamic-" + s.id,
|
|
689
|
+
source: Ce(s),
|
|
690
|
+
paint: { "raster-opacity": Se(s.id) },
|
|
691
|
+
minzoom: s.minZoom,
|
|
692
|
+
maxzoom: s.maxZoom
|
|
693
693
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
694
|
-
(
|
|
695
|
-
key:
|
|
696
|
-
id:
|
|
697
|
-
source:
|
|
698
|
-
paint:
|
|
699
|
-
minzoom:
|
|
700
|
-
maxzoom:
|
|
694
|
+
(u(!0), m(oe, null, ae(F.value, (s) => (u(), ee(O(yt), {
|
|
695
|
+
key: s.id,
|
|
696
|
+
id: s.id,
|
|
697
|
+
source: pe(s),
|
|
698
|
+
paint: ye(s),
|
|
699
|
+
minzoom: s.minZoom,
|
|
700
|
+
maxzoom: s.maxZoom,
|
|
701
701
|
"before-id": "highlight-circles",
|
|
702
702
|
onClick: xe
|
|
703
703
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
704
|
-
(
|
|
705
|
-
key:
|
|
706
|
-
id:
|
|
707
|
-
source:
|
|
708
|
-
paint:
|
|
709
|
-
minzoom:
|
|
710
|
-
maxzoom:
|
|
704
|
+
(u(!0), m(oe, null, ae(B.value, (s) => (u(), ee(O(Dt), {
|
|
705
|
+
key: s.id,
|
|
706
|
+
id: s.id,
|
|
707
|
+
source: pe(s),
|
|
708
|
+
paint: ye(s),
|
|
709
|
+
minzoom: s.minZoom,
|
|
710
|
+
maxzoom: s.maxZoom,
|
|
711
711
|
"before-id": "highlight-circles",
|
|
712
712
|
onClick: xe
|
|
713
713
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
714
|
-
(
|
|
715
|
-
key:
|
|
716
|
-
id:
|
|
717
|
-
source:
|
|
718
|
-
paint: He(
|
|
719
|
-
minzoom:
|
|
720
|
-
maxzoom:
|
|
714
|
+
(u(!0), m(oe, null, ae(q.value, (s) => (u(), ee(O(Ye), {
|
|
715
|
+
key: s.id + "-outline",
|
|
716
|
+
id: s.id + "-outline",
|
|
717
|
+
source: pe(s),
|
|
718
|
+
paint: He(s),
|
|
719
|
+
minzoom: s.minZoom,
|
|
720
|
+
maxzoom: s.maxZoom,
|
|
721
721
|
"before-id": "highlight-lines",
|
|
722
722
|
onClick: xe
|
|
723
723
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
724
|
-
(
|
|
725
|
-
key:
|
|
726
|
-
id:
|
|
727
|
-
source:
|
|
728
|
-
paint:
|
|
729
|
-
minzoom:
|
|
730
|
-
maxzoom:
|
|
724
|
+
(u(!0), m(oe, null, ae(ce.value, (s) => (u(), ee(O(Ye), {
|
|
725
|
+
key: s.id,
|
|
726
|
+
id: s.id,
|
|
727
|
+
source: pe(s),
|
|
728
|
+
paint: ye(s),
|
|
729
|
+
minzoom: s.minZoom,
|
|
730
|
+
maxzoom: s.maxZoom,
|
|
731
731
|
"before-id": "highlight-lines",
|
|
732
732
|
onClick: xe
|
|
733
733
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
734
|
-
|
|
734
|
+
X(O(yt), {
|
|
735
735
|
key: "highlight-circles-layer",
|
|
736
736
|
id: "highlight-circles",
|
|
737
737
|
source: { type: "geojson", data: A.value },
|
|
738
738
|
paint: Qe
|
|
739
739
|
}, null, 8, ["source"]),
|
|
740
|
-
|
|
740
|
+
X(O(Ye), {
|
|
741
741
|
key: "highlight-lines-layer",
|
|
742
742
|
id: "highlight-lines",
|
|
743
|
-
source: { type: "geojson", data:
|
|
743
|
+
source: { type: "geojson", data: K.value },
|
|
744
744
|
paint: Ke
|
|
745
745
|
}, null, 8, ["source"]),
|
|
746
|
-
|
|
746
|
+
X(O(Zt), {
|
|
747
747
|
"lng-lat": ut.value,
|
|
748
748
|
color: "#2176d2"
|
|
749
749
|
}, null, 8, ["lng-lat"]),
|
|
750
|
-
|
|
750
|
+
C.value && ge.value ? (u(), ee(O(Bt), {
|
|
751
751
|
key: 1,
|
|
752
|
-
"lng-lat":
|
|
753
|
-
html:
|
|
752
|
+
"lng-lat": ge.value,
|
|
753
|
+
html: se.value,
|
|
754
754
|
"close-on-click": !1,
|
|
755
|
-
"show-navigation":
|
|
756
|
-
"current-feature-index":
|
|
757
|
-
"total-features":
|
|
758
|
-
"layer-name":
|
|
755
|
+
"show-navigation": ie.value.length > 1,
|
|
756
|
+
"current-feature-index": Q.value,
|
|
757
|
+
"total-features": ie.value.length,
|
|
758
|
+
"layer-name": C.value.layerTitle,
|
|
759
759
|
onClose: te,
|
|
760
|
-
onNext:
|
|
760
|
+
onNext: re,
|
|
761
761
|
onPrevious: Ze
|
|
762
|
-
}, 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"])) : T("", !0)
|
|
763
763
|
]),
|
|
764
764
|
_: 1
|
|
765
765
|
}, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
|
|
766
766
|
]));
|
|
767
767
|
}
|
|
768
|
-
}),
|
|
768
|
+
}), ze = (e, n) => {
|
|
769
769
|
const t = e.__vccOpts || e;
|
|
770
770
|
for (const [o, a] of n)
|
|
771
771
|
t[o] = a;
|
|
772
772
|
return t;
|
|
773
|
-
}, Xt = /* @__PURE__ */
|
|
773
|
+
}, Xt = /* @__PURE__ */ ze(Kt, [["__scopeId", "data-v-3f5a9efa"]]), Yt = ["disabled"], eo = /* @__PURE__ */ ve({
|
|
774
774
|
inheritAttrs: !1,
|
|
775
775
|
__name: "PhlButton",
|
|
776
776
|
props: {
|
|
@@ -821,28 +821,28 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
821
821
|
shadow: n.iconOnly && n.variant === "standard"
|
|
822
822
|
})
|
|
823
823
|
);
|
|
824
|
-
return (c,
|
|
824
|
+
return (c, v) => t(n) ? (u(), ee(O(Nt), tt({ key: 0 }, { ...a.value, ...c.$attrs }, { role: "button" }), {
|
|
825
825
|
default: Ee(() => [
|
|
826
|
-
|
|
826
|
+
X(O(gt), dt(ft(l.value)), {
|
|
827
827
|
default: Ee(() => [
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
le(c.$slots, "default", {}, () => [
|
|
829
|
+
fe(W(n.text), 1)
|
|
830
830
|
])
|
|
831
831
|
]),
|
|
832
832
|
_: 3
|
|
833
833
|
}, 16)
|
|
834
834
|
]),
|
|
835
835
|
_: 3
|
|
836
|
-
}, 16)) : (
|
|
836
|
+
}, 16)) : (u(), m("button", tt({
|
|
837
837
|
key: 1,
|
|
838
838
|
type: "button",
|
|
839
839
|
disabled: n.disabled,
|
|
840
840
|
class: o.value
|
|
841
841
|
}, c.$attrs), [
|
|
842
|
-
|
|
842
|
+
X(O(gt), dt(ft(l.value)), {
|
|
843
843
|
default: Ee(() => [
|
|
844
|
-
|
|
845
|
-
|
|
844
|
+
le(c.$slots, "default", {}, () => [
|
|
845
|
+
fe(W(n.text), 1)
|
|
846
846
|
])
|
|
847
847
|
]),
|
|
848
848
|
_: 3
|
|
@@ -865,7 +865,7 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
865
865
|
}, fo = {
|
|
866
866
|
key: 2,
|
|
867
867
|
class: "has-text-body-small phila-error-text"
|
|
868
|
-
}, po = /* @__PURE__ */
|
|
868
|
+
}, po = /* @__PURE__ */ ve({
|
|
869
869
|
inheritAttrs: !1,
|
|
870
870
|
__name: "TextField",
|
|
871
871
|
props: {
|
|
@@ -883,83 +883,83 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
883
883
|
},
|
|
884
884
|
emits: ["update:modelValue"],
|
|
885
885
|
setup(e, { emit: n }) {
|
|
886
|
-
const t =
|
|
887
|
-
get: () => o.modelValue !== void 0 ? o.modelValue :
|
|
888
|
-
set: (
|
|
889
|
-
c("update:modelValue",
|
|
886
|
+
const t = Mt(), o = e, a = I(() => typeof o.error == "string" ? o.error : o.error[0]), l = zt(o, "id"), c = n, v = $(""), y = I({
|
|
887
|
+
get: () => o.modelValue !== void 0 ? o.modelValue : v.value,
|
|
888
|
+
set: (h) => {
|
|
889
|
+
c("update:modelValue", h), v.value = h;
|
|
890
890
|
}
|
|
891
|
-
}),
|
|
892
|
-
const
|
|
893
|
-
return t.disabled != null &&
|
|
894
|
-
}),
|
|
895
|
-
const
|
|
896
|
-
return
|
|
897
|
-
}),
|
|
898
|
-
|
|
891
|
+
}), P = I(() => {
|
|
892
|
+
const h = ["default-class"];
|
|
893
|
+
return t.disabled != null && h.push("phila-input--disabled"), a.value && h.push("phila-input--error"), t.required != null && h.push("phila-input--required"), ot(...h);
|
|
894
|
+
}), w = I(() => {
|
|
895
|
+
const h = [];
|
|
896
|
+
return y.value !== "" && h.push("phila-text-field--filled"), o.className && h.push(o.className), ot(...h);
|
|
897
|
+
}), L = $(null), r = (h) => {
|
|
898
|
+
h.target.closest("button") || L.value?.focus();
|
|
899
899
|
};
|
|
900
|
-
return (
|
|
901
|
-
class: ne(["phila-input",
|
|
900
|
+
return (h, b) => (u(), m("div", {
|
|
901
|
+
class: ne(["phila-input", P.value])
|
|
902
902
|
}, [
|
|
903
|
-
o.label ? (
|
|
903
|
+
o.label ? (u(), m("label", {
|
|
904
904
|
key: 0,
|
|
905
905
|
for: l.value,
|
|
906
906
|
class: "has-text-label-small phila-label"
|
|
907
|
-
},
|
|
908
|
-
|
|
909
|
-
class: ne(["phila-text-field",
|
|
910
|
-
onClick:
|
|
907
|
+
}, W(o.label), 9, ao)) : T("", !0),
|
|
908
|
+
k("div", {
|
|
909
|
+
class: ne(["phila-text-field", w.value]),
|
|
910
|
+
onClick: r
|
|
911
911
|
}, [
|
|
912
|
-
|
|
913
|
-
o.leadingIcon ? (
|
|
912
|
+
k("div", lo, [
|
|
913
|
+
o.leadingIcon ? (u(), ee(O(ue), {
|
|
914
914
|
key: 0,
|
|
915
915
|
"icon-class": o.leadingIcon,
|
|
916
916
|
inline: "",
|
|
917
917
|
decorative: "",
|
|
918
918
|
shadow: ""
|
|
919
|
-
}, null, 8, ["icon-class"])) :
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
St(
|
|
919
|
+
}, null, 8, ["icon-class"])) : T("", !0),
|
|
920
|
+
k("div", ro, [
|
|
921
|
+
k("div", so, [
|
|
922
|
+
St(k("input", tt({
|
|
923
923
|
id: l.value,
|
|
924
924
|
ref_key: "inputRef",
|
|
925
|
-
ref:
|
|
926
|
-
"onUpdate:modelValue":
|
|
925
|
+
ref: L,
|
|
926
|
+
"onUpdate:modelValue": b[0] || (b[0] = (g) => y.value = g),
|
|
927
927
|
class: "phila-text-field-input has-text-body-default",
|
|
928
928
|
placeholder: o.placeholder
|
|
929
|
-
},
|
|
930
|
-
[
|
|
929
|
+
}, O(t)), null, 16, co), [
|
|
930
|
+
[Ft, y.value]
|
|
931
931
|
])
|
|
932
932
|
])
|
|
933
933
|
]),
|
|
934
|
-
|
|
934
|
+
y.value != "" ? (u(), ee(O(eo), {
|
|
935
935
|
key: 1,
|
|
936
936
|
variant: "standard",
|
|
937
937
|
size: "small",
|
|
938
938
|
"icon-only": "",
|
|
939
|
-
"icon-definition":
|
|
940
|
-
onClick:
|
|
941
|
-
}, null, 8, ["icon-definition"])) :
|
|
942
|
-
o.trailingIcon ? (
|
|
939
|
+
"icon-definition": O(io),
|
|
940
|
+
onClick: b[1] || (b[1] = (g) => y.value = "")
|
|
941
|
+
}, null, 8, ["icon-definition"])) : T("", !0),
|
|
942
|
+
o.trailingIcon ? (u(), ee(O(ue), {
|
|
943
943
|
key: 2,
|
|
944
944
|
size: "small",
|
|
945
945
|
"icon-class": o.trailingIcon,
|
|
946
946
|
inline: "",
|
|
947
947
|
decorative: "",
|
|
948
948
|
shadow: ""
|
|
949
|
-
}, null, 8, ["icon-class"])) :
|
|
950
|
-
|
|
949
|
+
}, null, 8, ["icon-class"])) : T("", !0),
|
|
950
|
+
le(h.$slots, "trailing-action")
|
|
951
951
|
])
|
|
952
952
|
], 2),
|
|
953
|
-
o.supportingText ? (
|
|
954
|
-
a.value ? (
|
|
955
|
-
|
|
956
|
-
"icon-definition":
|
|
953
|
+
o.supportingText ? (u(), m("div", uo, W(o.supportingText), 1)) : T("", !0),
|
|
954
|
+
a.value ? (u(), m("div", fo, [
|
|
955
|
+
X(O(ue), {
|
|
956
|
+
"icon-definition": O(oo),
|
|
957
957
|
size: "small",
|
|
958
958
|
inline: "",
|
|
959
959
|
decorative: ""
|
|
960
960
|
}, null, 8, ["icon-definition"]),
|
|
961
|
-
|
|
962
|
-
])) :
|
|
961
|
+
fe(" " + W(a.value), 1)
|
|
962
|
+
])) : T("", !0)
|
|
963
963
|
], 2));
|
|
964
964
|
}
|
|
965
965
|
});
|
|
@@ -1000,19 +1000,19 @@ const bo = { class: "layer-panel" }, wo = {
|
|
|
1000
1000
|
}, $o = ["checked", "disabled", "onChange"], xo = { class: "layer-title" }, Po = {
|
|
1001
1001
|
key: 0,
|
|
1002
1002
|
class: "loading-indicator"
|
|
1003
|
-
},
|
|
1003
|
+
}, _o = ["title"], Mo = {
|
|
1004
1004
|
key: 2,
|
|
1005
1005
|
class: "zoom-indicator"
|
|
1006
1006
|
}, zo = {
|
|
1007
1007
|
key: 0,
|
|
1008
1008
|
class: "opacity-control"
|
|
1009
|
-
},
|
|
1009
|
+
}, Fo = { class: "opacity-label" }, To = ["value", "onInput"], Eo = {
|
|
1010
1010
|
key: 1,
|
|
1011
1011
|
class: "layer-legend"
|
|
1012
1012
|
}, Oo = { class: "legend-label" }, Io = {
|
|
1013
1013
|
key: 0,
|
|
1014
1014
|
class: "no-results"
|
|
1015
|
-
}, Ro = /* @__PURE__ */
|
|
1015
|
+
}, Ro = /* @__PURE__ */ ve({
|
|
1016
1016
|
__name: "LayerPanel",
|
|
1017
1017
|
props: {
|
|
1018
1018
|
layerList: {},
|
|
@@ -1034,58 +1034,58 @@ const bo = { class: "layer-panel" }, wo = {
|
|
|
1034
1034
|
const t = e, o = n, a = I(() => {
|
|
1035
1035
|
if (!t.searchQuery.trim())
|
|
1036
1036
|
return t.layerList;
|
|
1037
|
-
const
|
|
1037
|
+
const p = t.searchQuery.toLowerCase();
|
|
1038
1038
|
return t.layerList.filter(
|
|
1039
|
-
(
|
|
1039
|
+
(d) => d.config.title.toLowerCase().includes(p)
|
|
1040
1040
|
);
|
|
1041
1041
|
});
|
|
1042
|
-
function l(
|
|
1043
|
-
let
|
|
1044
|
-
return
|
|
1042
|
+
function l(p) {
|
|
1043
|
+
let d = p.split("?")[0] || p;
|
|
1044
|
+
return d = d.replace(/\/query$/, ""), d = d.replace(/\/$/, ""), d.toLowerCase();
|
|
1045
1045
|
}
|
|
1046
|
-
function c(
|
|
1047
|
-
const
|
|
1048
|
-
return t.layerMetadata[
|
|
1046
|
+
function c(p) {
|
|
1047
|
+
const d = l(p);
|
|
1048
|
+
return t.layerMetadata[d] || null;
|
|
1049
1049
|
}
|
|
1050
|
-
const
|
|
1051
|
-
function
|
|
1052
|
-
return t.visibleLayers.has(
|
|
1050
|
+
const v = I(() => t.layerList.some((p) => c(p.config.url)));
|
|
1051
|
+
function y(p) {
|
|
1052
|
+
return t.visibleLayers.has(p);
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return t.layerOpacities[
|
|
1054
|
+
function P(p) {
|
|
1055
|
+
return t.layerOpacities[p] ?? 1;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1058
|
-
return t.loadingLayers.has(
|
|
1057
|
+
function w(p) {
|
|
1058
|
+
return t.loadingLayers.has(p);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return t.layerErrors[
|
|
1060
|
+
function L(p) {
|
|
1061
|
+
return t.layerErrors[p] || null;
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1065
|
-
return !(
|
|
1063
|
+
function r(p) {
|
|
1064
|
+
const d = t.currentZoom, S = p.minZoom, E = p.maxZoom;
|
|
1065
|
+
return !(S !== void 0 && d < S || E !== void 0 && d > E);
|
|
1066
1066
|
}
|
|
1067
|
-
const
|
|
1067
|
+
const h = I({
|
|
1068
1068
|
get: () => t.searchQuery,
|
|
1069
|
-
set: (
|
|
1069
|
+
set: (p) => o("updateSearch", p)
|
|
1070
1070
|
});
|
|
1071
|
-
function
|
|
1072
|
-
o("toggleLayer",
|
|
1073
|
-
}
|
|
1074
|
-
function
|
|
1075
|
-
const
|
|
1076
|
-
o("setOpacity",
|
|
1077
|
-
}
|
|
1078
|
-
return (
|
|
1079
|
-
e.showSearch ? (
|
|
1080
|
-
|
|
1081
|
-
modelValue:
|
|
1082
|
-
"onUpdate:modelValue":
|
|
1071
|
+
function b(p) {
|
|
1072
|
+
o("toggleLayer", p);
|
|
1073
|
+
}
|
|
1074
|
+
function g(p, d) {
|
|
1075
|
+
const S = d.target, E = parseFloat(S.value);
|
|
1076
|
+
o("setOpacity", p, E);
|
|
1077
|
+
}
|
|
1078
|
+
return (p, d) => (u(), m("aside", bo, [
|
|
1079
|
+
e.showSearch ? (u(), m("div", wo, [
|
|
1080
|
+
X(O(po), {
|
|
1081
|
+
modelValue: h.value,
|
|
1082
|
+
"onUpdate:modelValue": d[0] || (d[0] = (S) => h.value = S),
|
|
1083
1083
|
placeholder: e.searchPlaceholder,
|
|
1084
1084
|
"class-name": "layer-search-field"
|
|
1085
1085
|
}, {
|
|
1086
1086
|
"trailing-action": Ee(() => [
|
|
1087
|
-
|
|
1088
|
-
"icon-definition":
|
|
1087
|
+
X(O(ue), {
|
|
1088
|
+
"icon-definition": O(yo),
|
|
1089
1089
|
size: "small",
|
|
1090
1090
|
inline: "",
|
|
1091
1091
|
decorative: ""
|
|
@@ -1093,103 +1093,103 @@ const bo = { class: "layer-panel" }, wo = {
|
|
|
1093
1093
|
]),
|
|
1094
1094
|
_: 1
|
|
1095
1095
|
}, 8, ["modelValue", "placeholder"])
|
|
1096
|
-
])) :
|
|
1097
|
-
e.mode === "topics" ? (
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
])) : T("", !0),
|
|
1097
|
+
e.mode === "topics" ? (u(), m("div", Lo, [
|
|
1098
|
+
le(p.$slots, "topics", {}, () => [
|
|
1099
|
+
d[2] || (d[2] = k("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
|
|
1100
1100
|
], !0)
|
|
1101
|
-
])) : (
|
|
1101
|
+
])) : (u(), m("div", {
|
|
1102
1102
|
key: 2,
|
|
1103
|
-
class: ne(["layer-list", { "has-metadata":
|
|
1103
|
+
class: ne(["layer-list", { "has-metadata": v.value }])
|
|
1104
1104
|
}, [
|
|
1105
|
-
(
|
|
1106
|
-
key:
|
|
1105
|
+
(u(!0), m(oe, null, ae(a.value, (S) => (u(), m("div", {
|
|
1106
|
+
key: S.config.id,
|
|
1107
1107
|
class: "layer-item"
|
|
1108
1108
|
}, [
|
|
1109
|
-
|
|
1110
|
-
c(
|
|
1109
|
+
k("div", So, [
|
|
1110
|
+
c(S.config.url) ? (u(), m("a", {
|
|
1111
1111
|
key: 0,
|
|
1112
|
-
href: c(
|
|
1112
|
+
href: c(S.config.url) || "",
|
|
1113
1113
|
target: "_blank",
|
|
1114
1114
|
rel: "noopener noreferrer",
|
|
1115
1115
|
class: "metadata-link",
|
|
1116
1116
|
title: "View metadata",
|
|
1117
|
-
onClick:
|
|
1117
|
+
onClick: d[1] || (d[1] = Tt(() => {
|
|
1118
1118
|
}, ["stop"]))
|
|
1119
1119
|
}, [
|
|
1120
|
-
|
|
1121
|
-
"icon-definition":
|
|
1120
|
+
X(O(ue), {
|
|
1121
|
+
"icon-definition": O(vo),
|
|
1122
1122
|
size: "small",
|
|
1123
1123
|
inline: "",
|
|
1124
1124
|
decorative: ""
|
|
1125
1125
|
}, null, 8, ["icon-definition"])
|
|
1126
|
-
], 8, Co)) :
|
|
1127
|
-
|
|
1126
|
+
], 8, Co)) : v.value ? (u(), m("span", ko)) : T("", !0),
|
|
1127
|
+
k("label", {
|
|
1128
1128
|
class: ne(["layer-checkbox", {
|
|
1129
|
-
"layer-unavailable": !
|
|
1130
|
-
"layer-error":
|
|
1129
|
+
"layer-unavailable": !r(S.config),
|
|
1130
|
+
"layer-error": L(S.config.id)
|
|
1131
1131
|
}])
|
|
1132
1132
|
}, [
|
|
1133
|
-
|
|
1133
|
+
k("input", {
|
|
1134
1134
|
type: "checkbox",
|
|
1135
|
-
checked:
|
|
1136
|
-
disabled: !
|
|
1137
|
-
onChange: (E) =>
|
|
1135
|
+
checked: y(S.config.id),
|
|
1136
|
+
disabled: !r(S.config),
|
|
1137
|
+
onChange: (E) => b(S.config.id)
|
|
1138
1138
|
}, null, 40, $o),
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1139
|
+
k("span", xo, [
|
|
1140
|
+
fe(W(S.config.title) + " ", 1),
|
|
1141
|
+
w(S.config.id) ? (u(), m("span", Po, " Loading... ")) : T("", !0),
|
|
1142
|
+
L(S.config.id) ? (u(), m("span", {
|
|
1143
1143
|
key: 1,
|
|
1144
1144
|
class: "error-indicator",
|
|
1145
|
-
title:
|
|
1146
|
-
}, " Error ", 8,
|
|
1147
|
-
|
|
1145
|
+
title: L(S.config.id) || ""
|
|
1146
|
+
}, " Error ", 8, _o)) : T("", !0),
|
|
1147
|
+
r(S.config) ? T("", !0) : (u(), m("span", Mo, " (zoom in) "))
|
|
1148
1148
|
])
|
|
1149
1149
|
], 2)
|
|
1150
1150
|
]),
|
|
1151
|
-
e.showOpacity &&
|
|
1152
|
-
|
|
1153
|
-
|
|
1151
|
+
e.showOpacity && y(S.config.id) ? (u(), m("div", zo, [
|
|
1152
|
+
k("label", Fo, " Opacity: " + W(Math.round(P(S.config.id) * 100)) + "% ", 1),
|
|
1153
|
+
k("input", {
|
|
1154
1154
|
type: "range",
|
|
1155
1155
|
min: "0",
|
|
1156
1156
|
max: "1",
|
|
1157
1157
|
step: "0.05",
|
|
1158
|
-
value:
|
|
1158
|
+
value: P(S.config.id),
|
|
1159
1159
|
class: "opacity-slider",
|
|
1160
|
-
onInput: (E) =>
|
|
1161
|
-
}, null, 40,
|
|
1162
|
-
])) :
|
|
1163
|
-
e.showLegend &&
|
|
1164
|
-
(
|
|
1165
|
-
key:
|
|
1160
|
+
onInput: (E) => g(S.config.id, E)
|
|
1161
|
+
}, null, 40, To)
|
|
1162
|
+
])) : T("", !0),
|
|
1163
|
+
e.showLegend && y(S.config.id) && S.config.legend?.length ? (u(), m("ul", Eo, [
|
|
1164
|
+
(u(!0), m(oe, null, ae(S.config.legend, (E, F) => (u(), m("li", {
|
|
1165
|
+
key: F,
|
|
1166
1166
|
class: "legend-item"
|
|
1167
1167
|
}, [
|
|
1168
|
-
E.type === "circle" ? (
|
|
1168
|
+
E.type === "circle" ? (u(), m("span", {
|
|
1169
1169
|
key: 0,
|
|
1170
1170
|
class: "legend-symbol legend-circle",
|
|
1171
|
-
style:
|
|
1172
|
-
}, null, 4)) : E.type === "line" ? (
|
|
1171
|
+
style: H({ backgroundColor: E.color })
|
|
1172
|
+
}, null, 4)) : E.type === "line" ? (u(), m("span", {
|
|
1173
1173
|
key: 1,
|
|
1174
1174
|
class: "legend-symbol legend-line",
|
|
1175
|
-
style:
|
|
1175
|
+
style: H({
|
|
1176
1176
|
backgroundColor: E.color,
|
|
1177
1177
|
height: `${E.width || 2}px`
|
|
1178
1178
|
})
|
|
1179
|
-
}, null, 4)) : E.type === "fill" ? (
|
|
1179
|
+
}, null, 4)) : E.type === "fill" ? (u(), m("span", {
|
|
1180
1180
|
key: 2,
|
|
1181
1181
|
class: "legend-symbol legend-fill",
|
|
1182
|
-
style:
|
|
1183
|
-
}, null, 4)) :
|
|
1184
|
-
|
|
1182
|
+
style: H({ backgroundColor: E.color })
|
|
1183
|
+
}, null, 4)) : T("", !0),
|
|
1184
|
+
k("span", Oo, W(E.label), 1)
|
|
1185
1185
|
]))), 128))
|
|
1186
|
-
])) :
|
|
1186
|
+
])) : T("", !0)
|
|
1187
1187
|
]))), 128)),
|
|
1188
|
-
a.value.length === 0 ? (
|
|
1188
|
+
a.value.length === 0 ? (u(), m("div", Io, ' No layers match "' + W(e.searchQuery) + '" ', 1)) : T("", !0)
|
|
1189
1189
|
], 2))
|
|
1190
1190
|
]));
|
|
1191
1191
|
}
|
|
1192
|
-
}), Do = /* @__PURE__ */
|
|
1192
|
+
}), Do = /* @__PURE__ */ ze(Ro, [["__scopeId", "data-v-d2e878e2"]]);
|
|
1193
1193
|
function D(e) {
|
|
1194
1194
|
if (!e || !Array.isArray(e) || e.length < 3) return "#888888";
|
|
1195
1195
|
const n = e[0], t = e[1], o = e[2], l = (e[3] ?? 255) / 255;
|
|
@@ -1231,7 +1231,7 @@ function Ue(e) {
|
|
|
1231
1231
|
return "fill";
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Me(e) {
|
|
1235
1235
|
return !(!e || e.style === "esriSLSNull" || e.color === null || e.width === 0 || e.color && e.color[3] === 0);
|
|
1236
1236
|
}
|
|
1237
1237
|
function et(e) {
|
|
@@ -1239,17 +1239,17 @@ function et(e) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
function Ct(e, n, t) {
|
|
1241
1241
|
const o = e.symbol, a = Ue(o);
|
|
1242
|
-
let l = {}, c = [],
|
|
1242
|
+
let l = {}, c = [], v = null;
|
|
1243
1243
|
if (a === "fill" && o) {
|
|
1244
|
-
const
|
|
1244
|
+
const y = o.color === null ? 0 : o.color?.[3] ?? 255, P = y === 0 ? "rgba(0, 0, 0, 0)" : D(o.color), w = y === 0 ? 0 : y < 255 ? 1 : de(n);
|
|
1245
1245
|
if (l = {
|
|
1246
|
-
"fill-color":
|
|
1247
|
-
"fill-opacity":
|
|
1248
|
-
},
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
"line-color":
|
|
1252
|
-
"line-width":
|
|
1246
|
+
"fill-color": P,
|
|
1247
|
+
"fill-opacity": w
|
|
1248
|
+
}, Me(o.outline)) {
|
|
1249
|
+
const L = o.outline.width || 1, r = D(o.outline.color);
|
|
1250
|
+
y !== 0 && (l["fill-outline-color"] = r), (L > 1 || y === 0) && (v = {
|
|
1251
|
+
"line-color": r,
|
|
1252
|
+
"line-width": L
|
|
1253
1253
|
});
|
|
1254
1254
|
}
|
|
1255
1255
|
c = [{
|
|
@@ -1269,168 +1269,168 @@ function Ct(e, n, t) {
|
|
|
1269
1269
|
label: e.label || "Feature"
|
|
1270
1270
|
}];
|
|
1271
1271
|
else if (a === "circle" && o) {
|
|
1272
|
-
const
|
|
1272
|
+
const y = Math.round((o.size || 6) * 0.71 * 100) / 100;
|
|
1273
1273
|
l = {
|
|
1274
1274
|
"circle-color": D(o.color),
|
|
1275
|
-
"circle-radius":
|
|
1275
|
+
"circle-radius": y,
|
|
1276
1276
|
"circle-opacity": de(n)
|
|
1277
|
-
},
|
|
1277
|
+
}, Me(o.outline) && (l["circle-stroke-color"] = D(o.outline.color), l["circle-stroke-width"] = o.outline.width || 1), c = [{
|
|
1278
1278
|
type: "circle",
|
|
1279
1279
|
color: D(o.color),
|
|
1280
1280
|
label: e.label || "Feature"
|
|
1281
1281
|
}];
|
|
1282
1282
|
}
|
|
1283
|
-
return { paint: l, legend: c, geomType: a, outlinePaint:
|
|
1283
|
+
return { paint: l, legend: c, geomType: a, outlinePaint: v };
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function No(e, n, t) {
|
|
1286
1286
|
const o = e.field1, a = e.uniqueValueInfos || [], l = e.defaultSymbol;
|
|
1287
1287
|
if (a.length === 0)
|
|
1288
1288
|
return Ct({ ...e, symbol: l }, n);
|
|
1289
|
-
const c = a[0]?.symbol || l,
|
|
1290
|
-
let
|
|
1291
|
-
if (
|
|
1292
|
-
const
|
|
1293
|
-
for (const
|
|
1294
|
-
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1289
|
+
const c = a[0]?.symbol || l, v = Ue(c);
|
|
1290
|
+
let y = {}, P = [], w = null;
|
|
1291
|
+
if (v === "fill") {
|
|
1292
|
+
const L = ["match", ["to-string", ["get", o]]];
|
|
1293
|
+
for (const r of a) {
|
|
1294
|
+
L.push(et(r.value)), L.push(D(r.symbol?.color));
|
|
1295
|
+
const h = String(r.value), g = t?.get(h) || r.label || h;
|
|
1296
|
+
P.push({
|
|
1297
1297
|
type: "fill",
|
|
1298
|
-
color: D(
|
|
1299
|
-
label:
|
|
1298
|
+
color: D(r.symbol?.color),
|
|
1299
|
+
label: g
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
|
-
if (
|
|
1303
|
-
"fill-color":
|
|
1302
|
+
if (L.push(l ? D(l.color) : "#888888"), y = {
|
|
1303
|
+
"fill-color": L,
|
|
1304
1304
|
"fill-opacity": de(n)
|
|
1305
|
-
},
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1308
|
-
"line-color":
|
|
1309
|
-
"line-width":
|
|
1305
|
+
}, Me(c?.outline)) {
|
|
1306
|
+
const r = c.outline.width || 1, h = D(c.outline.color);
|
|
1307
|
+
y["fill-outline-color"] = h, r > 1 && (w = {
|
|
1308
|
+
"line-color": h,
|
|
1309
|
+
"line-width": r
|
|
1310
1310
|
});
|
|
1311
1311
|
}
|
|
1312
|
-
} else if (
|
|
1313
|
-
const
|
|
1314
|
-
for (const
|
|
1315
|
-
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1312
|
+
} else if (v === "line") {
|
|
1313
|
+
const L = ["match", ["to-string", ["get", o]]];
|
|
1314
|
+
for (const r of a) {
|
|
1315
|
+
L.push(et(r.value)), L.push(D(r.symbol?.color));
|
|
1316
|
+
const h = String(r.value), g = t?.get(h) || r.label || h;
|
|
1317
|
+
P.push({
|
|
1318
1318
|
type: "line",
|
|
1319
|
-
color: D(
|
|
1320
|
-
width:
|
|
1321
|
-
label:
|
|
1319
|
+
color: D(r.symbol?.color),
|
|
1320
|
+
width: r.symbol?.width || 1,
|
|
1321
|
+
label: g
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
1324
|
-
|
|
1325
|
-
"line-color":
|
|
1324
|
+
L.push(l ? D(l.color) : "#888888"), y = {
|
|
1325
|
+
"line-color": L,
|
|
1326
1326
|
"line-width": c?.width || 2,
|
|
1327
1327
|
"line-opacity": de(n)
|
|
1328
1328
|
};
|
|
1329
|
-
} else if (
|
|
1330
|
-
const
|
|
1331
|
-
for (const
|
|
1332
|
-
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1329
|
+
} else if (v === "circle") {
|
|
1330
|
+
const L = ["match", ["to-string", ["get", o]]];
|
|
1331
|
+
for (const h of a) {
|
|
1332
|
+
L.push(et(h.value)), L.push(D(h.symbol?.color));
|
|
1333
|
+
const b = String(h.value), p = t?.get(b) || h.label || b;
|
|
1334
|
+
P.push({
|
|
1335
1335
|
type: "circle",
|
|
1336
|
-
color: D(
|
|
1337
|
-
label:
|
|
1336
|
+
color: D(h.symbol?.color),
|
|
1337
|
+
label: p
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
"circle-color":
|
|
1344
|
-
"circle-radius":
|
|
1340
|
+
L.push(l ? D(l.color) : "#888888");
|
|
1341
|
+
const r = Math.round((c?.size || 6) * 0.71 * 100) / 100;
|
|
1342
|
+
y = {
|
|
1343
|
+
"circle-color": L,
|
|
1344
|
+
"circle-radius": r,
|
|
1345
1345
|
"circle-opacity": de(n)
|
|
1346
|
-
},
|
|
1346
|
+
}, Me(c?.outline) && (y["circle-stroke-color"] = D(c.outline.color), y["circle-stroke-width"] = c.outline.width || 1);
|
|
1347
1347
|
}
|
|
1348
|
-
return { paint:
|
|
1348
|
+
return { paint: y, legend: P, geomType: v, outlinePaint: w };
|
|
1349
1349
|
}
|
|
1350
1350
|
function Ao(e, n) {
|
|
1351
|
-
const t = e.field, o = e.classBreakInfos || [], a = e.visualVariables?.find((
|
|
1351
|
+
const t = e.field, o = e.classBreakInfos || [], a = e.visualVariables?.find((w) => w.type === "colorInfo");
|
|
1352
1352
|
if (a?.stops && a.stops.length > 0)
|
|
1353
|
-
return
|
|
1353
|
+
return Vo(a, t, e, n);
|
|
1354
1354
|
if (o.length === 0)
|
|
1355
1355
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1356
1356
|
const l = o[0]?.symbol, c = Ue(l);
|
|
1357
|
-
let
|
|
1357
|
+
let v = {}, y = [], P = null;
|
|
1358
1358
|
if (c === "fill") {
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
for (let
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1359
|
+
const w = ["step", ["get", t]];
|
|
1360
|
+
w.push(D(o[0]?.symbol?.color));
|
|
1361
|
+
for (let L = 0; L < o.length; L++) {
|
|
1362
|
+
const r = o[L];
|
|
1363
|
+
L > 0 && (w.push(o[L - 1].classMaxValue), w.push(D(r.symbol?.color))), y.push({
|
|
1364
1364
|
type: "fill",
|
|
1365
|
-
color: D(
|
|
1366
|
-
label:
|
|
1365
|
+
color: D(r.symbol?.color),
|
|
1366
|
+
label: r.label || `${r.classMaxValue}`
|
|
1367
1367
|
});
|
|
1368
1368
|
}
|
|
1369
|
-
if (
|
|
1370
|
-
"fill-color":
|
|
1369
|
+
if (v = {
|
|
1370
|
+
"fill-color": w,
|
|
1371
1371
|
"fill-opacity": de(n)
|
|
1372
|
-
},
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
"line-color":
|
|
1376
|
-
"line-width":
|
|
1372
|
+
}, Me(l?.outline)) {
|
|
1373
|
+
const L = l.outline.width || 1, r = D(l.outline.color);
|
|
1374
|
+
v["fill-outline-color"] = r, L > 1 && (P = {
|
|
1375
|
+
"line-color": r,
|
|
1376
|
+
"line-width": L
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
1379
|
} else if (c === "line") {
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1382
|
-
let
|
|
1383
|
-
for (let
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1380
|
+
const w = ["step", ["get", t]];
|
|
1381
|
+
w.push(D(o[0]?.symbol?.color));
|
|
1382
|
+
let L = e.minValue ?? 0;
|
|
1383
|
+
for (let h = 0; h < o.length; h++) {
|
|
1384
|
+
const b = o[h];
|
|
1385
|
+
h > 0 && (w.push(o[h - 1].classMaxValue), w.push(D(b.symbol?.color))), y.push({
|
|
1386
1386
|
type: "line",
|
|
1387
|
-
color: D(
|
|
1388
|
-
width:
|
|
1389
|
-
label:
|
|
1390
|
-
}),
|
|
1391
|
-
}
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
"line-color":
|
|
1395
|
-
"line-width":
|
|
1387
|
+
color: D(b.symbol?.color),
|
|
1388
|
+
width: b.symbol?.width || l?.width || 2,
|
|
1389
|
+
label: b.label || `${L} - ${b.classMaxValue}`
|
|
1390
|
+
}), L = b.classMaxValue + 1;
|
|
1391
|
+
}
|
|
1392
|
+
const r = l?.width || 2;
|
|
1393
|
+
v = {
|
|
1394
|
+
"line-color": w,
|
|
1395
|
+
"line-width": r,
|
|
1396
1396
|
"line-opacity": de(n)
|
|
1397
1397
|
};
|
|
1398
1398
|
}
|
|
1399
|
-
return { paint:
|
|
1399
|
+
return { paint: v, legend: y, geomType: c, outlinePaint: P };
|
|
1400
1400
|
}
|
|
1401
|
-
function
|
|
1401
|
+
function Vo(e, n, t, o) {
|
|
1402
1402
|
const a = e.stops || [];
|
|
1403
1403
|
if (a.length === 0)
|
|
1404
1404
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1405
1405
|
const l = t.classBreakInfos?.[0]?.symbol || t.defaultSymbol, c = Ue(l);
|
|
1406
|
-
let
|
|
1406
|
+
let v = {}, y = [], P = null;
|
|
1407
1407
|
if (c === "fill") {
|
|
1408
|
-
const
|
|
1409
|
-
for (const
|
|
1410
|
-
|
|
1408
|
+
const w = ["interpolate", ["linear"], ["get", n]];
|
|
1409
|
+
for (const r of a)
|
|
1410
|
+
w.push(r.value), w.push(D(r.color)), y.push({
|
|
1411
1411
|
type: "fill",
|
|
1412
|
-
color: D(
|
|
1413
|
-
label:
|
|
1412
|
+
color: D(r.color),
|
|
1413
|
+
label: r.label || `${r.value}`
|
|
1414
1414
|
});
|
|
1415
|
-
if (
|
|
1415
|
+
if (v = {
|
|
1416
1416
|
"fill-color": [
|
|
1417
1417
|
"case",
|
|
1418
1418
|
["==", ["get", n], null],
|
|
1419
1419
|
"rgba(0, 0, 0, 0)",
|
|
1420
1420
|
// Transparent for null/no-data values
|
|
1421
|
-
|
|
1421
|
+
w
|
|
1422
1422
|
// Otherwise use the interpolated color
|
|
1423
1423
|
],
|
|
1424
1424
|
"fill-opacity": de(o)
|
|
1425
|
-
},
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1428
|
-
"line-color":
|
|
1429
|
-
"line-width":
|
|
1425
|
+
}, Me(l?.outline)) {
|
|
1426
|
+
const r = l.outline.width || 1, h = D(l.outline.color);
|
|
1427
|
+
v["fill-outline-color"] = h, r > 1 && (P = {
|
|
1428
|
+
"line-color": h,
|
|
1429
|
+
"line-width": r
|
|
1430
1430
|
});
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
|
-
return { paint:
|
|
1433
|
+
return { paint: v, legend: y, geomType: c, outlinePaint: P };
|
|
1434
1434
|
}
|
|
1435
1435
|
function Uo(e, n, t, o) {
|
|
1436
1436
|
if (!e?.renderer)
|
|
@@ -1440,7 +1440,7 @@ function Uo(e, n, t, o) {
|
|
|
1440
1440
|
case "simple":
|
|
1441
1441
|
return Ct(a, n);
|
|
1442
1442
|
case "uniqueValue":
|
|
1443
|
-
return
|
|
1443
|
+
return No(a, n, t);
|
|
1444
1444
|
case "classBreaks":
|
|
1445
1445
|
return Ao(a, n);
|
|
1446
1446
|
default:
|
|
@@ -1479,8 +1479,8 @@ function Ho(e) {
|
|
|
1479
1479
|
for (const a of t) {
|
|
1480
1480
|
const l = a.trim().match(o);
|
|
1481
1481
|
if (l) {
|
|
1482
|
-
const [, c,
|
|
1483
|
-
c &&
|
|
1482
|
+
const [, c, v] = l;
|
|
1483
|
+
c && v && n.set(c, v.trim());
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
1486
|
return n;
|
|
@@ -1505,47 +1505,47 @@ async function kt(e) {
|
|
|
1505
1505
|
if (a.url && a.itemId !== "4f39b829b96d437da9231727d9c91fab")
|
|
1506
1506
|
try {
|
|
1507
1507
|
let l = a.layerDefinition?.drawingInfo, c;
|
|
1508
|
-
const
|
|
1509
|
-
if ((
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1508
|
+
const v = !l || !l.renderer, y = o.includes(a.title);
|
|
1509
|
+
if ((v || y) && a.url) {
|
|
1510
|
+
const F = await Jo(a.url);
|
|
1511
|
+
F && (l = F.drawingInfo, F.description && (c = Ho(F.description), c.size > 0));
|
|
1512
1512
|
}
|
|
1513
|
-
const { paint:
|
|
1513
|
+
const { paint: P, legend: w, geomType: L, outlinePaint: r } = Uo(
|
|
1514
1514
|
l,
|
|
1515
1515
|
a.opacity,
|
|
1516
1516
|
c,
|
|
1517
1517
|
a.title
|
|
1518
|
-
),
|
|
1518
|
+
), h = Wo(a.popupInfo), b = jo(a.layerDefinition), g = Bo(
|
|
1519
1519
|
a.layerDefinition?.minScale,
|
|
1520
1520
|
a.layerDefinition?.maxScale
|
|
1521
|
-
),
|
|
1522
|
-
let
|
|
1521
|
+
), p = qo(a.title), d = Go(a.title);
|
|
1522
|
+
let S = a.opacity ?? 1;
|
|
1523
1523
|
const E = {
|
|
1524
|
-
id:
|
|
1525
|
-
title:
|
|
1526
|
-
type:
|
|
1524
|
+
id: p,
|
|
1525
|
+
title: d,
|
|
1526
|
+
type: L,
|
|
1527
1527
|
url: a.url,
|
|
1528
|
-
opacity:
|
|
1529
|
-
paint:
|
|
1530
|
-
legend:
|
|
1531
|
-
popup:
|
|
1528
|
+
opacity: S,
|
|
1529
|
+
paint: P,
|
|
1530
|
+
legend: w,
|
|
1531
|
+
popup: h
|
|
1532
1532
|
};
|
|
1533
|
-
|
|
1533
|
+
b && (E.where = b), g.minZoom !== void 0 && (E.minZoom = g.minZoom), g.maxZoom !== void 0 && (E.maxZoom = g.maxZoom), r && (E.outlinePaint = r), t.push(E);
|
|
1534
1534
|
} catch {
|
|
1535
1535
|
}
|
|
1536
1536
|
return t.sort((a, l) => a.title.localeCompare(l.title)), t;
|
|
1537
1537
|
}
|
|
1538
|
-
const bt = {}, at = "376af635c84643cd816a8c5d017a53aa",
|
|
1538
|
+
const bt = {}, at = "376af635c84643cd816a8c5d017a53aa", Kn = at;
|
|
1539
1539
|
function lt(e, n) {
|
|
1540
1540
|
let t = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
|
|
1541
1541
|
return n && (t += `&token=${n}`), t;
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1543
|
+
function Xn() {
|
|
1544
1544
|
return lt(at);
|
|
1545
1545
|
}
|
|
1546
|
-
const Ae = /* @__PURE__ */ new Map(),
|
|
1546
|
+
const Ae = /* @__PURE__ */ new Map(), Oe = /* @__PURE__ */ new Map();
|
|
1547
1547
|
function Qo(e) {
|
|
1548
|
-
e ? (Ae.delete(e),
|
|
1548
|
+
e ? (Ae.delete(e), Oe.delete(e)) : (Ae.clear(), Oe.clear());
|
|
1549
1549
|
}
|
|
1550
1550
|
let Be, wt = 0;
|
|
1551
1551
|
async function Ko() {
|
|
@@ -1595,7 +1595,7 @@ async function it(e = at) {
|
|
|
1595
1595
|
const n = Ae.get(e);
|
|
1596
1596
|
if (n)
|
|
1597
1597
|
return n;
|
|
1598
|
-
const t =
|
|
1598
|
+
const t = Oe.get(e);
|
|
1599
1599
|
if (t)
|
|
1600
1600
|
return t;
|
|
1601
1601
|
const o = (async () => {
|
|
@@ -1603,118 +1603,118 @@ async function it(e = at) {
|
|
|
1603
1603
|
const a = await Yo(e);
|
|
1604
1604
|
return Ae.set(e, a), a;
|
|
1605
1605
|
} finally {
|
|
1606
|
-
|
|
1606
|
+
Oe.delete(e);
|
|
1607
1607
|
}
|
|
1608
1608
|
})();
|
|
1609
|
-
return
|
|
1609
|
+
return Oe.set(e, o), o;
|
|
1610
1610
|
}
|
|
1611
1611
|
function en(e) {
|
|
1612
|
-
const n =
|
|
1613
|
-
for (const
|
|
1614
|
-
n.value[
|
|
1612
|
+
const n = $({}), t = /* @__PURE__ */ new Map();
|
|
1613
|
+
for (const r of e)
|
|
1614
|
+
n.value[r.id] = {
|
|
1615
1615
|
data: null,
|
|
1616
1616
|
loading: !1,
|
|
1617
1617
|
error: null,
|
|
1618
1618
|
lastFetched: null
|
|
1619
1619
|
};
|
|
1620
|
-
async function o(
|
|
1621
|
-
const
|
|
1620
|
+
async function o(r) {
|
|
1621
|
+
const h = r.id;
|
|
1622
1622
|
n.value = {
|
|
1623
1623
|
...n.value,
|
|
1624
|
-
[
|
|
1625
|
-
data: n.value[
|
|
1626
|
-
lastFetched: n.value[
|
|
1624
|
+
[h]: {
|
|
1625
|
+
data: n.value[h]?.data ?? null,
|
|
1626
|
+
lastFetched: n.value[h]?.lastFetched ?? null,
|
|
1627
1627
|
loading: !0,
|
|
1628
1628
|
error: null
|
|
1629
1629
|
}
|
|
1630
1630
|
};
|
|
1631
1631
|
try {
|
|
1632
|
-
let
|
|
1633
|
-
if (
|
|
1634
|
-
const
|
|
1632
|
+
let b;
|
|
1633
|
+
if (r.type === "http-get") {
|
|
1634
|
+
const g = await fetch(r.url, {
|
|
1635
1635
|
method: "GET",
|
|
1636
|
-
...
|
|
1636
|
+
...r.options
|
|
1637
1637
|
});
|
|
1638
|
-
if (!
|
|
1639
|
-
throw new Error(`HTTP ${
|
|
1640
|
-
|
|
1641
|
-
} else if (
|
|
1642
|
-
const
|
|
1638
|
+
if (!g.ok)
|
|
1639
|
+
throw new Error(`HTTP ${g.status}: ${g.statusText}`);
|
|
1640
|
+
b = await g.json();
|
|
1641
|
+
} else if (r.type === "http-post") {
|
|
1642
|
+
const g = await fetch(r.url, {
|
|
1643
1643
|
method: "POST",
|
|
1644
|
-
...
|
|
1644
|
+
...r.options
|
|
1645
1645
|
});
|
|
1646
|
-
if (!y.ok)
|
|
1647
|
-
throw new Error(`HTTP ${y.status}: ${y.statusText}`);
|
|
1648
|
-
$ = await y.json();
|
|
1649
|
-
} else if (s.type === "esri") {
|
|
1650
|
-
const S = `${s.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, g = await fetch(S, s.options);
|
|
1651
1646
|
if (!g.ok)
|
|
1652
1647
|
throw new Error(`HTTP ${g.status}: ${g.statusText}`);
|
|
1653
|
-
|
|
1648
|
+
b = await g.json();
|
|
1649
|
+
} else if (r.type === "esri") {
|
|
1650
|
+
const p = `${r.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, d = await fetch(p, r.options);
|
|
1651
|
+
if (!d.ok)
|
|
1652
|
+
throw new Error(`HTTP ${d.status}: ${d.statusText}`);
|
|
1653
|
+
b = (await d.json()).features?.map((E) => E.attributes) || [];
|
|
1654
1654
|
} else
|
|
1655
|
-
throw new Error(`Unknown data source type: ${
|
|
1656
|
-
|
|
1655
|
+
throw new Error(`Unknown data source type: ${r.type}`);
|
|
1656
|
+
r.transform && (b = r.transform(b)), n.value = {
|
|
1657
1657
|
...n.value,
|
|
1658
|
-
[
|
|
1659
|
-
data:
|
|
1658
|
+
[h]: {
|
|
1659
|
+
data: b,
|
|
1660
1660
|
loading: !1,
|
|
1661
1661
|
error: null,
|
|
1662
1662
|
lastFetched: Date.now()
|
|
1663
1663
|
}
|
|
1664
1664
|
};
|
|
1665
|
-
} catch (
|
|
1666
|
-
const
|
|
1665
|
+
} catch (b) {
|
|
1666
|
+
const g = b instanceof Error ? b.message : "Unknown error";
|
|
1667
1667
|
n.value = {
|
|
1668
1668
|
...n.value,
|
|
1669
|
-
[
|
|
1670
|
-
data: n.value[
|
|
1671
|
-
lastFetched: n.value[
|
|
1669
|
+
[h]: {
|
|
1670
|
+
data: n.value[h]?.data ?? null,
|
|
1671
|
+
lastFetched: n.value[h]?.lastFetched ?? null,
|
|
1672
1672
|
loading: !1,
|
|
1673
|
-
error:
|
|
1673
|
+
error: g
|
|
1674
1674
|
}
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
async function a() {
|
|
1679
|
-
await Promise.all(e.map((
|
|
1679
|
+
await Promise.all(e.map((r) => o(r)));
|
|
1680
1680
|
}
|
|
1681
|
-
async function l(
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1681
|
+
async function l(r) {
|
|
1682
|
+
const h = e.find((b) => b.id === r);
|
|
1683
|
+
h && await o(h);
|
|
1684
1684
|
}
|
|
1685
|
-
function c(
|
|
1686
|
-
return n.value[
|
|
1685
|
+
function c(r) {
|
|
1686
|
+
return n.value[r]?.data ?? null;
|
|
1687
1687
|
}
|
|
1688
|
-
const
|
|
1689
|
-
function
|
|
1690
|
-
return n.value[
|
|
1688
|
+
const v = I(() => Object.values(n.value).some((r) => r.loading));
|
|
1689
|
+
function y(r) {
|
|
1690
|
+
return n.value[r]?.loading ?? !1;
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return n.value[
|
|
1692
|
+
function P(r) {
|
|
1693
|
+
return n.value[r]?.error ?? null;
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1696
|
-
for (const
|
|
1697
|
-
if (
|
|
1698
|
-
const
|
|
1699
|
-
o(
|
|
1700
|
-
},
|
|
1701
|
-
t.set(
|
|
1695
|
+
function w() {
|
|
1696
|
+
for (const r of e)
|
|
1697
|
+
if (r.pollInterval && r.pollInterval > 0) {
|
|
1698
|
+
const h = window.setInterval(() => {
|
|
1699
|
+
o(r);
|
|
1700
|
+
}, r.pollInterval);
|
|
1701
|
+
t.set(r.id, h);
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1705
|
-
for (const [,
|
|
1706
|
-
window.clearInterval(
|
|
1704
|
+
function L() {
|
|
1705
|
+
for (const [, r] of t)
|
|
1706
|
+
window.clearInterval(r);
|
|
1707
1707
|
t.clear();
|
|
1708
1708
|
}
|
|
1709
|
-
return
|
|
1710
|
-
a(),
|
|
1709
|
+
return Ne(() => {
|
|
1710
|
+
a(), w();
|
|
1711
1711
|
}), Lt(() => {
|
|
1712
|
-
|
|
1712
|
+
L();
|
|
1713
1713
|
}), {
|
|
1714
1714
|
/** Reactive state for all data sources */
|
|
1715
|
-
state:
|
|
1715
|
+
state: j(n),
|
|
1716
1716
|
/** Whether any data source is currently loading */
|
|
1717
|
-
isLoading:
|
|
1717
|
+
isLoading: v,
|
|
1718
1718
|
/** Fetch all data sources */
|
|
1719
1719
|
fetchAll: a,
|
|
1720
1720
|
/** Refetch a specific data source by id */
|
|
@@ -1722,11 +1722,11 @@ function en(e) {
|
|
|
1722
1722
|
/** Get data for a specific source */
|
|
1723
1723
|
getData: c,
|
|
1724
1724
|
/** Check if a specific source is loading */
|
|
1725
|
-
isSourceLoading:
|
|
1725
|
+
isSourceLoading: y,
|
|
1726
1726
|
/** Get error for a specific source */
|
|
1727
|
-
getError:
|
|
1727
|
+
getError: P,
|
|
1728
1728
|
/** Stop all polling (useful for cleanup) */
|
|
1729
|
-
stopPolling:
|
|
1729
|
+
stopPolling: L
|
|
1730
1730
|
};
|
|
1731
1731
|
}
|
|
1732
1732
|
const tn = { class: "layerboard-layout" }, on = {
|
|
@@ -1738,7 +1738,7 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
1738
1738
|
}, rn = {
|
|
1739
1739
|
key: 1,
|
|
1740
1740
|
class: "layerboard-error"
|
|
1741
|
-
}, sn = { key: 0 }, cn = { key: 1 }, un = { class: "layerboard-modal" }, dn = /* @__PURE__ */
|
|
1741
|
+
}, sn = { key: 0 }, cn = { key: 1 }, un = { class: "layerboard-modal" }, dn = /* @__PURE__ */ ve({
|
|
1742
1742
|
__name: "Layerboard",
|
|
1743
1743
|
props: {
|
|
1744
1744
|
title: {},
|
|
@@ -1767,180 +1767,180 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
1767
1767
|
},
|
|
1768
1768
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
1769
1769
|
setup(e, { expose: n, emit: t }) {
|
|
1770
|
-
const o = e, a = t, l =
|
|
1771
|
-
function
|
|
1772
|
-
const
|
|
1773
|
-
for (const
|
|
1774
|
-
|
|
1775
|
-
|
|
1770
|
+
const o = e, a = t, l = $([]), c = $(!0), v = $(null), y = $(12), P = $(""), w = $(/* @__PURE__ */ new Set()), L = $({}), r = $(/* @__PURE__ */ new Set()), h = $({}), b = $({}), g = $(/* @__PURE__ */ new Set()), p = $({});
|
|
1771
|
+
function d() {
|
|
1772
|
+
const C = {};
|
|
1773
|
+
for (const M of o.tiledLayers)
|
|
1774
|
+
C[M.id] = M.opacity ?? 1;
|
|
1775
|
+
p.value = C;
|
|
1776
1776
|
}
|
|
1777
|
-
function
|
|
1778
|
-
|
|
1777
|
+
function S(C) {
|
|
1778
|
+
g.value.has(C) ? g.value.delete(C) : g.value.add(C), g.value = new Set(g.value);
|
|
1779
1779
|
}
|
|
1780
|
-
function E(
|
|
1781
|
-
|
|
1780
|
+
function E(C, M) {
|
|
1781
|
+
M ? g.value.add(C) : g.value.delete(C), g.value = new Set(g.value);
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1784
|
-
|
|
1783
|
+
function F(C, M) {
|
|
1784
|
+
p.value = { ...p.value, [C]: M };
|
|
1785
1785
|
}
|
|
1786
1786
|
const B = o.dataSources.length > 0 ? en(o.dataSources) : null, q = I(() => B?.state.value ?? {}), ce = I(() => B?.isLoading.value ?? !1);
|
|
1787
|
-
function Le(
|
|
1788
|
-
return B?.getData(
|
|
1787
|
+
function Le(C) {
|
|
1788
|
+
return B?.getData(C) ?? null;
|
|
1789
1789
|
}
|
|
1790
|
-
function Se(
|
|
1791
|
-
return B?.refetch(
|
|
1790
|
+
function Se(C) {
|
|
1791
|
+
return B?.refetch(C) ?? Promise.resolve();
|
|
1792
1792
|
}
|
|
1793
|
-
U("layerboard-layers",
|
|
1793
|
+
U("layerboard-layers", j(l)), U("layerboard-visible", w), U("layerboard-opacities", L), U("layerboard-loading", j(r)), U("layerboard-errors", j(h)), U("layerboard-zoom", j(y)), U("layerboard-toggle-layer", Ce), U("layerboard-set-layer-visible", pe), U("layerboard-set-layers-visible", ke), U("layerboard-set-opacity", ye), U("layerboard-tiled-layers", j(I(() => o.tiledLayers))), U("layerboard-visible-tiled", g), U("layerboard-tiled-opacities", p), U("layerboard-toggle-tiled", S), U("layerboard-set-tiled-opacity", F), 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);
|
|
1794
1794
|
const We = I(() => ({
|
|
1795
1795
|
backgroundColor: o.themeColor
|
|
1796
1796
|
})), je = I(() => ({
|
|
1797
1797
|
backgroundColor: o.themeColor
|
|
1798
|
-
})),
|
|
1798
|
+
})), Fe = I(() => ({
|
|
1799
1799
|
backgroundColor: o.themeColor
|
|
1800
1800
|
})), Ie = I(() => ({
|
|
1801
|
-
width:
|
|
1801
|
+
width: he.value ? "0" : o.sidebarWidth
|
|
1802
1802
|
}));
|
|
1803
1803
|
async function Te() {
|
|
1804
1804
|
try {
|
|
1805
|
-
c.value = !0,
|
|
1806
|
-
const
|
|
1807
|
-
const
|
|
1808
|
-
return
|
|
1805
|
+
c.value = !0, v.value = null;
|
|
1806
|
+
const M = (await it(o.webMapId)).map((A) => {
|
|
1807
|
+
const K = o.layerStyleOverrides[A.id];
|
|
1808
|
+
return K ? {
|
|
1809
1809
|
...A,
|
|
1810
|
-
paint:
|
|
1811
|
-
outlinePaint:
|
|
1812
|
-
legend:
|
|
1813
|
-
type:
|
|
1810
|
+
paint: K.paint ?? A.paint,
|
|
1811
|
+
outlinePaint: K.outlinePaint ?? A.outlinePaint,
|
|
1812
|
+
legend: K.legend ?? A.legend,
|
|
1813
|
+
type: K.type ?? A.type
|
|
1814
1814
|
} : A;
|
|
1815
1815
|
});
|
|
1816
|
-
l.value =
|
|
1816
|
+
l.value = M.map((A) => ({
|
|
1817
1817
|
config: A,
|
|
1818
1818
|
component: A.type
|
|
1819
1819
|
}));
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
}),
|
|
1824
|
-
} catch (
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1820
|
+
const se = {};
|
|
1821
|
+
M.forEach((A) => {
|
|
1822
|
+
se[A.id] = A.opacity ?? 1;
|
|
1823
|
+
}), L.value = se, a("configs-loaded", M);
|
|
1824
|
+
} catch (C) {
|
|
1825
|
+
const M = C instanceof Error ? C.message : "Failed to load layer configurations";
|
|
1826
|
+
v.value = M, a("load-error", M);
|
|
1827
1827
|
} finally {
|
|
1828
1828
|
c.value = !1;
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
|
-
function Re(
|
|
1832
|
-
let
|
|
1833
|
-
return
|
|
1831
|
+
function Re(C) {
|
|
1832
|
+
let M = C.split("?")[0] || C;
|
|
1833
|
+
return M = M.replace(/\/query$/, ""), M = M.replace(/\/$/, ""), M.toLowerCase();
|
|
1834
1834
|
}
|
|
1835
1835
|
async function qe() {
|
|
1836
1836
|
if (o.fetchMetadata)
|
|
1837
1837
|
try {
|
|
1838
|
-
const
|
|
1838
|
+
const C = "https://phl.carto.com/api/v2/sql?q=" + encodeURIComponent(
|
|
1839
1839
|
"select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
|
|
1840
|
-
),
|
|
1841
|
-
if (!
|
|
1842
|
-
const
|
|
1843
|
-
for (const
|
|
1844
|
-
if (
|
|
1845
|
-
const Qe = Re(
|
|
1840
|
+
), M = await fetch(C);
|
|
1841
|
+
if (!M.ok) return;
|
|
1842
|
+
const se = await M.json(), A = {};
|
|
1843
|
+
for (const K of se.rows || [])
|
|
1844
|
+
if (K.url_text && K.representation) {
|
|
1845
|
+
const Qe = Re(K.url_text), Ke = `https://metadata.phila.gov/#home/representationdetails/${K.representation}/`;
|
|
1846
1846
|
A[Qe] = Ke;
|
|
1847
1847
|
}
|
|
1848
|
-
|
|
1848
|
+
b.value = A;
|
|
1849
1849
|
} catch {
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
1852
|
-
function Ge(
|
|
1853
|
-
|
|
1852
|
+
function Ge(C) {
|
|
1853
|
+
y.value = C, a("zoom", C);
|
|
1854
1854
|
}
|
|
1855
|
-
function Ce(
|
|
1856
|
-
|
|
1855
|
+
function Ce(C) {
|
|
1856
|
+
w.value.has(C) ? w.value.delete(C) : w.value.add(C), w.value = new Set(w.value);
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1859
|
-
|
|
1858
|
+
function pe(C, M) {
|
|
1859
|
+
M ? w.value.add(C) : w.value.delete(C), w.value = new Set(w.value);
|
|
1860
1860
|
}
|
|
1861
|
-
function ke(
|
|
1862
|
-
for (const
|
|
1863
|
-
|
|
1864
|
-
|
|
1861
|
+
function ke(C, M) {
|
|
1862
|
+
for (const se of C)
|
|
1863
|
+
M ? w.value.add(se) : w.value.delete(se);
|
|
1864
|
+
w.value = new Set(w.value);
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1867
|
-
|
|
1866
|
+
function ye(C, M) {
|
|
1867
|
+
L.value = { ...L.value, [C]: M };
|
|
1868
1868
|
}
|
|
1869
|
-
function He(
|
|
1870
|
-
|
|
1869
|
+
function He(C, M) {
|
|
1870
|
+
M ? r.value.add(C) : r.value.delete(C), r.value = new Set(r.value);
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1872
|
+
function ie(C, M) {
|
|
1873
|
+
if (M)
|
|
1874
|
+
h.value = { ...h.value, [C]: M };
|
|
1875
1875
|
else {
|
|
1876
|
-
const { [
|
|
1877
|
-
|
|
1876
|
+
const { [C]: se, ...A } = h.value;
|
|
1877
|
+
h.value = A;
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1881
|
-
|
|
1880
|
+
function ge(C) {
|
|
1881
|
+
P.value = C;
|
|
1882
1882
|
}
|
|
1883
|
-
const
|
|
1883
|
+
const Q = $("map");
|
|
1884
1884
|
function $e() {
|
|
1885
|
-
|
|
1885
|
+
Q.value = Q.value === "sidebar" ? "map" : "sidebar";
|
|
1886
1886
|
}
|
|
1887
|
-
const
|
|
1887
|
+
const be = $(!1);
|
|
1888
1888
|
function Je() {
|
|
1889
|
-
|
|
1889
|
+
be.value = !be.value;
|
|
1890
1890
|
}
|
|
1891
1891
|
function De() {
|
|
1892
|
-
|
|
1892
|
+
be.value = !1;
|
|
1893
1893
|
}
|
|
1894
|
-
const
|
|
1894
|
+
const he = $(!1);
|
|
1895
1895
|
function xe() {
|
|
1896
|
-
|
|
1896
|
+
he.value = !he.value;
|
|
1897
1897
|
}
|
|
1898
|
-
const te =
|
|
1899
|
-
function
|
|
1898
|
+
const te = $(!1);
|
|
1899
|
+
function we() {
|
|
1900
1900
|
te.value = !0;
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function re() {
|
|
1903
1903
|
te.value = !1;
|
|
1904
1904
|
}
|
|
1905
|
-
function Ze(
|
|
1906
|
-
|
|
1905
|
+
function Ze(C) {
|
|
1906
|
+
C.target.classList.contains("layerboard-modal-backdrop") && re();
|
|
1907
1907
|
}
|
|
1908
|
-
return U("layerboard-open-modal",
|
|
1908
|
+
return U("layerboard-open-modal", we), U("layerboard-close-modal", re), U("layerboard-is-modal-open", j(te)), n({
|
|
1909
1909
|
/** Layer configurations */
|
|
1910
1910
|
layerList: l,
|
|
1911
1911
|
/** Set of visible layer IDs */
|
|
1912
|
-
visibleLayers:
|
|
1912
|
+
visibleLayers: w,
|
|
1913
1913
|
/** Layer opacity values */
|
|
1914
|
-
layerOpacities:
|
|
1914
|
+
layerOpacities: L,
|
|
1915
1915
|
/** Set of currently loading layer IDs */
|
|
1916
|
-
loadingLayers:
|
|
1916
|
+
loadingLayers: r,
|
|
1917
1917
|
/** Map of layer errors by ID */
|
|
1918
|
-
layerErrors:
|
|
1918
|
+
layerErrors: h,
|
|
1919
1919
|
/** Current map zoom level */
|
|
1920
|
-
currentZoom:
|
|
1920
|
+
currentZoom: y,
|
|
1921
1921
|
/** Toggle a layer's visibility */
|
|
1922
1922
|
toggleLayer: Ce,
|
|
1923
1923
|
/** Set a layer's visibility explicitly */
|
|
1924
|
-
setLayerVisible:
|
|
1924
|
+
setLayerVisible: pe,
|
|
1925
1925
|
/** Set multiple layers' visibility at once */
|
|
1926
1926
|
setLayersVisible: ke,
|
|
1927
1927
|
/** Set a layer's opacity */
|
|
1928
|
-
setLayerOpacity:
|
|
1928
|
+
setLayerOpacity: ye,
|
|
1929
1929
|
/** Reload layer configurations */
|
|
1930
1930
|
reloadConfigs: Te,
|
|
1931
1931
|
/** Clear configuration cache */
|
|
1932
1932
|
clearCache: () => Qo(o.webMapId),
|
|
1933
1933
|
// Tiled layer APIs
|
|
1934
1934
|
/** Set of visible tiled layer IDs */
|
|
1935
|
-
visibleTiledLayers:
|
|
1935
|
+
visibleTiledLayers: g,
|
|
1936
1936
|
/** Tiled layer opacity values */
|
|
1937
|
-
tiledLayerOpacities:
|
|
1937
|
+
tiledLayerOpacities: p,
|
|
1938
1938
|
/** Toggle a tiled layer's visibility */
|
|
1939
|
-
toggleTiledLayer:
|
|
1939
|
+
toggleTiledLayer: S,
|
|
1940
1940
|
/** Set a tiled layer's visibility explicitly */
|
|
1941
1941
|
setTiledLayerVisible: E,
|
|
1942
1942
|
/** Set a tiled layer's opacity */
|
|
1943
|
-
setTiledLayerOpacity:
|
|
1943
|
+
setTiledLayerOpacity: F,
|
|
1944
1944
|
// Data source APIs
|
|
1945
1945
|
/** State of all data sources */
|
|
1946
1946
|
dataSourcesState: q,
|
|
@@ -1954,141 +1954,141 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
1954
1954
|
/** Whether the modal is currently open */
|
|
1955
1955
|
isModalOpen: te,
|
|
1956
1956
|
/** Open the modal */
|
|
1957
|
-
openModal:
|
|
1957
|
+
openModal: we,
|
|
1958
1958
|
/** Close the modal */
|
|
1959
|
-
closeModal:
|
|
1960
|
-
}),
|
|
1961
|
-
Te(), qe(),
|
|
1962
|
-
}), (
|
|
1963
|
-
|
|
1959
|
+
closeModal: re
|
|
1960
|
+
}), Ne(() => {
|
|
1961
|
+
Te(), qe(), d();
|
|
1962
|
+
}), (C, M) => (u(), m("div", tn, [
|
|
1963
|
+
k("header", {
|
|
1964
1964
|
class: "layerboard-header",
|
|
1965
|
-
style:
|
|
1965
|
+
style: H(We.value)
|
|
1966
1966
|
}, [
|
|
1967
|
-
|
|
1967
|
+
M[1] || (M[1] = k("a", {
|
|
1968
1968
|
href: "https://www.phila.gov/",
|
|
1969
1969
|
class: "layerboard-logo layerboard-desktop-only"
|
|
1970
1970
|
}, [
|
|
1971
|
-
|
|
1971
|
+
k("img", {
|
|
1972
1972
|
src: "https://standards.phila.gov/img/logo/city-of-philadelphia-yellow-white.png",
|
|
1973
1973
|
alt: "City of Philadelphia"
|
|
1974
1974
|
})
|
|
1975
1975
|
], -1)),
|
|
1976
|
-
|
|
1977
|
-
|
|
1976
|
+
M[2] || (M[2] = k("span", { class: "layerboard-header-divider layerboard-desktop-only" }, null, -1)),
|
|
1977
|
+
k("button", {
|
|
1978
1978
|
class: "layerboard-hamburger layerboard-mobile-only",
|
|
1979
1979
|
onClick: Je,
|
|
1980
1980
|
"aria-label": "Toggle menu"
|
|
1981
1981
|
}, [
|
|
1982
|
-
|
|
1983
|
-
"icon-definition":
|
|
1982
|
+
X(O(ue), {
|
|
1983
|
+
"icon-definition": O(mo),
|
|
1984
1984
|
size: "medium",
|
|
1985
1985
|
decorative: ""
|
|
1986
1986
|
}, null, 8, ["icon-definition"])
|
|
1987
1987
|
]),
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
e.subtitle ? (
|
|
1988
|
+
le(C.$slots, "header", {}, () => [
|
|
1989
|
+
k("h1", null, W(e.title), 1),
|
|
1990
|
+
e.subtitle ? (u(), m("span", on, W(e.subtitle), 1)) : T("", !0)
|
|
1991
1991
|
], !0),
|
|
1992
|
-
|
|
1992
|
+
be.value ? (u(), m("div", {
|
|
1993
1993
|
key: 0,
|
|
1994
1994
|
class: "layerboard-mobile-menu",
|
|
1995
|
-
style:
|
|
1995
|
+
style: H({ backgroundColor: e.themeColor })
|
|
1996
1996
|
}, [
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
openModal:
|
|
2000
|
-
closeModal:
|
|
1997
|
+
k("div", nn, [
|
|
1998
|
+
le(C.$slots, "footer", {
|
|
1999
|
+
openModal: we,
|
|
2000
|
+
closeModal: re,
|
|
2001
2001
|
isModalOpen: te.value
|
|
2002
2002
|
}, () => [
|
|
2003
|
-
|
|
2003
|
+
M[0] || (M[0] = fe(" City of Philadelphia ", -1))
|
|
2004
2004
|
], !0)
|
|
2005
2005
|
]),
|
|
2006
|
-
|
|
2006
|
+
k("button", {
|
|
2007
2007
|
class: "layerboard-mobile-menu-close",
|
|
2008
2008
|
onClick: De,
|
|
2009
2009
|
"aria-label": "Close menu"
|
|
2010
2010
|
}, [
|
|
2011
|
-
|
|
2012
|
-
"icon-definition":
|
|
2011
|
+
X(O(ue), {
|
|
2012
|
+
"icon-definition": O(mt),
|
|
2013
2013
|
size: "medium",
|
|
2014
2014
|
decorative: ""
|
|
2015
2015
|
}, null, 8, ["icon-definition"])
|
|
2016
2016
|
])
|
|
2017
|
-
], 4)) :
|
|
2018
|
-
|
|
2017
|
+
], 4)) : T("", !0),
|
|
2018
|
+
be.value ? (u(), m("div", {
|
|
2019
2019
|
key: 1,
|
|
2020
2020
|
class: "layerboard-mobile-menu-backdrop",
|
|
2021
2021
|
onClick: De
|
|
2022
|
-
})) :
|
|
2022
|
+
})) : T("", !0)
|
|
2023
2023
|
], 4),
|
|
2024
|
-
|
|
2025
|
-
c.value ? (
|
|
2026
|
-
|
|
2024
|
+
k("div", an, [
|
|
2025
|
+
c.value ? (u(), m("div", ln, [
|
|
2026
|
+
k("div", {
|
|
2027
2027
|
class: "layerboard-spinner",
|
|
2028
|
-
style:
|
|
2028
|
+
style: H({ borderTopColor: e.themeColor })
|
|
2029
2029
|
}, null, 4),
|
|
2030
|
-
|
|
2031
|
-
])) :
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2030
|
+
k("p", null, "Loading " + W(e.title) + "...", 1)
|
|
2031
|
+
])) : v.value ? (u(), m("div", rn, [
|
|
2032
|
+
M[3] || (M[3] = k("h2", null, "Error Loading Layers", -1)),
|
|
2033
|
+
k("p", null, W(v.value), 1),
|
|
2034
|
+
k("button", {
|
|
2035
2035
|
class: "layerboard-retry-button",
|
|
2036
|
-
style:
|
|
2036
|
+
style: H({ backgroundColor: e.themeColor }),
|
|
2037
2037
|
onClick: Te
|
|
2038
2038
|
}, " Retry ", 4)
|
|
2039
|
-
])) : (
|
|
2040
|
-
|
|
2041
|
-
class: ne(["layerboard-sidebar", { "is-active":
|
|
2042
|
-
style:
|
|
2039
|
+
])) : (u(), m(oe, { key: 2 }, [
|
|
2040
|
+
k("aside", {
|
|
2041
|
+
class: ne(["layerboard-sidebar", { "is-active": Q.value === "sidebar" }]),
|
|
2042
|
+
style: H(Ie.value)
|
|
2043
2043
|
}, [
|
|
2044
|
-
|
|
2044
|
+
le(C.$slots, "sidebar", {
|
|
2045
2045
|
layers: l.value,
|
|
2046
|
-
visibleLayers:
|
|
2047
|
-
layerOpacities:
|
|
2048
|
-
loadingLayers:
|
|
2049
|
-
layerErrors:
|
|
2050
|
-
currentZoom:
|
|
2046
|
+
visibleLayers: w.value,
|
|
2047
|
+
layerOpacities: L.value,
|
|
2048
|
+
loadingLayers: r.value,
|
|
2049
|
+
layerErrors: h.value,
|
|
2050
|
+
currentZoom: y.value,
|
|
2051
2051
|
toggleLayer: Ce,
|
|
2052
|
-
setLayerVisible:
|
|
2052
|
+
setLayerVisible: pe,
|
|
2053
2053
|
setLayersVisible: ke,
|
|
2054
|
-
setOpacity:
|
|
2054
|
+
setOpacity: ye,
|
|
2055
2055
|
tiledLayers: e.tiledLayers,
|
|
2056
|
-
visibleTiledLayers:
|
|
2057
|
-
tiledLayerOpacities:
|
|
2058
|
-
toggleTiledLayer:
|
|
2056
|
+
visibleTiledLayers: g.value,
|
|
2057
|
+
tiledLayerOpacities: p.value,
|
|
2058
|
+
toggleTiledLayer: S,
|
|
2059
2059
|
setTiledLayerVisible: E,
|
|
2060
|
-
setTiledLayerOpacity:
|
|
2060
|
+
setTiledLayerOpacity: F,
|
|
2061
2061
|
dataSourcesState: q.value,
|
|
2062
2062
|
dataSourcesLoading: ce.value,
|
|
2063
2063
|
getDataSource: Le,
|
|
2064
2064
|
refetchDataSource: Se
|
|
2065
2065
|
}, () => [
|
|
2066
|
-
e.showDefaultSidebar ? (
|
|
2066
|
+
e.showDefaultSidebar ? (u(), ee(Do, {
|
|
2067
2067
|
key: 0,
|
|
2068
2068
|
"layer-list": l.value,
|
|
2069
|
-
"visible-layers":
|
|
2070
|
-
"layer-opacities":
|
|
2071
|
-
"loading-layers":
|
|
2072
|
-
"layer-errors":
|
|
2073
|
-
"current-zoom":
|
|
2074
|
-
"search-query":
|
|
2075
|
-
"layer-metadata":
|
|
2069
|
+
"visible-layers": w.value,
|
|
2070
|
+
"layer-opacities": L.value,
|
|
2071
|
+
"loading-layers": r.value,
|
|
2072
|
+
"layer-errors": h.value,
|
|
2073
|
+
"current-zoom": y.value,
|
|
2074
|
+
"search-query": P.value,
|
|
2075
|
+
"layer-metadata": b.value,
|
|
2076
2076
|
onToggleLayer: Ce,
|
|
2077
|
-
onSetOpacity:
|
|
2078
|
-
onUpdateSearch:
|
|
2079
|
-
}, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) :
|
|
2077
|
+
onSetOpacity: ye,
|
|
2078
|
+
onUpdateSearch: ge
|
|
2079
|
+
}, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : T("", !0)
|
|
2080
2080
|
], !0)
|
|
2081
2081
|
], 6),
|
|
2082
|
-
|
|
2083
|
-
class: ne(["layerboard-map", { "is-active":
|
|
2082
|
+
k("div", {
|
|
2083
|
+
class: ne(["layerboard-map", { "is-active": Q.value === "map" }])
|
|
2084
2084
|
}, [
|
|
2085
|
-
|
|
2086
|
-
"visible-layers":
|
|
2087
|
-
"layer-opacities":
|
|
2085
|
+
X(Xt, {
|
|
2086
|
+
"visible-layers": w.value,
|
|
2087
|
+
"layer-opacities": L.value,
|
|
2088
2088
|
"layer-list": l.value,
|
|
2089
2089
|
"tiled-layers": e.tiledLayers,
|
|
2090
|
-
"visible-tiled-layers":
|
|
2091
|
-
"tiled-layer-opacities":
|
|
2090
|
+
"visible-tiled-layers": g.value,
|
|
2091
|
+
"tiled-layer-opacities": p.value,
|
|
2092
2092
|
"cyclomedia-config": e.cyclomediaConfig,
|
|
2093
2093
|
"pictometry-credentials": e.pictometryCredentials,
|
|
2094
2094
|
"basemap-control-position": e.basemapControlPosition,
|
|
@@ -2102,68 +2102,68 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2102
2102
|
"initial-center": e.initialCenter,
|
|
2103
2103
|
onZoom: Ge,
|
|
2104
2104
|
onLayerLoading: He,
|
|
2105
|
-
onLayerError:
|
|
2105
|
+
onLayerError: ie
|
|
2106
2106
|
}, null, 8, ["visible-layers", "layer-opacities", "layer-list", "tiled-layers", "visible-tiled-layers", "tiled-layer-opacities", "cyclomedia-config", "pictometry-credentials", "basemap-control-position", "navigation-control-position", "geolocation-control-position", "search-control-position", "draw-control-position", "cyclomedia-button-position", "pictometry-button-position", "initial-zoom", "initial-center"])
|
|
2107
2107
|
], 2),
|
|
2108
|
-
|
|
2109
|
-
class: ne(["layerboard-sidebar-toggle", { "is-collapsed":
|
|
2110
|
-
style:
|
|
2108
|
+
k("button", {
|
|
2109
|
+
class: ne(["layerboard-sidebar-toggle", { "is-collapsed": he.value }]),
|
|
2110
|
+
style: H({ left: he.value ? "0" : o.sidebarWidth }),
|
|
2111
2111
|
onClick: xe,
|
|
2112
2112
|
"aria-label": "Toggle sidebar"
|
|
2113
2113
|
}, [
|
|
2114
|
-
|
|
2115
|
-
"icon-definition":
|
|
2114
|
+
X(O(ue), {
|
|
2115
|
+
"icon-definition": he.value ? O(go) : O(ho),
|
|
2116
2116
|
size: "medium",
|
|
2117
2117
|
decorative: ""
|
|
2118
2118
|
}, null, 8, ["icon-definition"])
|
|
2119
2119
|
], 6)
|
|
2120
2120
|
], 64))
|
|
2121
2121
|
]),
|
|
2122
|
-
|
|
2122
|
+
k("button", {
|
|
2123
2123
|
class: "layerboard-mobile-toggle",
|
|
2124
|
-
style:
|
|
2124
|
+
style: H(Fe.value),
|
|
2125
2125
|
onClick: $e
|
|
2126
2126
|
}, [
|
|
2127
|
-
|
|
2127
|
+
Q.value === "map" ? (u(), m("span", sn, W(e.sidebarLabel), 1)) : (u(), m("span", cn, W(e.mapLabel), 1))
|
|
2128
2128
|
], 4),
|
|
2129
|
-
|
|
2129
|
+
k("footer", {
|
|
2130
2130
|
class: "layerboard-footer",
|
|
2131
|
-
style:
|
|
2131
|
+
style: H(je.value)
|
|
2132
2132
|
}, [
|
|
2133
|
-
|
|
2134
|
-
openModal:
|
|
2135
|
-
closeModal:
|
|
2133
|
+
le(C.$slots, "footer", {
|
|
2134
|
+
openModal: we,
|
|
2135
|
+
closeModal: re,
|
|
2136
2136
|
isModalOpen: te.value
|
|
2137
2137
|
}, () => [
|
|
2138
|
-
|
|
2138
|
+
M[4] || (M[4] = fe(" City of Philadelphia ", -1))
|
|
2139
2139
|
], !0)
|
|
2140
2140
|
], 4),
|
|
2141
|
-
te.value ? (
|
|
2141
|
+
te.value ? (u(), m("div", {
|
|
2142
2142
|
key: 0,
|
|
2143
2143
|
class: "layerboard-modal-backdrop",
|
|
2144
2144
|
onClick: Ze
|
|
2145
2145
|
}, [
|
|
2146
|
-
|
|
2147
|
-
|
|
2146
|
+
k("div", un, [
|
|
2147
|
+
k("button", {
|
|
2148
2148
|
class: "layerboard-modal-close",
|
|
2149
|
-
onClick:
|
|
2149
|
+
onClick: re,
|
|
2150
2150
|
"aria-label": "Close modal"
|
|
2151
2151
|
}, [
|
|
2152
|
-
|
|
2153
|
-
"icon-definition":
|
|
2152
|
+
X(O(ue), {
|
|
2153
|
+
"icon-definition": O(mt),
|
|
2154
2154
|
size: "medium",
|
|
2155
2155
|
decorative: ""
|
|
2156
2156
|
}, null, 8, ["icon-definition"])
|
|
2157
2157
|
]),
|
|
2158
|
-
|
|
2158
|
+
le(C.$slots, "modal", { closeModal: re }, void 0, !0)
|
|
2159
2159
|
])
|
|
2160
|
-
])) :
|
|
2160
|
+
])) : T("", !0)
|
|
2161
2161
|
]));
|
|
2162
2162
|
}
|
|
2163
|
-
}),
|
|
2163
|
+
}), Yn = /* @__PURE__ */ ze(dn, [["__scopeId", "data-v-dac16679"]]), fn = ["aria-expanded"], pn = {
|
|
2164
2164
|
key: 0,
|
|
2165
2165
|
class: "topic-icon"
|
|
2166
|
-
}, yn = { class: "topic-title" }, gn = { class: "topic-content" }, hn = /* @__PURE__ */
|
|
2166
|
+
}, yn = { class: "topic-title" }, gn = { class: "topic-content" }, hn = /* @__PURE__ */ ve({
|
|
2167
2167
|
__name: "TopicAccordion",
|
|
2168
2168
|
props: {
|
|
2169
2169
|
title: {},
|
|
@@ -2174,7 +2174,7 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2174
2174
|
},
|
|
2175
2175
|
emits: ["toggle", "layerChange"],
|
|
2176
2176
|
setup(e, { emit: n }) {
|
|
2177
|
-
const t = e, o = n, a =
|
|
2177
|
+
const t = e, o = n, a = $(t.expanded);
|
|
2178
2178
|
Pe(
|
|
2179
2179
|
() => t.expanded,
|
|
2180
2180
|
(c) => {
|
|
@@ -2184,30 +2184,30 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2184
2184
|
function l() {
|
|
2185
2185
|
a.value = !a.value, o("toggle", a.value);
|
|
2186
2186
|
}
|
|
2187
|
-
return (c,
|
|
2188
|
-
const
|
|
2189
|
-
return
|
|
2187
|
+
return (c, v) => {
|
|
2188
|
+
const y = Et("font-awesome-icon");
|
|
2189
|
+
return u(), m("div", {
|
|
2190
2190
|
class: ne(["topic-accordion", { "is-expanded": a.value }])
|
|
2191
2191
|
}, [
|
|
2192
|
-
|
|
2192
|
+
k("button", {
|
|
2193
2193
|
class: ne(["topic-header", e.headerClass]),
|
|
2194
2194
|
type: "button",
|
|
2195
2195
|
"aria-expanded": a.value,
|
|
2196
2196
|
onClick: l
|
|
2197
2197
|
}, [
|
|
2198
|
-
e.icon || c.$slots.icon ? (
|
|
2199
|
-
|
|
2200
|
-
e.icon ? (
|
|
2198
|
+
e.icon || c.$slots.icon ? (u(), m("span", pn, [
|
|
2199
|
+
le(c.$slots, "icon", {}, () => [
|
|
2200
|
+
e.icon ? (u(), ee(y, {
|
|
2201
2201
|
key: 0,
|
|
2202
2202
|
icon: ["fas", e.icon]
|
|
2203
|
-
}, null, 8, ["icon"])) :
|
|
2203
|
+
}, null, 8, ["icon"])) : T("", !0)
|
|
2204
2204
|
], !0)
|
|
2205
|
-
])) :
|
|
2206
|
-
|
|
2207
|
-
|
|
2205
|
+
])) : T("", !0),
|
|
2206
|
+
k("span", yn, W(e.title), 1),
|
|
2207
|
+
k("span", {
|
|
2208
2208
|
class: ne(["topic-chevron", { "is-rotated": a.value }])
|
|
2209
|
-
}, [...
|
|
2210
|
-
|
|
2209
|
+
}, [...v[0] || (v[0] = [
|
|
2210
|
+
k("svg", {
|
|
2211
2211
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2212
2212
|
width: "20",
|
|
2213
2213
|
height: "20",
|
|
@@ -2218,13 +2218,13 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2218
2218
|
"stroke-linecap": "round",
|
|
2219
2219
|
"stroke-linejoin": "round"
|
|
2220
2220
|
}, [
|
|
2221
|
-
|
|
2221
|
+
k("polyline", { points: "6 9 12 15 18 9" })
|
|
2222
2222
|
], -1)
|
|
2223
2223
|
])], 2)
|
|
2224
2224
|
], 10, fn),
|
|
2225
|
-
St(
|
|
2226
|
-
|
|
2227
|
-
|
|
2225
|
+
St(k("div", gn, [
|
|
2226
|
+
le(c.$slots, "default", {}, () => [
|
|
2227
|
+
v[1] || (v[1] = k("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
|
|
2228
2228
|
], !0)
|
|
2229
2229
|
], 512), [
|
|
2230
2230
|
[Ot, a.value]
|
|
@@ -2232,7 +2232,7 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2232
2232
|
], 2);
|
|
2233
2233
|
};
|
|
2234
2234
|
}
|
|
2235
|
-
}),
|
|
2235
|
+
}), ei = /* @__PURE__ */ ze(hn, [["__scopeId", "data-v-fb48c75b"]]), mn = { class: "layer-checkbox-set" }, vn = ["checked", "disabled", "onChange"], bn = { class: "layer-title" }, wn = {
|
|
2236
2236
|
key: 0,
|
|
2237
2237
|
class: "loading-indicator"
|
|
2238
2238
|
}, Ln = ["title"], Sn = {
|
|
@@ -2247,13 +2247,13 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2247
2247
|
}, Pn = {
|
|
2248
2248
|
key: 2,
|
|
2249
2249
|
class: "opacity-control"
|
|
2250
|
-
},
|
|
2250
|
+
}, _n = { class: "opacity-label" }, Mn = ["value", "onInput"], zn = {
|
|
2251
2251
|
key: 3,
|
|
2252
2252
|
class: "layer-legend"
|
|
2253
|
-
},
|
|
2253
|
+
}, Fn = { class: "legend-label" }, Tn = {
|
|
2254
2254
|
key: 0,
|
|
2255
2255
|
class: "empty-state"
|
|
2256
|
-
},
|
|
2256
|
+
}, En = /* @__PURE__ */ ve({
|
|
2257
2257
|
__name: "LayerCheckboxSet",
|
|
2258
2258
|
props: {
|
|
2259
2259
|
layers: {},
|
|
@@ -2268,221 +2268,354 @@ const tn = { class: "layerboard-layout" }, on = {
|
|
|
2268
2268
|
emits: ["toggleLayer", "setOpacity"],
|
|
2269
2269
|
setup(e, { emit: n }) {
|
|
2270
2270
|
const t = e, o = n;
|
|
2271
|
-
function a(
|
|
2272
|
-
return t.visibleLayerIds.has(
|
|
2271
|
+
function a(g) {
|
|
2272
|
+
return t.visibleLayerIds.has(g);
|
|
2273
2273
|
}
|
|
2274
|
-
function l(
|
|
2275
|
-
return t.layerOpacities[
|
|
2274
|
+
function l(g) {
|
|
2275
|
+
return t.layerOpacities[g] ?? 1;
|
|
2276
2276
|
}
|
|
2277
|
-
function c(
|
|
2278
|
-
return t.loadingLayerIds.has(
|
|
2277
|
+
function c(g) {
|
|
2278
|
+
return t.loadingLayerIds.has(g);
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2281
|
-
return t.layerErrors[
|
|
2280
|
+
function v(g) {
|
|
2281
|
+
return t.layerErrors[g] || null;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const
|
|
2285
|
-
return !(
|
|
2283
|
+
function y(g) {
|
|
2284
|
+
const p = t.currentZoom, d = g.minZoom, S = g.maxZoom;
|
|
2285
|
+
return !(d !== void 0 && p < d || S !== void 0 && p > S);
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return
|
|
2287
|
+
function P(g) {
|
|
2288
|
+
return g.displayOptions?.shouldShowCheckbox !== !1;
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2291
|
-
return t.showOpacity ?
|
|
2290
|
+
function w(g) {
|
|
2291
|
+
return t.showOpacity ? g.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2294
|
-
return t.showLegend ?
|
|
2293
|
+
function L(g) {
|
|
2294
|
+
return t.showLegend ? g.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
2295
2295
|
}
|
|
2296
|
-
function
|
|
2297
|
-
return
|
|
2296
|
+
function r(g) {
|
|
2297
|
+
return g.displayOptions?.layerNameChange || g.title;
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2300
|
-
o("toggleLayer",
|
|
2299
|
+
function h(g) {
|
|
2300
|
+
o("toggleLayer", g);
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2303
|
-
const
|
|
2304
|
-
o("setOpacity",
|
|
2302
|
+
function b(g, p) {
|
|
2303
|
+
const d = p.target;
|
|
2304
|
+
o("setOpacity", g, parseFloat(d.value));
|
|
2305
2305
|
}
|
|
2306
|
-
return (
|
|
2307
|
-
(
|
|
2308
|
-
key:
|
|
2306
|
+
return (g, p) => (u(), m("div", mn, [
|
|
2307
|
+
(u(!0), m(oe, null, ae(e.layers, (d) => (u(), m("div", {
|
|
2308
|
+
key: d.id,
|
|
2309
2309
|
class: "layer-item"
|
|
2310
2310
|
}, [
|
|
2311
|
-
|
|
2311
|
+
P(d) ? (u(), m("label", {
|
|
2312
2312
|
key: 0,
|
|
2313
2313
|
class: ne(["layer-checkbox", {
|
|
2314
|
-
"layer-unavailable": !
|
|
2315
|
-
"layer-error":
|
|
2314
|
+
"layer-unavailable": !y(d),
|
|
2315
|
+
"layer-error": v(d.id)
|
|
2316
2316
|
}])
|
|
2317
2317
|
}, [
|
|
2318
|
-
|
|
2318
|
+
k("input", {
|
|
2319
2319
|
type: "checkbox",
|
|
2320
|
-
checked: a(
|
|
2321
|
-
disabled: !
|
|
2322
|
-
onChange: (
|
|
2320
|
+
checked: a(d.id),
|
|
2321
|
+
disabled: !y(d),
|
|
2322
|
+
onChange: (S) => h(d.id)
|
|
2323
2323
|
}, null, 40, vn),
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
c(
|
|
2327
|
-
|
|
2324
|
+
k("span", bn, [
|
|
2325
|
+
fe(W(r(d)) + " ", 1),
|
|
2326
|
+
c(d.id) ? (u(), m("span", wn, " Loading... ")) : T("", !0),
|
|
2327
|
+
v(d.id) ? (u(), m("span", {
|
|
2328
2328
|
key: 1,
|
|
2329
2329
|
class: "error-indicator",
|
|
2330
|
-
title:
|
|
2331
|
-
}, " Error ", 8, Ln)) :
|
|
2332
|
-
|
|
2330
|
+
title: v(d.id) || ""
|
|
2331
|
+
}, " Error ", 8, Ln)) : T("", !0),
|
|
2332
|
+
y(d) ? T("", !0) : (u(), m("span", Sn, " (zoom in) "))
|
|
2333
2333
|
])
|
|
2334
|
-
], 2)) : (
|
|
2334
|
+
], 2)) : (u(), m("div", {
|
|
2335
2335
|
key: 1,
|
|
2336
2336
|
class: ne(["layer-label-only", {
|
|
2337
|
-
"layer-unavailable": !
|
|
2338
|
-
"layer-error":
|
|
2337
|
+
"layer-unavailable": !y(d),
|
|
2338
|
+
"layer-error": v(d.id)
|
|
2339
2339
|
}])
|
|
2340
2340
|
}, [
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
c(
|
|
2344
|
-
|
|
2341
|
+
k("span", Cn, [
|
|
2342
|
+
fe(W(r(d)) + " ", 1),
|
|
2343
|
+
c(d.id) ? (u(), m("span", kn, " Loading... ")) : T("", !0),
|
|
2344
|
+
v(d.id) ? (u(), m("span", {
|
|
2345
2345
|
key: 1,
|
|
2346
2346
|
class: "error-indicator",
|
|
2347
|
-
title:
|
|
2348
|
-
}, " Error ", 8, $n)) :
|
|
2349
|
-
|
|
2347
|
+
title: v(d.id) || ""
|
|
2348
|
+
}, " Error ", 8, $n)) : T("", !0),
|
|
2349
|
+
y(d) ? T("", !0) : (u(), m("span", xn, " (zoom in) "))
|
|
2350
2350
|
])
|
|
2351
2351
|
], 2)),
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2352
|
+
w(d) && a(d.id) ? (u(), m("div", Pn, [
|
|
2353
|
+
k("label", _n, " Opacity: " + W(Math.round(l(d.id) * 100)) + "% ", 1),
|
|
2354
|
+
k("input", {
|
|
2355
2355
|
type: "range",
|
|
2356
2356
|
min: "0",
|
|
2357
2357
|
max: "1",
|
|
2358
2358
|
step: "0.05",
|
|
2359
|
-
value: l(
|
|
2359
|
+
value: l(d.id),
|
|
2360
2360
|
class: "opacity-slider",
|
|
2361
|
-
onInput: (
|
|
2362
|
-
}, null, 40,
|
|
2363
|
-
])) :
|
|
2364
|
-
|
|
2365
|
-
(
|
|
2361
|
+
onInput: (S) => b(d.id, S)
|
|
2362
|
+
}, null, 40, Mn)
|
|
2363
|
+
])) : T("", !0),
|
|
2364
|
+
L(d) && a(d.id) && d.legend?.length ? (u(), m("ul", zn, [
|
|
2365
|
+
(u(!0), m(oe, null, ae(d.legend, (S, E) => (u(), m("li", {
|
|
2366
2366
|
key: E,
|
|
2367
2367
|
class: "legend-item"
|
|
2368
2368
|
}, [
|
|
2369
|
-
|
|
2369
|
+
S.type === "circle" ? (u(), m("span", {
|
|
2370
2370
|
key: 0,
|
|
2371
2371
|
class: "legend-symbol legend-circle",
|
|
2372
|
-
style:
|
|
2373
|
-
}, null, 4)) :
|
|
2372
|
+
style: H({ backgroundColor: S.color })
|
|
2373
|
+
}, null, 4)) : S.type === "line" ? (u(), m("span", {
|
|
2374
2374
|
key: 1,
|
|
2375
2375
|
class: "legend-symbol legend-line",
|
|
2376
|
-
style:
|
|
2377
|
-
backgroundColor:
|
|
2378
|
-
height: `${
|
|
2376
|
+
style: H({
|
|
2377
|
+
backgroundColor: S.color,
|
|
2378
|
+
height: `${S.width || 2}px`
|
|
2379
2379
|
})
|
|
2380
|
-
}, null, 4)) :
|
|
2380
|
+
}, null, 4)) : S.type === "fill" ? (u(), m("span", {
|
|
2381
2381
|
key: 2,
|
|
2382
2382
|
class: "legend-symbol legend-fill",
|
|
2383
|
-
style:
|
|
2384
|
-
}, null, 4)) :
|
|
2385
|
-
|
|
2383
|
+
style: H({ backgroundColor: S.color })
|
|
2384
|
+
}, null, 4)) : T("", !0),
|
|
2385
|
+
k("span", Fn, W(S.label), 1)
|
|
2386
2386
|
]))), 128))
|
|
2387
|
-
])) :
|
|
2387
|
+
])) : T("", !0)
|
|
2388
2388
|
]))), 128)),
|
|
2389
|
-
e.layers.length === 0 ? (
|
|
2389
|
+
e.layers.length === 0 ? (u(), m("div", Tn, " No layers available ")) : T("", !0)
|
|
2390
2390
|
]));
|
|
2391
2391
|
}
|
|
2392
|
-
}),
|
|
2393
|
-
|
|
2394
|
-
|
|
2392
|
+
}), ti = /* @__PURE__ */ ze(En, [["__scopeId", "data-v-cc5e50fd"]]), On = { class: "layer-radio-set" }, In = ["name", "checked", "disabled", "onChange"], Rn = { class: "layer-title" }, Dn = {
|
|
2393
|
+
key: 0,
|
|
2394
|
+
class: "loading-indicator"
|
|
2395
|
+
}, Zn = ["title"], Bn = {
|
|
2396
|
+
key: 2,
|
|
2397
|
+
class: "zoom-indicator"
|
|
2398
|
+
}, Nn = {
|
|
2399
|
+
key: 0,
|
|
2400
|
+
class: "opacity-control"
|
|
2401
|
+
}, An = { class: "opacity-label" }, Vn = ["value", "onInput"], Un = {
|
|
2402
|
+
key: 1,
|
|
2403
|
+
class: "layer-legend"
|
|
2404
|
+
}, Wn = { class: "legend-label" }, jn = {
|
|
2405
|
+
key: 0,
|
|
2406
|
+
class: "empty-state"
|
|
2407
|
+
}, qn = /* @__PURE__ */ ve({
|
|
2408
|
+
__name: "LayerRadioButtonSet",
|
|
2409
|
+
props: {
|
|
2410
|
+
layers: {},
|
|
2411
|
+
visibleLayerIds: {},
|
|
2412
|
+
layerOpacities: { default: () => ({}) },
|
|
2413
|
+
loadingLayerIds: { default: () => /* @__PURE__ */ new Set() },
|
|
2414
|
+
layerErrors: { default: () => ({}) },
|
|
2415
|
+
currentZoom: { default: 12 },
|
|
2416
|
+
showOpacity: { type: Boolean, default: !0 },
|
|
2417
|
+
showLegend: { type: Boolean, default: !0 },
|
|
2418
|
+
groupName: { default: "layer-radio-group" }
|
|
2419
|
+
},
|
|
2420
|
+
emits: ["selectLayer", "setOpacity"],
|
|
2421
|
+
setup(e, { emit: n }) {
|
|
2422
|
+
const t = e, o = n;
|
|
2423
|
+
function a(b) {
|
|
2424
|
+
return t.visibleLayerIds.has(b);
|
|
2425
|
+
}
|
|
2426
|
+
function l(b) {
|
|
2427
|
+
return t.layerOpacities[b] ?? 1;
|
|
2428
|
+
}
|
|
2429
|
+
function c(b) {
|
|
2430
|
+
return t.loadingLayerIds.has(b);
|
|
2431
|
+
}
|
|
2432
|
+
function v(b) {
|
|
2433
|
+
return t.layerErrors[b] || null;
|
|
2434
|
+
}
|
|
2435
|
+
function y(b) {
|
|
2436
|
+
const g = t.currentZoom, p = b.minZoom, d = b.maxZoom;
|
|
2437
|
+
return !(p !== void 0 && g < p || d !== void 0 && g > d);
|
|
2438
|
+
}
|
|
2439
|
+
function P(b) {
|
|
2440
|
+
return t.showOpacity ? b.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
2441
|
+
}
|
|
2442
|
+
function w(b) {
|
|
2443
|
+
return t.showLegend ? b.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
2444
|
+
}
|
|
2445
|
+
function L(b) {
|
|
2446
|
+
return b.displayOptions?.layerNameChange || b.title;
|
|
2447
|
+
}
|
|
2448
|
+
function r(b) {
|
|
2449
|
+
const g = t.layers.filter((p) => t.visibleLayerIds.has(p.id) && p.id !== b).map((p) => p.id);
|
|
2450
|
+
o("selectLayer", b, g);
|
|
2451
|
+
}
|
|
2452
|
+
function h(b, g) {
|
|
2453
|
+
const p = g.target;
|
|
2454
|
+
o("setOpacity", b, parseFloat(p.value));
|
|
2455
|
+
}
|
|
2456
|
+
return (b, g) => (u(), m("div", On, [
|
|
2457
|
+
(u(!0), m(oe, null, ae(e.layers, (p) => (u(), m("div", {
|
|
2458
|
+
key: p.id,
|
|
2459
|
+
class: "layer-item"
|
|
2460
|
+
}, [
|
|
2461
|
+
k("label", {
|
|
2462
|
+
class: ne(["layer-radio", {
|
|
2463
|
+
"layer-unavailable": !y(p),
|
|
2464
|
+
"layer-error": v(p.id)
|
|
2465
|
+
}])
|
|
2466
|
+
}, [
|
|
2467
|
+
k("input", {
|
|
2468
|
+
type: "radio",
|
|
2469
|
+
name: e.groupName,
|
|
2470
|
+
checked: a(p.id),
|
|
2471
|
+
disabled: !y(p),
|
|
2472
|
+
onChange: (d) => r(p.id)
|
|
2473
|
+
}, null, 40, In),
|
|
2474
|
+
k("span", Rn, [
|
|
2475
|
+
fe(W(L(p)) + " ", 1),
|
|
2476
|
+
c(p.id) ? (u(), m("span", Dn, " Loading... ")) : T("", !0),
|
|
2477
|
+
v(p.id) ? (u(), m("span", {
|
|
2478
|
+
key: 1,
|
|
2479
|
+
class: "error-indicator",
|
|
2480
|
+
title: v(p.id) || ""
|
|
2481
|
+
}, " Error ", 8, Zn)) : T("", !0),
|
|
2482
|
+
y(p) ? T("", !0) : (u(), m("span", Bn, " (zoom in) "))
|
|
2483
|
+
])
|
|
2484
|
+
], 2),
|
|
2485
|
+
P(p) && a(p.id) ? (u(), m("div", Nn, [
|
|
2486
|
+
k("label", An, " Opacity: " + W(Math.round(l(p.id) * 100)) + "% ", 1),
|
|
2487
|
+
k("input", {
|
|
2488
|
+
type: "range",
|
|
2489
|
+
min: "0",
|
|
2490
|
+
max: "1",
|
|
2491
|
+
step: "0.05",
|
|
2492
|
+
value: l(p.id),
|
|
2493
|
+
class: "opacity-slider",
|
|
2494
|
+
onInput: (d) => h(p.id, d)
|
|
2495
|
+
}, null, 40, Vn)
|
|
2496
|
+
])) : T("", !0),
|
|
2497
|
+
w(p) && a(p.id) && p.legend?.length ? (u(), m("ul", Un, [
|
|
2498
|
+
(u(!0), m(oe, null, ae(p.legend, (d, S) => (u(), m("li", {
|
|
2499
|
+
key: S,
|
|
2500
|
+
class: "legend-item"
|
|
2501
|
+
}, [
|
|
2502
|
+
d.type === "circle" ? (u(), m("span", {
|
|
2503
|
+
key: 0,
|
|
2504
|
+
class: "legend-symbol legend-circle",
|
|
2505
|
+
style: H({ backgroundColor: d.color })
|
|
2506
|
+
}, null, 4)) : d.type === "line" ? (u(), m("span", {
|
|
2507
|
+
key: 1,
|
|
2508
|
+
class: "legend-symbol legend-line",
|
|
2509
|
+
style: H({
|
|
2510
|
+
backgroundColor: d.color,
|
|
2511
|
+
height: `${d.width || 2}px`
|
|
2512
|
+
})
|
|
2513
|
+
}, null, 4)) : d.type === "fill" ? (u(), m("span", {
|
|
2514
|
+
key: 2,
|
|
2515
|
+
class: "legend-symbol legend-fill",
|
|
2516
|
+
style: H({ backgroundColor: d.color })
|
|
2517
|
+
}, null, 4)) : T("", !0),
|
|
2518
|
+
k("span", Wn, W(d.label), 1)
|
|
2519
|
+
]))), 128))
|
|
2520
|
+
])) : T("", !0)
|
|
2521
|
+
]))), 128)),
|
|
2522
|
+
e.layers.length === 0 ? (u(), m("div", jn, " No layers available ")) : T("", !0)
|
|
2523
|
+
]));
|
|
2524
|
+
}
|
|
2525
|
+
}), oi = /* @__PURE__ */ ze(qn, [["__scopeId", "data-v-c0e5f6f1"]]);
|
|
2526
|
+
function ni(e) {
|
|
2527
|
+
const n = $([]), t = $(/* @__PURE__ */ new Set()), o = $({}), a = $(/* @__PURE__ */ new Set()), l = $({}), c = $(""), v = $(!1), y = $(!1), P = $(null), w = I(() => {
|
|
2395
2528
|
if (!c.value.trim())
|
|
2396
2529
|
return n.value;
|
|
2397
|
-
const
|
|
2530
|
+
const F = c.value.toLowerCase();
|
|
2398
2531
|
return n.value.filter(
|
|
2399
|
-
(B) => B.title.toLowerCase().includes(
|
|
2532
|
+
(B) => B.title.toLowerCase().includes(F)
|
|
2400
2533
|
);
|
|
2401
|
-
}),
|
|
2402
|
-
config:
|
|
2403
|
-
component:
|
|
2534
|
+
}), L = I(() => n.value.map((F) => ({
|
|
2535
|
+
config: F,
|
|
2536
|
+
component: F.type
|
|
2404
2537
|
// "circle", "fill", or "line"
|
|
2405
2538
|
})));
|
|
2406
|
-
async function
|
|
2407
|
-
if (!
|
|
2408
|
-
|
|
2539
|
+
async function r() {
|
|
2540
|
+
if (!y.value) {
|
|
2541
|
+
v.value = !0, P.value = null;
|
|
2409
2542
|
try {
|
|
2410
|
-
let
|
|
2411
|
-
e.mode === "dynamic" || !e.mode ? e.webMapId ?
|
|
2543
|
+
let F;
|
|
2544
|
+
e.mode === "dynamic" || !e.mode ? e.webMapId ? F = await h(e.webMapId) : F = await it() : F = await it(), n.value = F;
|
|
2412
2545
|
const B = {};
|
|
2413
|
-
|
|
2546
|
+
F.forEach((q) => {
|
|
2414
2547
|
B[q.id] = q.opacity ?? 1;
|
|
2415
|
-
}), o.value = B,
|
|
2416
|
-
} catch (
|
|
2417
|
-
|
|
2548
|
+
}), o.value = B, y.value = !0;
|
|
2549
|
+
} catch (F) {
|
|
2550
|
+
P.value = F instanceof Error ? F : new Error("Failed to initialize layerboard");
|
|
2418
2551
|
} finally {
|
|
2419
|
-
|
|
2552
|
+
v.value = !1;
|
|
2420
2553
|
}
|
|
2421
2554
|
}
|
|
2422
2555
|
}
|
|
2423
|
-
async function
|
|
2424
|
-
const B = lt(
|
|
2556
|
+
async function h(F) {
|
|
2557
|
+
const B = lt(F), q = await fetch(B);
|
|
2425
2558
|
if (!q.ok)
|
|
2426
2559
|
throw new Error(`Failed to fetch WebMap: ${q.status} ${q.statusText}`);
|
|
2427
2560
|
const ce = await q.json();
|
|
2428
2561
|
return kt(ce);
|
|
2429
2562
|
}
|
|
2430
|
-
function
|
|
2563
|
+
function b(F) {
|
|
2431
2564
|
const B = new Set(t.value);
|
|
2432
|
-
B.has(
|
|
2565
|
+
B.has(F) ? B.delete(F) : B.add(F), t.value = B;
|
|
2433
2566
|
}
|
|
2434
|
-
function
|
|
2567
|
+
function g(F, B) {
|
|
2435
2568
|
o.value = {
|
|
2436
2569
|
...o.value,
|
|
2437
|
-
[
|
|
2570
|
+
[F]: Math.max(0, Math.min(1, B))
|
|
2438
2571
|
};
|
|
2439
2572
|
}
|
|
2440
|
-
function
|
|
2441
|
-
c.value =
|
|
2573
|
+
function p(F) {
|
|
2574
|
+
c.value = F;
|
|
2442
2575
|
}
|
|
2443
|
-
function
|
|
2576
|
+
function d(F, B) {
|
|
2444
2577
|
const q = new Set(a.value);
|
|
2445
|
-
B ? q.add(
|
|
2578
|
+
B ? q.add(F) : q.delete(F), a.value = q;
|
|
2446
2579
|
}
|
|
2447
|
-
function
|
|
2580
|
+
function S(F, B) {
|
|
2448
2581
|
if (B)
|
|
2449
|
-
l.value = { ...l.value, [
|
|
2582
|
+
l.value = { ...l.value, [F]: B };
|
|
2450
2583
|
else {
|
|
2451
|
-
const { [
|
|
2584
|
+
const { [F]: q, ...ce } = l.value;
|
|
2452
2585
|
l.value = ce;
|
|
2453
2586
|
}
|
|
2454
2587
|
}
|
|
2455
2588
|
function E() {
|
|
2456
|
-
n.value = [], t.value = /* @__PURE__ */ new Set(), o.value = {}, a.value = /* @__PURE__ */ new Set(), l.value = {}, c.value = "",
|
|
2589
|
+
n.value = [], t.value = /* @__PURE__ */ new Set(), o.value = {}, a.value = /* @__PURE__ */ new Set(), l.value = {}, c.value = "", v.value = !1, y.value = !1, P.value = null;
|
|
2457
2590
|
}
|
|
2458
2591
|
return {
|
|
2459
2592
|
// State (readonly)
|
|
2460
|
-
layerConfigs:
|
|
2461
|
-
visibleLayers:
|
|
2462
|
-
layerOpacities:
|
|
2463
|
-
loadingLayers:
|
|
2464
|
-
layerErrors:
|
|
2465
|
-
searchQuery:
|
|
2466
|
-
isLoading:
|
|
2467
|
-
isInitialized:
|
|
2468
|
-
error:
|
|
2593
|
+
layerConfigs: j(n),
|
|
2594
|
+
visibleLayers: j(t),
|
|
2595
|
+
layerOpacities: j(o),
|
|
2596
|
+
loadingLayers: j(a),
|
|
2597
|
+
layerErrors: j(l),
|
|
2598
|
+
searchQuery: j(c),
|
|
2599
|
+
isLoading: j(v),
|
|
2600
|
+
isInitialized: j(y),
|
|
2601
|
+
error: j(P),
|
|
2469
2602
|
// Computed
|
|
2470
|
-
filteredLayerConfigs:
|
|
2471
|
-
layerList:
|
|
2603
|
+
filteredLayerConfigs: w,
|
|
2604
|
+
layerList: L,
|
|
2472
2605
|
// Config
|
|
2473
2606
|
config: e,
|
|
2474
2607
|
// Methods
|
|
2475
|
-
initialize:
|
|
2476
|
-
toggleLayer:
|
|
2477
|
-
setLayerOpacity:
|
|
2478
|
-
filterLayers:
|
|
2479
|
-
setLayerLoading:
|
|
2480
|
-
setLayerError:
|
|
2608
|
+
initialize: r,
|
|
2609
|
+
toggleLayer: b,
|
|
2610
|
+
setLayerOpacity: g,
|
|
2611
|
+
filterLayers: p,
|
|
2612
|
+
setLayerLoading: d,
|
|
2613
|
+
setLayerError: S,
|
|
2481
2614
|
reset: E
|
|
2482
2615
|
};
|
|
2483
2616
|
}
|
|
2484
|
-
function
|
|
2485
|
-
const e =
|
|
2617
|
+
function ii() {
|
|
2618
|
+
const e = $([]), n = $(/* @__PURE__ */ new Set()), t = $(/* @__PURE__ */ new Set());
|
|
2486
2619
|
function o(l) {
|
|
2487
2620
|
n.value.has(l) ? n.value.delete(l) : n.value.add(l);
|
|
2488
2621
|
}
|
|
@@ -2497,40 +2630,40 @@ function Wn() {
|
|
|
2497
2630
|
setLayers: a
|
|
2498
2631
|
};
|
|
2499
2632
|
}
|
|
2500
|
-
function
|
|
2501
|
-
const n =
|
|
2502
|
-
async function l(
|
|
2633
|
+
function Gn(e) {
|
|
2634
|
+
const n = $(null), t = $(!1), o = $(null), a = $(0);
|
|
2635
|
+
async function l(y = {}) {
|
|
2503
2636
|
t.value = !0, o.value = null;
|
|
2504
|
-
const
|
|
2505
|
-
let
|
|
2637
|
+
const P = e.pageSize || 2e3;
|
|
2638
|
+
let w = 0, L = [], r = !0;
|
|
2506
2639
|
try {
|
|
2507
|
-
for (;
|
|
2508
|
-
const
|
|
2509
|
-
let
|
|
2510
|
-
if (
|
|
2640
|
+
for (; r; ) {
|
|
2641
|
+
const b = e.url.replace(/\/$/, ""), g = encodeURIComponent(y.where || e.where || "1=1");
|
|
2642
|
+
let p = `${b}/query?where=${g}&outFields=*&returnGeometry=true&resultRecordCount=${P}&resultOffset=${w}&f=geojson`;
|
|
2643
|
+
if (y.bounds) {
|
|
2511
2644
|
const E = JSON.stringify({
|
|
2512
|
-
xmin:
|
|
2513
|
-
ymin:
|
|
2514
|
-
xmax:
|
|
2515
|
-
ymax:
|
|
2645
|
+
xmin: y.bounds.west,
|
|
2646
|
+
ymin: y.bounds.south,
|
|
2647
|
+
xmax: y.bounds.east,
|
|
2648
|
+
ymax: y.bounds.north,
|
|
2516
2649
|
spatialReference: { wkid: 4326 }
|
|
2517
2650
|
});
|
|
2518
|
-
|
|
2651
|
+
p += `&geometry=${encodeURIComponent(E)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
|
|
2519
2652
|
}
|
|
2520
|
-
const
|
|
2521
|
-
if (!
|
|
2522
|
-
throw new Error(`HTTP ${
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2653
|
+
const d = await fetch(p);
|
|
2654
|
+
if (!d.ok)
|
|
2655
|
+
throw new Error(`HTTP ${d.status}: ${d.statusText}`);
|
|
2656
|
+
const S = await d.json();
|
|
2657
|
+
S.features && S.features.length > 0 ? (L = L.concat(S.features), w += S.features.length, r = S.features.length === P) : r = !1;
|
|
2525
2658
|
}
|
|
2526
|
-
const
|
|
2659
|
+
const h = {
|
|
2527
2660
|
type: "FeatureCollection",
|
|
2528
|
-
features:
|
|
2661
|
+
features: L
|
|
2529
2662
|
};
|
|
2530
|
-
return n.value =
|
|
2531
|
-
} catch (
|
|
2532
|
-
const
|
|
2533
|
-
throw o.value =
|
|
2663
|
+
return n.value = h, a.value = L.length, h;
|
|
2664
|
+
} catch (h) {
|
|
2665
|
+
const b = h instanceof Error ? h : new Error("Failed to fetch features");
|
|
2666
|
+
throw o.value = b, b;
|
|
2534
2667
|
} finally {
|
|
2535
2668
|
t.value = !1;
|
|
2536
2669
|
}
|
|
@@ -2538,25 +2671,25 @@ function On(e) {
|
|
|
2538
2671
|
function c() {
|
|
2539
2672
|
n.value = null, a.value = 0, o.value = null;
|
|
2540
2673
|
}
|
|
2541
|
-
async function
|
|
2542
|
-
return l(
|
|
2674
|
+
async function v(y = {}) {
|
|
2675
|
+
return l(y);
|
|
2543
2676
|
}
|
|
2544
2677
|
return {
|
|
2545
2678
|
// State (readonly)
|
|
2546
|
-
data:
|
|
2547
|
-
isLoading:
|
|
2548
|
-
error:
|
|
2549
|
-
totalFeatures:
|
|
2679
|
+
data: j(n),
|
|
2680
|
+
isLoading: j(t),
|
|
2681
|
+
error: j(o),
|
|
2682
|
+
totalFeatures: j(a),
|
|
2550
2683
|
// Config
|
|
2551
2684
|
config: e,
|
|
2552
2685
|
// Methods
|
|
2553
2686
|
fetch: l,
|
|
2554
|
-
refetch:
|
|
2687
|
+
refetch: v,
|
|
2555
2688
|
clear: c
|
|
2556
2689
|
};
|
|
2557
2690
|
}
|
|
2558
|
-
function
|
|
2559
|
-
const o =
|
|
2691
|
+
function ai(e, n, t) {
|
|
2692
|
+
const o = Gn(e);
|
|
2560
2693
|
return Pe(
|
|
2561
2694
|
n,
|
|
2562
2695
|
async (a) => {
|
|
@@ -2569,20 +2702,21 @@ function jn(e, n, t) {
|
|
|
2569
2702
|
), o;
|
|
2570
2703
|
}
|
|
2571
2704
|
export {
|
|
2572
|
-
|
|
2705
|
+
ti as LayerCheckboxSet,
|
|
2573
2706
|
Do as LayerPanel,
|
|
2574
|
-
|
|
2707
|
+
oi as LayerRadioButtonSet,
|
|
2708
|
+
Yn as Layerboard,
|
|
2575
2709
|
Xt as MapPanel,
|
|
2576
|
-
|
|
2577
|
-
|
|
2710
|
+
ei as TopicAccordion,
|
|
2711
|
+
Kn as WEBMAP_ID,
|
|
2578
2712
|
lt as buildWebMapUrl,
|
|
2579
2713
|
Qo as clearCache,
|
|
2580
2714
|
it as getLayerConfigs,
|
|
2581
|
-
|
|
2715
|
+
Xn as getWebMapUrl,
|
|
2582
2716
|
kt as transformWebMapToLayerConfigs,
|
|
2583
2717
|
en as useApiDataSources,
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2718
|
+
Gn as useDataSource,
|
|
2719
|
+
ii as useLayerConfig,
|
|
2720
|
+
ni as useLayerboard,
|
|
2721
|
+
ai as useReactiveDataSource
|
|
2588
2722
|
};
|