@phila/layerboard 3.0.0-beta.33 → 3.0.0-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.mjs +317 -317
- package/dist/layerboard.css +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ge, ref as k, watch as Ee, computed as _, nextTick as Ze, onMounted as it, onUnmounted as At, createElementBlock as M, openBlock as m, createVNode as J, unref as f, withCtx as Ge, createBlock as G, createCommentVNode as R, Fragment as de, renderList as we, useAttrs as Ht, toRef as Jt, normalizeClass as se, createElementVNode as P, toDisplayString as H, renderSlot as me, withDirectives as Bt, mergeProps as ht, vModelDynamic as Kt, createTextVNode as ke, normalizeProps as $t, guardReactiveProps as Mt, normalizeStyle as ye, withModifiers as Qt, readonly as q, provide as
|
|
1
|
+
import { defineComponent as ge, ref as k, watch as Ee, computed as _, nextTick as Ze, onMounted as it, onUnmounted as At, createElementBlock as M, openBlock as m, createVNode as J, unref as f, withCtx as Ge, createBlock as G, createCommentVNode as R, Fragment as de, renderList as we, useAttrs as Ht, toRef as Jt, normalizeClass as se, createElementVNode as P, toDisplayString as H, renderSlot as me, withDirectives as Bt, mergeProps as ht, vModelDynamic as Kt, createTextVNode as ke, normalizeProps as $t, guardReactiveProps as Mt, normalizeStyle as ye, withModifiers as Qt, readonly as q, provide as N, onBeforeUnmount as Xt, useId as Pt, resolveComponent as Yt, vShow as eo } from "vue";
|
|
2
2
|
import { Map as to, DrawTool as oo, RasterLayer as Ft, CircleLayer as Tt, FillLayer as It, LineLayer as mt, MapMarker as ao, MapPopup as io } from "@phila/phila-ui-map-core";
|
|
3
3
|
import { cn as gt, Icon as Ce, BaseLink as lo, ActionContent as Et } from "@phila/phila-ui-core";
|
|
4
4
|
const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
@@ -23,8 +23,8 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
23
23
|
initialCenter: { default: void 0 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
26
|
-
setup(e, { emit:
|
|
27
|
-
const l = e, o =
|
|
26
|
+
setup(e, { emit: a }) {
|
|
27
|
+
const l = e, o = a, r = k(null), n = k(null), u = k(0);
|
|
28
28
|
function w(t) {
|
|
29
29
|
o("zoom", t), n.value && (u.value = p(n.value));
|
|
30
30
|
}
|
|
@@ -33,7 +33,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
33
33
|
return $ * Math.cos(E) / Math.pow(2, c);
|
|
34
34
|
}
|
|
35
35
|
const C = k({}), y = k(null), h = k(/* @__PURE__ */ new Set());
|
|
36
|
-
async function
|
|
36
|
+
async function i(t, c, s, b, $) {
|
|
37
37
|
const E = encodeURIComponent(b || "1=1"), B = JSON.stringify({
|
|
38
38
|
xmin: c.west,
|
|
39
39
|
ymin: c.south,
|
|
@@ -43,18 +43,18 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
43
43
|
}), ee = $ !== void 0 && $ < 14 ? `&maxAllowableOffset=${360 / (Math.pow(2, $) * 512)}` : "", Y = 2e3;
|
|
44
44
|
let ie = 0, oe = [], A = !0;
|
|
45
45
|
for (; A; ) {
|
|
46
|
-
const j = `${t}/query?where=${E}&geometry=${encodeURIComponent(B)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${Y}&resultOffset=${ie}${ee}&f=geojson`,
|
|
47
|
-
if (!
|
|
48
|
-
throw new Error(`HTTP ${
|
|
49
|
-
const ue = await
|
|
46
|
+
const j = `${t}/query?where=${E}&geometry=${encodeURIComponent(B)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${Y}&resultOffset=${ie}${ee}&f=geojson`, U = await fetch(j);
|
|
47
|
+
if (!U.ok)
|
|
48
|
+
throw new Error(`HTTP ${U.status}: ${U.statusText}`);
|
|
49
|
+
const ue = await U.json();
|
|
50
50
|
ue.features && ue.features.length > 0 ? (oe = oe.concat(ue.features), ie += ue.features.length, A = ue.features.length === Y) : A = !1;
|
|
51
51
|
}
|
|
52
52
|
return oe = oe.map((j) => {
|
|
53
53
|
if (j.properties) {
|
|
54
|
-
const
|
|
54
|
+
const U = {};
|
|
55
55
|
for (const ue of Object.keys(j.properties))
|
|
56
|
-
|
|
57
|
-
return { ...j, properties:
|
|
56
|
+
U[ue.toLowerCase()] = j.properties[ue];
|
|
57
|
+
return { ...j, properties: U };
|
|
58
58
|
}
|
|
59
59
|
return j;
|
|
60
60
|
}), {
|
|
@@ -68,7 +68,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
68
68
|
if (E) {
|
|
69
69
|
o("layerLoading", $, !0);
|
|
70
70
|
try {
|
|
71
|
-
const B = await
|
|
71
|
+
const B = await i(E.url, t, $, E.where, s);
|
|
72
72
|
C.value = { ...C.value, [$]: B }, o("layerError", $, null);
|
|
73
73
|
} catch (B) {
|
|
74
74
|
const ee = B instanceof Error ? B.message : "Failed to load";
|
|
@@ -151,7 +151,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
|
-
function
|
|
154
|
+
function W(t) {
|
|
155
155
|
return l.visibleTiledLayers?.has(t) ?? !1;
|
|
156
156
|
}
|
|
157
157
|
function fe(t) {
|
|
@@ -203,7 +203,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
203
203
|
const s = u.value;
|
|
204
204
|
return s === 0 || s > c.maxScale ? "tiled" : "dynamic";
|
|
205
205
|
}
|
|
206
|
-
const ct = _(() => l.tiledLayers ? l.tiledLayers.filter((t) =>
|
|
206
|
+
const ct = _(() => l.tiledLayers ? l.tiledLayers.filter((t) => W(t.id) ? t.scaleBasedRendering ? Qe(t) === "tiled" : !0 : !1) : []), ze = _(() => l.tiledLayers ? l.tiledLayers.filter((t) => W(t.id) && t.scaleBasedRendering ? Qe(t) === "dynamic" : !1) : []);
|
|
207
207
|
function We(t) {
|
|
208
208
|
return {
|
|
209
209
|
type: "raster",
|
|
@@ -229,8 +229,8 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
229
229
|
{
|
|
230
230
|
const Y = E.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
231
231
|
if (Y && Y[4]) {
|
|
232
|
-
const [, ie, oe, A, j] = Y,
|
|
233
|
-
$[b] = `rgba(${ie}, ${oe}, ${A}, ${
|
|
232
|
+
const [, ie, oe, A, j] = Y, U = parseFloat(j) * c;
|
|
233
|
+
$[b] = `rgba(${ie}, ${oe}, ${A}, ${U})`, $[s] = 1;
|
|
234
234
|
}
|
|
235
235
|
return $;
|
|
236
236
|
}
|
|
@@ -342,22 +342,22 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
342
342
|
});
|
|
343
343
|
if (E.length === 0) return;
|
|
344
344
|
const B = Ye(E), ee = l.layerList.map((A) => A.config), ie = dt(B, ee).map((A) => {
|
|
345
|
-
const j = A.layer.id.replace(/-outline$/, ""),
|
|
346
|
-
if (!
|
|
347
|
-
const ue = Le(
|
|
345
|
+
const j = A.layer.id.replace(/-outline$/, ""), U = De(j);
|
|
346
|
+
if (!U) return null;
|
|
347
|
+
const ue = Le(U.id, A.properties || {});
|
|
348
348
|
return {
|
|
349
|
-
layerId:
|
|
350
|
-
layerTitle:
|
|
349
|
+
layerId: U.id,
|
|
350
|
+
layerTitle: U.title,
|
|
351
351
|
properties: A.properties || {},
|
|
352
352
|
geometry: ue || A.geometry,
|
|
353
|
-
popupConfig:
|
|
353
|
+
popupConfig: U.popup
|
|
354
354
|
};
|
|
355
355
|
}).filter((A) => A !== null);
|
|
356
356
|
if (ie.length === 0) return;
|
|
357
357
|
ie.sort((A, j) => {
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
const pt = A.properties[
|
|
358
|
+
const U = A.popupConfig?.popupSortField, ue = j.popupConfig?.popupSortField;
|
|
359
|
+
if (!U || U !== ue) return 0;
|
|
360
|
+
const pt = A.properties[U], yt = j.properties[U];
|
|
361
361
|
if (pt == null || yt == null) return 0;
|
|
362
362
|
const xt = A.popupConfig?.popupSortOrder !== "asc";
|
|
363
363
|
return pt < yt ? xt ? 1 : -1 : pt > yt ? xt ? -1 : 1 : 0;
|
|
@@ -366,13 +366,13 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
366
366
|
if (oe) {
|
|
367
367
|
const A = De(oe.layerId);
|
|
368
368
|
if (A) {
|
|
369
|
-
const j = K(oe.geometry),
|
|
369
|
+
const j = K(oe.geometry), U = Z(A.id, A.type);
|
|
370
370
|
x.value = {
|
|
371
371
|
geometry: oe.geometry,
|
|
372
372
|
geometryType: j,
|
|
373
373
|
layerId: A.id,
|
|
374
374
|
properties: oe.properties,
|
|
375
|
-
originalStyle:
|
|
375
|
+
originalStyle: U
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
}
|
|
@@ -452,7 +452,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
452
452
|
function K(t) {
|
|
453
453
|
return t.type;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Z(t, c) {
|
|
456
456
|
const s = De(t);
|
|
457
457
|
if (!s) return { radius: 5, width: 2 };
|
|
458
458
|
const b = s.paint || {};
|
|
@@ -581,7 +581,7 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
581
581
|
}
|
|
582
582
|
const c = De(t.layerId);
|
|
583
583
|
if (c) {
|
|
584
|
-
const s = K(t.geometry), b =
|
|
584
|
+
const s = K(t.geometry), b = Z(c.id, c.type);
|
|
585
585
|
x.value = {
|
|
586
586
|
geometry: t.geometry,
|
|
587
587
|
geometryType: s,
|
|
@@ -722,15 +722,15 @@ const no = { class: "map-panel" }, ro = /* @__PURE__ */ ge({
|
|
|
722
722
|
}, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
|
|
723
723
|
]));
|
|
724
724
|
}
|
|
725
|
-
}), xe = (e,
|
|
725
|
+
}), xe = (e, a) => {
|
|
726
726
|
const l = e.__vccOpts || e;
|
|
727
|
-
for (const [o, r] of
|
|
727
|
+
for (const [o, r] of a)
|
|
728
728
|
l[o] = r;
|
|
729
729
|
return l;
|
|
730
730
|
}, so = /* @__PURE__ */ xe(ro, [["__scopeId", "data-v-7b0b7505"]]);
|
|
731
731
|
function Vt(e) {
|
|
732
|
-
let
|
|
733
|
-
return
|
|
732
|
+
let a = e.split("?")[0] || e;
|
|
733
|
+
return a = a.replace(/\/query$/, ""), a = a.replace(/\/$/, ""), a = a.replace(/^https?:\/\//, ""), a.toLowerCase();
|
|
734
734
|
}
|
|
735
735
|
const co = ["disabled"], uo = /* @__PURE__ */ ge({
|
|
736
736
|
inheritAttrs: !1,
|
|
@@ -754,40 +754,40 @@ const co = ["disabled"], uo = /* @__PURE__ */ ge({
|
|
|
754
754
|
svgRaw: {}
|
|
755
755
|
},
|
|
756
756
|
setup(e) {
|
|
757
|
-
const
|
|
757
|
+
const a = e, l = (u) => "href" in u && u.href !== void 0 || "to" in u && u.to !== void 0, o = _(() => gt(
|
|
758
758
|
"phila-button",
|
|
759
|
-
`phila-button--${
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
)), r = _(() => l(
|
|
765
|
-
to:
|
|
766
|
-
disabled:
|
|
759
|
+
`phila-button--${a.variant}`,
|
|
760
|
+
a.size && `is-${a.size}`,
|
|
761
|
+
a.iconOnly && "icon-button",
|
|
762
|
+
a.iconOnly && a.variant === "standard" && "icon-button--standard",
|
|
763
|
+
a.className
|
|
764
|
+
)), r = _(() => l(a) ? "to" in a && a.to !== void 0 ? {
|
|
765
|
+
to: a.to,
|
|
766
|
+
disabled: a.disabled,
|
|
767
767
|
className: o.value
|
|
768
768
|
} : {
|
|
769
|
-
href:
|
|
770
|
-
target:
|
|
771
|
-
rel:
|
|
772
|
-
disabled:
|
|
769
|
+
href: a.href,
|
|
770
|
+
target: a.target,
|
|
771
|
+
rel: a.rel,
|
|
772
|
+
disabled: a.disabled,
|
|
773
773
|
className: o.value
|
|
774
774
|
} : {}), n = _(
|
|
775
775
|
() => ({
|
|
776
|
-
iconDefinition:
|
|
777
|
-
iconClass:
|
|
778
|
-
src:
|
|
779
|
-
iconRight:
|
|
780
|
-
iconOnly:
|
|
781
|
-
text:
|
|
782
|
-
size:
|
|
776
|
+
iconDefinition: a.iconDefinition,
|
|
777
|
+
iconClass: a.iconClass,
|
|
778
|
+
src: a.src,
|
|
779
|
+
iconRight: a.iconRight,
|
|
780
|
+
iconOnly: a.iconOnly,
|
|
781
|
+
text: a.text,
|
|
782
|
+
size: a.size
|
|
783
783
|
})
|
|
784
784
|
);
|
|
785
|
-
return (u, w) => l(
|
|
785
|
+
return (u, w) => l(a) ? (m(), G(f(lo), ht({ key: 0 }, { ...r.value, ...u.$attrs }, { role: "button" }), {
|
|
786
786
|
default: Ge(() => [
|
|
787
787
|
J(f(Et), $t(Mt(n.value)), {
|
|
788
788
|
default: Ge(() => [
|
|
789
789
|
me(u.$slots, "default", {}, () => [
|
|
790
|
-
ke(H(
|
|
790
|
+
ke(H(a.text), 1)
|
|
791
791
|
])
|
|
792
792
|
]),
|
|
793
793
|
_: 3
|
|
@@ -797,13 +797,13 @@ const co = ["disabled"], uo = /* @__PURE__ */ ge({
|
|
|
797
797
|
}, 16)) : (m(), M("button", ht({
|
|
798
798
|
key: 1,
|
|
799
799
|
type: "button",
|
|
800
|
-
disabled:
|
|
800
|
+
disabled: a.disabled,
|
|
801
801
|
class: o.value
|
|
802
802
|
}, u.$attrs), [
|
|
803
803
|
J(f(Et), $t(Mt(n.value)), {
|
|
804
804
|
default: Ge(() => [
|
|
805
805
|
me(u.$slots, "default", {}, () => [
|
|
806
|
-
ke(H(
|
|
806
|
+
ke(H(a.text), 1)
|
|
807
807
|
])
|
|
808
808
|
]),
|
|
809
809
|
_: 3
|
|
@@ -843,8 +843,8 @@ const ho = ["for"], go = { class: "state-layer" }, vo = { class: "content" }, bo
|
|
|
843
843
|
} }
|
|
844
844
|
},
|
|
845
845
|
emits: ["update:modelValue"],
|
|
846
|
-
setup(e, { emit:
|
|
847
|
-
const l = Ht(), o = e, r = _(() => typeof o.error == "string" ? o.error : o.error[0]), n = Jt(o, "id"), u =
|
|
846
|
+
setup(e, { emit: a }) {
|
|
847
|
+
const l = Ht(), o = e, r = _(() => typeof o.error == "string" ? o.error : o.error[0]), n = Jt(o, "id"), u = a, w = k(""), p = _({
|
|
848
848
|
get: () => o.modelValue !== void 0 ? o.modelValue : w.value,
|
|
849
849
|
set: (d) => {
|
|
850
850
|
u("update:modelValue", d), w.value = d;
|
|
@@ -858,8 +858,8 @@ const ho = ["for"], go = { class: "state-layer" }, vo = { class: "content" }, bo
|
|
|
858
858
|
}), h = _(() => {
|
|
859
859
|
if (!(o.label || l["aria-label"]))
|
|
860
860
|
return o.placeholder || void 0;
|
|
861
|
-
}),
|
|
862
|
-
d.target.closest("button") ||
|
|
861
|
+
}), i = k(null), g = (d) => {
|
|
862
|
+
d.target.closest("button") || i.value?.focus();
|
|
863
863
|
};
|
|
864
864
|
return (d, L) => (m(), M("div", {
|
|
865
865
|
class: se(["phila-input", C.value])
|
|
@@ -885,7 +885,7 @@ const ho = ["for"], go = { class: "state-layer" }, vo = { class: "content" }, bo
|
|
|
885
885
|
Bt(P("input", ht({
|
|
886
886
|
id: n.value,
|
|
887
887
|
ref_key: "inputRef",
|
|
888
|
-
ref:
|
|
888
|
+
ref: i,
|
|
889
889
|
"onUpdate:modelValue": L[0] || (L[0] = (S) => p.value = S),
|
|
890
890
|
class: "phila-text-field-input has-text-body-default",
|
|
891
891
|
placeholder: o.placeholder,
|
|
@@ -966,7 +966,7 @@ const Fo = {
|
|
|
966
966
|
unavailable: { type: Boolean }
|
|
967
967
|
},
|
|
968
968
|
setup(e) {
|
|
969
|
-
return (
|
|
969
|
+
return (a, l) => (m(), M(de, null, [
|
|
970
970
|
e.loading && !e.unavailable ? (m(), M("span", Fo, " Loading... ")) : R("", !0),
|
|
971
971
|
e.error ? (m(), M("span", {
|
|
972
972
|
key: 1,
|
|
@@ -985,8 +985,8 @@ const Fo = {
|
|
|
985
985
|
opacity: {}
|
|
986
986
|
},
|
|
987
987
|
emits: ["update:opacity"],
|
|
988
|
-
setup(e, { emit:
|
|
989
|
-
const l =
|
|
988
|
+
setup(e, { emit: a }) {
|
|
989
|
+
const l = a;
|
|
990
990
|
function o(r) {
|
|
991
991
|
const n = r.target;
|
|
992
992
|
l("update:opacity", parseFloat(n.value));
|
|
@@ -1016,7 +1016,7 @@ const Fo = {
|
|
|
1016
1016
|
label: {}
|
|
1017
1017
|
},
|
|
1018
1018
|
setup(e) {
|
|
1019
|
-
return (
|
|
1019
|
+
return (a, l) => (m(), M("ul", {
|
|
1020
1020
|
class: "layer-legend",
|
|
1021
1021
|
"aria-label": e.label
|
|
1022
1022
|
}, [
|
|
@@ -1049,7 +1049,7 @@ const Fo = {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
}), wt = /* @__PURE__ */ xe(Bo, [["__scopeId", "data-v-62e210e3"]]);
|
|
1051
1051
|
function Lt(e) {
|
|
1052
|
-
function
|
|
1052
|
+
function a(u) {
|
|
1053
1053
|
return e().visibleLayerIds.has(u);
|
|
1054
1054
|
}
|
|
1055
1055
|
function l(u) {
|
|
@@ -1065,7 +1065,7 @@ function Lt(e) {
|
|
|
1065
1065
|
const w = e().currentZoom, p = u.minZoom, C = u.maxZoom;
|
|
1066
1066
|
return !(p !== void 0 && w < p || C !== void 0 && w > C);
|
|
1067
1067
|
}
|
|
1068
|
-
return { isVisible:
|
|
1068
|
+
return { isVisible: a, getLayerOpacity: l, isLayerLoading: o, getLayerError: r, isLayerAvailableAtZoom: n };
|
|
1069
1069
|
}
|
|
1070
1070
|
const Vo = { class: "layer-panel" }, Zo = {
|
|
1071
1071
|
key: 0,
|
|
@@ -1097,8 +1097,8 @@ const Vo = { class: "layer-panel" }, Zo = {
|
|
|
1097
1097
|
searchPlaceholder: { default: "Filter layers..." }
|
|
1098
1098
|
},
|
|
1099
1099
|
emits: ["toggleLayer", "setOpacity", "updateSearch"],
|
|
1100
|
-
setup(e, { emit:
|
|
1101
|
-
const l = e, o =
|
|
1100
|
+
setup(e, { emit: a }) {
|
|
1101
|
+
const l = e, o = a, r = _(() => {
|
|
1102
1102
|
if (!l.searchQuery.trim())
|
|
1103
1103
|
return l.layerList;
|
|
1104
1104
|
const d = l.searchQuery.toLowerCase();
|
|
@@ -1114,7 +1114,7 @@ const Vo = { class: "layer-panel" }, Zo = {
|
|
|
1114
1114
|
loadingLayerIds: l.loadingLayers,
|
|
1115
1115
|
layerErrors: l.layerErrors,
|
|
1116
1116
|
currentZoom: l.currentZoom
|
|
1117
|
-
})),
|
|
1117
|
+
})), i = _({
|
|
1118
1118
|
get: () => l.searchQuery,
|
|
1119
1119
|
set: (d) => o("updateSearch", d)
|
|
1120
1120
|
});
|
|
@@ -1124,8 +1124,8 @@ const Vo = { class: "layer-panel" }, Zo = {
|
|
|
1124
1124
|
return (d, L) => (m(), M("div", Vo, [
|
|
1125
1125
|
e.showSearch ? (m(), M("div", Zo, [
|
|
1126
1126
|
J(f(Co), {
|
|
1127
|
-
modelValue:
|
|
1128
|
-
"onUpdate:modelValue": L[0] || (L[0] = (S) =>
|
|
1127
|
+
modelValue: i.value,
|
|
1128
|
+
"onUpdate:modelValue": L[0] || (L[0] = (S) => i.value = S),
|
|
1129
1129
|
placeholder: e.searchPlaceholder,
|
|
1130
1130
|
"class-name": "layer-search-field"
|
|
1131
1131
|
}, {
|
|
@@ -1221,46 +1221,46 @@ function Je(e) {
|
|
|
1221
1221
|
if (e)
|
|
1222
1222
|
return Qo[e] ?? void 0;
|
|
1223
1223
|
}
|
|
1224
|
-
function Xo(e,
|
|
1224
|
+
function Xo(e, a, l, o, r) {
|
|
1225
1225
|
const n = [];
|
|
1226
|
-
let u =
|
|
1227
|
-
for (let
|
|
1228
|
-
i
|
|
1226
|
+
let u = a[0], w = [e[0]], p = 0;
|
|
1227
|
+
for (let i = 1; i < e.length; i++)
|
|
1228
|
+
a[i] === u ? w.push(e[i]) : (n.push({ style: u, breaks: w, startIndex: p }), u = a[i], w = [e[i]], p = i);
|
|
1229
1229
|
n.push({ style: u, breaks: w, startIndex: p });
|
|
1230
1230
|
const C = [], y = /* @__PURE__ */ new Set();
|
|
1231
1231
|
let h = o.minValue ?? 0;
|
|
1232
|
-
for (let
|
|
1233
|
-
const g = n[
|
|
1232
|
+
for (let i = 0; i < n.length; i++) {
|
|
1233
|
+
const g = n[i], d = g.breaks, L = Je(g.style), S = i === 0 ? null : n[i - 1].breaks[n[i - 1].breaks.length - 1].classMaxValue, I = d[d.length - 1].classMaxValue;
|
|
1234
1234
|
let F;
|
|
1235
1235
|
const V = !!o.defaultSymbol;
|
|
1236
|
-
S === null ? F = `${!V && o.minValue != null ? `${l} >= ${o.minValue} AND ` : ""}${l} <= ${I}` :
|
|
1236
|
+
S === null ? F = `${!V && o.minValue != null ? `${l} >= ${o.minValue} AND ` : ""}${l} <= ${I}` : i === n.length - 1 && V ? F = `${l} > ${S}` : F = `${l} > ${S} AND ${l} <= ${I}`;
|
|
1237
1237
|
const T = {
|
|
1238
1238
|
"line-opacity": he(r)
|
|
1239
1239
|
};
|
|
1240
1240
|
if (L && (T["line-dasharray"] = L), d.length === 1)
|
|
1241
1241
|
T["line-color"] = z(d[0].symbol?.color), T["line-width"] = X(d[0].symbol?.width || 2);
|
|
1242
1242
|
else {
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1243
|
+
const W = ["step", ["get", l]], fe = ["step", ["get", l]];
|
|
1244
|
+
W.push(z(d[0].symbol?.color)), fe.push(X(d[0].symbol?.width || 2));
|
|
1245
1245
|
for (let ve = 1; ve < d.length; ve++)
|
|
1246
|
-
|
|
1247
|
-
T["line-color"] =
|
|
1246
|
+
W.push(d[ve - 1].classMaxValue), W.push(z(d[ve].symbol?.color)), fe.push(d[ve - 1].classMaxValue), fe.push(X(d[ve].symbol?.width || 2));
|
|
1247
|
+
T["line-color"] = W, T["line-width"] = fe;
|
|
1248
1248
|
}
|
|
1249
1249
|
const O = [];
|
|
1250
|
-
for (const
|
|
1250
|
+
for (const W of d)
|
|
1251
1251
|
O.push({
|
|
1252
1252
|
type: "line",
|
|
1253
|
-
color: z(
|
|
1254
|
-
width: X(
|
|
1255
|
-
label:
|
|
1256
|
-
}), h =
|
|
1253
|
+
color: z(W.symbol?.color),
|
|
1254
|
+
width: X(W.symbol?.width || 2),
|
|
1255
|
+
label: W.label || `${h} - ${W.classMaxValue}`
|
|
1256
|
+
}), h = W.classMaxValue + 1;
|
|
1257
1257
|
const D = g.style.replace("esriSLS", "").toLowerCase();
|
|
1258
1258
|
let te;
|
|
1259
|
-
|
|
1259
|
+
i === 0 ? te = "" : y.has(D) ? te = `-${D}-${i}` : te = `-${D}`, y.add(D), C.push({ suffix: te, where: F, paint: T, legend: O });
|
|
1260
1260
|
}
|
|
1261
1261
|
return C;
|
|
1262
1262
|
}
|
|
1263
|
-
function Yo(e,
|
|
1263
|
+
function Yo(e, a, l, o, r) {
|
|
1264
1264
|
const n = /* @__PURE__ */ new Map();
|
|
1265
1265
|
for (const C of e) {
|
|
1266
1266
|
const y = C.symbol?.style || "esriSLSSolid";
|
|
@@ -1269,13 +1269,13 @@ function Yo(e, i, l, o, r) {
|
|
|
1269
1269
|
const u = [], w = /* @__PURE__ */ new Set();
|
|
1270
1270
|
let p = !0;
|
|
1271
1271
|
for (const [C, y] of n) {
|
|
1272
|
-
const h = Je(C), g = y.map((F) => `${
|
|
1272
|
+
const h = Je(C), g = y.map((F) => `${a} = '${String(F.value).replace(/'/g, "''")}'`).join(" OR "), d = {
|
|
1273
1273
|
"line-opacity": he(o)
|
|
1274
1274
|
};
|
|
1275
1275
|
if (h && (d["line-dasharray"] = h), y.length === 1)
|
|
1276
1276
|
d["line-color"] = z(y[0].symbol?.color), d["line-width"] = X(y[0].symbol?.width || 2);
|
|
1277
1277
|
else {
|
|
1278
|
-
const F = ["match", ["to-string", ["get",
|
|
1278
|
+
const F = ["match", ["to-string", ["get", a]]];
|
|
1279
1279
|
for (const V of y)
|
|
1280
1280
|
F.push(at(V.value)), F.push(z(V.symbol?.color));
|
|
1281
1281
|
F.push(l ? z(l.color) : "rgba(0, 0, 0, 0)"), d["line-color"] = F, d["line-width"] = X(y[0].symbol?.width || 2);
|
|
@@ -1298,8 +1298,8 @@ function Yo(e, i, l, o, r) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
function z(e) {
|
|
1300
1300
|
if (!e || !Array.isArray(e) || e.length < 3) return "#888888";
|
|
1301
|
-
const
|
|
1302
|
-
return n === 1 ? `#${
|
|
1301
|
+
const a = e[0], l = e[1], o = e[2], n = (e[3] ?? 255) / 255;
|
|
1302
|
+
return n === 1 ? `#${a.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}` : `rgba(${a}, ${l}, ${o}, ${n.toFixed(2)})`;
|
|
1303
1303
|
}
|
|
1304
1304
|
function he(e) {
|
|
1305
1305
|
return e !== void 0 ? e : 1;
|
|
@@ -1311,14 +1311,14 @@ const ea = 559082264;
|
|
|
1311
1311
|
function zt(e) {
|
|
1312
1312
|
return !e || e <= 0 ? null : Math.round(Math.log2(ea / e) * 100) / 100;
|
|
1313
1313
|
}
|
|
1314
|
-
function ta(e,
|
|
1314
|
+
function ta(e, a) {
|
|
1315
1315
|
const l = {};
|
|
1316
1316
|
if (e && e > 0) {
|
|
1317
1317
|
const o = zt(e);
|
|
1318
1318
|
o !== null && (l.minZoom = o);
|
|
1319
1319
|
}
|
|
1320
|
-
if (
|
|
1321
|
-
const o = zt(
|
|
1320
|
+
if (a && a > 0) {
|
|
1321
|
+
const o = zt(a);
|
|
1322
1322
|
o !== null && (l.maxZoom = o);
|
|
1323
1323
|
}
|
|
1324
1324
|
return l;
|
|
@@ -1346,11 +1346,11 @@ function Me(e) {
|
|
|
1346
1346
|
function at(e) {
|
|
1347
1347
|
return String(e);
|
|
1348
1348
|
}
|
|
1349
|
-
function Zt(e,
|
|
1349
|
+
function Zt(e, a, l) {
|
|
1350
1350
|
const o = e.symbol, r = rt(o);
|
|
1351
1351
|
let n = {}, u = [], w = null;
|
|
1352
1352
|
if (r === "fill" && o) {
|
|
1353
|
-
const p = o.color === null ? 0 : o.color?.[3] ?? 255, C = p === 0 ? "rgba(0, 0, 0, 0)" : z(o.color), y = p === 0 ? 0 : p < 255 ? 1 : he(
|
|
1353
|
+
const p = o.color === null ? 0 : o.color?.[3] ?? 255, C = p === 0 ? "rgba(0, 0, 0, 0)" : z(o.color), y = p === 0 ? 0 : p < 255 ? 1 : he(a);
|
|
1354
1354
|
if (n = {
|
|
1355
1355
|
"fill-color": C,
|
|
1356
1356
|
"fill-opacity": y
|
|
@@ -1372,7 +1372,7 @@ function Zt(e, i, l) {
|
|
|
1372
1372
|
n = {
|
|
1373
1373
|
"line-color": z(o.color),
|
|
1374
1374
|
"line-width": X(o.width || 1),
|
|
1375
|
-
"line-opacity": he(
|
|
1375
|
+
"line-opacity": he(a)
|
|
1376
1376
|
};
|
|
1377
1377
|
const p = Je(o.style);
|
|
1378
1378
|
p && (n["line-dasharray"] = p), u = [
|
|
@@ -1388,7 +1388,7 @@ function Zt(e, i, l) {
|
|
|
1388
1388
|
n = {
|
|
1389
1389
|
"circle-color": z(o.color),
|
|
1390
1390
|
"circle-radius": p,
|
|
1391
|
-
"circle-opacity": he(
|
|
1391
|
+
"circle-opacity": he(a)
|
|
1392
1392
|
}, Me(o.outline) && (n["circle-stroke-color"] = z(o.outline.color), n["circle-stroke-width"] = X(o.outline.width || 1)), u = [
|
|
1393
1393
|
{
|
|
1394
1394
|
type: "circle",
|
|
@@ -1399,33 +1399,33 @@ function Zt(e, i, l) {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
return { paint: n, legend: u, geomType: r, outlinePaint: w };
|
|
1401
1401
|
}
|
|
1402
|
-
function oa(e,
|
|
1402
|
+
function oa(e, a, l) {
|
|
1403
1403
|
const o = e.field1.toLowerCase(), r = e.uniqueValueInfos || [], n = e.defaultSymbol;
|
|
1404
1404
|
if (r.length === 0)
|
|
1405
|
-
return Zt({ ...e, symbol: n },
|
|
1405
|
+
return Zt({ ...e, symbol: n }, a);
|
|
1406
1406
|
const u = r[0]?.symbol || n, w = rt(u);
|
|
1407
1407
|
let p = {};
|
|
1408
1408
|
const C = [];
|
|
1409
1409
|
let y = null;
|
|
1410
1410
|
if (w === "fill") {
|
|
1411
1411
|
const h = ["match", ["to-string", ["get", o]]];
|
|
1412
|
-
for (const
|
|
1413
|
-
h.push(at(
|
|
1414
|
-
const g = String(
|
|
1412
|
+
for (const i of r) {
|
|
1413
|
+
h.push(at(i.value)), h.push(z(i.symbol?.color));
|
|
1414
|
+
const g = String(i.value), L = l?.get(g) || i.label || g;
|
|
1415
1415
|
C.push({
|
|
1416
1416
|
type: "fill",
|
|
1417
|
-
color: z(
|
|
1417
|
+
color: z(i.symbol?.color),
|
|
1418
1418
|
label: L
|
|
1419
1419
|
});
|
|
1420
1420
|
}
|
|
1421
1421
|
if (h.push(n ? z(n.color) : "rgba(0, 0, 0, 0)"), p = {
|
|
1422
1422
|
"fill-color": h,
|
|
1423
|
-
"fill-opacity": he(
|
|
1423
|
+
"fill-opacity": he(a)
|
|
1424
1424
|
}, Me(u?.outline)) {
|
|
1425
|
-
const
|
|
1425
|
+
const i = X(Math.max(u.outline.width || 1, 1));
|
|
1426
1426
|
y = {
|
|
1427
1427
|
"line-color": z(u.outline.color),
|
|
1428
|
-
"line-width":
|
|
1428
|
+
"line-width": i
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
1431
|
} else if (w === "line") {
|
|
@@ -1443,11 +1443,11 @@ function oa(e, i, l) {
|
|
|
1443
1443
|
h.push(n ? z(n.color) : "rgba(0, 0, 0, 0)"), p = {
|
|
1444
1444
|
"line-color": h,
|
|
1445
1445
|
"line-width": X(u?.width || 2),
|
|
1446
|
-
"line-opacity": he(
|
|
1446
|
+
"line-opacity": he(a)
|
|
1447
1447
|
};
|
|
1448
|
-
const
|
|
1448
|
+
const i = r.map((d) => d.symbol?.style || "esriSLSSolid"), g = [...new Set(i)];
|
|
1449
1449
|
if (g.length > 1) {
|
|
1450
|
-
const d = Yo(r, o, n,
|
|
1450
|
+
const d = Yo(r, o, n, a, l);
|
|
1451
1451
|
return { paint: {}, legend: [], geomType: w, outlinePaint: y, splitLayers: d };
|
|
1452
1452
|
}
|
|
1453
1453
|
if (g.length === 1) {
|
|
@@ -1466,19 +1466,19 @@ function oa(e, i, l) {
|
|
|
1466
1466
|
});
|
|
1467
1467
|
}
|
|
1468
1468
|
h.push(n ? z(n.color) : "rgba(0, 0, 0, 0)");
|
|
1469
|
-
const
|
|
1469
|
+
const i = Math.round((u?.size || 6) * 0.71 * 100) / 100;
|
|
1470
1470
|
p = {
|
|
1471
1471
|
"circle-color": h,
|
|
1472
|
-
"circle-radius":
|
|
1473
|
-
"circle-opacity": he(
|
|
1472
|
+
"circle-radius": i,
|
|
1473
|
+
"circle-opacity": he(a)
|
|
1474
1474
|
}, Me(u?.outline) && (p["circle-stroke-color"] = z(u.outline.color), p["circle-stroke-width"] = X(u.outline.width || 1));
|
|
1475
1475
|
}
|
|
1476
1476
|
return { paint: p, legend: C, geomType: w, outlinePaint: y };
|
|
1477
1477
|
}
|
|
1478
|
-
function aa(e,
|
|
1478
|
+
function aa(e, a) {
|
|
1479
1479
|
const l = e.field.toLowerCase(), o = e.classBreakInfos || [], r = e.visualVariables?.find((y) => y.type === "colorInfo");
|
|
1480
1480
|
if (r?.stops && r.stops.length > 0)
|
|
1481
|
-
return ia(r, l, e,
|
|
1481
|
+
return ia(r, l, e, a);
|
|
1482
1482
|
if (o.length === 0)
|
|
1483
1483
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1484
1484
|
const n = o[0]?.symbol, u = rt(n);
|
|
@@ -1489,16 +1489,16 @@ function aa(e, i) {
|
|
|
1489
1489
|
const y = ["step", ["get", l]];
|
|
1490
1490
|
y.push(z(o[0]?.symbol?.color));
|
|
1491
1491
|
for (let h = 0; h < o.length; h++) {
|
|
1492
|
-
const
|
|
1493
|
-
h > 0 && (y.push(o[h - 1].classMaxValue), y.push(z(
|
|
1492
|
+
const i = o[h];
|
|
1493
|
+
h > 0 && (y.push(o[h - 1].classMaxValue), y.push(z(i.symbol?.color))), p.push({
|
|
1494
1494
|
type: "fill",
|
|
1495
|
-
color: z(
|
|
1496
|
-
label:
|
|
1495
|
+
color: z(i.symbol?.color),
|
|
1496
|
+
label: i.label || `${i.classMaxValue}`
|
|
1497
1497
|
});
|
|
1498
1498
|
}
|
|
1499
1499
|
if (w = {
|
|
1500
1500
|
"fill-color": y,
|
|
1501
|
-
"fill-opacity": he(
|
|
1501
|
+
"fill-opacity": he(a)
|
|
1502
1502
|
}, Me(n?.outline)) {
|
|
1503
1503
|
const h = X(n.outline.width || 1);
|
|
1504
1504
|
C = {
|
|
@@ -1509,7 +1509,7 @@ function aa(e, i) {
|
|
|
1509
1509
|
} else if (u === "line") {
|
|
1510
1510
|
const y = o.map((I) => I.symbol?.style || "esriSLSSolid"), h = [...new Set(y)];
|
|
1511
1511
|
if (h.length > 1) {
|
|
1512
|
-
const I = Xo(o, y, l, e,
|
|
1512
|
+
const I = Xo(o, y, l, e, a);
|
|
1513
1513
|
return { paint: {}, legend: [], geomType: u, outlinePaint: C, splitLayers: I };
|
|
1514
1514
|
}
|
|
1515
1515
|
const g = ["step", ["get", l]];
|
|
@@ -1528,14 +1528,14 @@ function aa(e, i) {
|
|
|
1528
1528
|
w = {
|
|
1529
1529
|
"line-color": g,
|
|
1530
1530
|
"line-width": L,
|
|
1531
|
-
"line-opacity": he(
|
|
1531
|
+
"line-opacity": he(a)
|
|
1532
1532
|
};
|
|
1533
1533
|
const S = Je(h[0]);
|
|
1534
1534
|
S && (w["line-dasharray"] = S);
|
|
1535
1535
|
}
|
|
1536
1536
|
return { paint: w, legend: p, geomType: u, outlinePaint: C };
|
|
1537
1537
|
}
|
|
1538
|
-
function ia(e,
|
|
1538
|
+
function ia(e, a, l, o) {
|
|
1539
1539
|
const r = e.stops || [];
|
|
1540
1540
|
if (r.length === 0)
|
|
1541
1541
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
@@ -1544,17 +1544,17 @@ function ia(e, i, l, o) {
|
|
|
1544
1544
|
const p = [];
|
|
1545
1545
|
let C = null;
|
|
1546
1546
|
if (u === "fill") {
|
|
1547
|
-
const y = ["interpolate", ["linear"], ["get",
|
|
1548
|
-
for (const
|
|
1549
|
-
y.push(
|
|
1547
|
+
const y = ["interpolate", ["linear"], ["get", a]];
|
|
1548
|
+
for (const i of r)
|
|
1549
|
+
y.push(i.value), y.push(z(i.color)), p.push({
|
|
1550
1550
|
type: "fill",
|
|
1551
|
-
color: z(
|
|
1552
|
-
label:
|
|
1551
|
+
color: z(i.color),
|
|
1552
|
+
label: i.label || `${i.value}`
|
|
1553
1553
|
});
|
|
1554
1554
|
if (w = {
|
|
1555
1555
|
"fill-color": [
|
|
1556
1556
|
"case",
|
|
1557
|
-
["==", ["get",
|
|
1557
|
+
["==", ["get", a], null],
|
|
1558
1558
|
"rgba(0, 0, 0, 0)",
|
|
1559
1559
|
// Transparent for null/no-data values
|
|
1560
1560
|
y
|
|
@@ -1562,40 +1562,40 @@ function ia(e, i, l, o) {
|
|
|
1562
1562
|
],
|
|
1563
1563
|
"fill-opacity": he(o)
|
|
1564
1564
|
}, Me(n?.outline)) {
|
|
1565
|
-
const
|
|
1565
|
+
const i = X(n.outline.width || 1);
|
|
1566
1566
|
C = {
|
|
1567
1567
|
"line-color": z(n.outline.color),
|
|
1568
|
-
"line-width":
|
|
1568
|
+
"line-width": i
|
|
1569
1569
|
};
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
return { paint: w, legend: p, geomType: u, outlinePaint: C };
|
|
1573
1573
|
}
|
|
1574
|
-
function la(e,
|
|
1574
|
+
function la(e, a, l, o) {
|
|
1575
1575
|
if (!e?.renderer)
|
|
1576
1576
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1577
1577
|
const r = e.renderer;
|
|
1578
1578
|
switch (r.type) {
|
|
1579
1579
|
case "simple":
|
|
1580
|
-
return Zt(r,
|
|
1580
|
+
return Zt(r, a);
|
|
1581
1581
|
case "uniqueValue":
|
|
1582
|
-
return oa(r,
|
|
1582
|
+
return oa(r, a, l);
|
|
1583
1583
|
case "classBreaks":
|
|
1584
|
-
return aa(r,
|
|
1584
|
+
return aa(r, a);
|
|
1585
1585
|
default:
|
|
1586
1586
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
1589
|
function na(e) {
|
|
1590
1590
|
if (!e) return null;
|
|
1591
|
-
const
|
|
1591
|
+
const a = (e.title || "").replace(/\{([^}]+)\}/g, (n, u) => `{${u.toLowerCase()}}`), o = (e.fieldInfos || []).filter((n) => n.visible === !0).map((n) => {
|
|
1592
1592
|
const u = {
|
|
1593
1593
|
field: n.fieldName.toLowerCase(),
|
|
1594
1594
|
label: n.label || n.fieldName
|
|
1595
1595
|
};
|
|
1596
1596
|
return n.format && (u.format = {}, n.format.dateFormat && (u.format.dateFormat = n.format.dateFormat), n.format.digitSeparator !== void 0 && (u.format.digitSeparator = n.format.digitSeparator), n.format.places !== void 0 && (u.format.places = n.format.places), Object.keys(u.format).length === 0 && delete u.format), u;
|
|
1597
1597
|
}), r = {
|
|
1598
|
-
title:
|
|
1598
|
+
title: a,
|
|
1599
1599
|
fields: o
|
|
1600
1600
|
};
|
|
1601
1601
|
return e.showTime && (r.showTime = !0), r;
|
|
@@ -1610,26 +1610,26 @@ function ca(e) {
|
|
|
1610
1610
|
return e.includes("_") ? e.split("_").slice(1).join(" ") : e;
|
|
1611
1611
|
}
|
|
1612
1612
|
function ua(e) {
|
|
1613
|
-
const
|
|
1613
|
+
const a = /* @__PURE__ */ new Map();
|
|
1614
1614
|
if (!e)
|
|
1615
|
-
return
|
|
1615
|
+
return a;
|
|
1616
1616
|
const l = e.split(`
|
|
1617
1617
|
`), o = /^(\d{1,3})\s+(.+)$/;
|
|
1618
1618
|
for (const r of l) {
|
|
1619
1619
|
const n = r.trim().match(o);
|
|
1620
1620
|
if (n) {
|
|
1621
1621
|
const [, u, w] = n;
|
|
1622
|
-
u && w &&
|
|
1622
|
+
u && w && a.set(u, w.trim());
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
|
-
return
|
|
1625
|
+
return a;
|
|
1626
1626
|
}
|
|
1627
1627
|
async function da(e) {
|
|
1628
1628
|
try {
|
|
1629
|
-
const
|
|
1630
|
-
if (!
|
|
1629
|
+
const a = await fetch(`${e}?f=json`);
|
|
1630
|
+
if (!a.ok)
|
|
1631
1631
|
return null;
|
|
1632
|
-
const l = await
|
|
1632
|
+
const l = await a.json();
|
|
1633
1633
|
return l.drawingInfo ? {
|
|
1634
1634
|
drawingInfo: l.drawingInfo,
|
|
1635
1635
|
description: l.description
|
|
@@ -1639,7 +1639,7 @@ async function da(e) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
1641
|
function Dt(e) {
|
|
1642
|
-
const
|
|
1642
|
+
const a = {
|
|
1643
1643
|
id: e.id,
|
|
1644
1644
|
title: e.title,
|
|
1645
1645
|
type: e.type,
|
|
@@ -1649,11 +1649,11 @@ function Dt(e) {
|
|
|
1649
1649
|
legend: e.legend,
|
|
1650
1650
|
popup: e.popup
|
|
1651
1651
|
};
|
|
1652
|
-
return e.where && (
|
|
1652
|
+
return e.where && (a.where = e.where), e.minZoom !== void 0 && (a.minZoom = e.minZoom), e.maxZoom !== void 0 && (a.maxZoom = e.maxZoom), e.outlinePaint && (a.outlinePaint = e.outlinePaint), e.parentId && (a.parentId = e.parentId), a;
|
|
1653
1653
|
}
|
|
1654
1654
|
async function Nt(e) {
|
|
1655
|
-
const
|
|
1656
|
-
for (const r of
|
|
1655
|
+
const a = e.operationalLayers || [], l = [], o = ["Zoning and Planning_Land Use"];
|
|
1656
|
+
for (const r of a)
|
|
1657
1657
|
if (r.url && !r.title?.toLowerCase().includes("(under construction)") && !(r.url && /\/MapServer(\/\d+)?$/i.test(r.url)))
|
|
1658
1658
|
try {
|
|
1659
1659
|
let n = r.layerDefinition?.drawingInfo, u;
|
|
@@ -1664,15 +1664,15 @@ async function Nt(e) {
|
|
|
1664
1664
|
if (n = O.drawingInfo, C && Me(C) && n?.renderer) {
|
|
1665
1665
|
const D = n.renderer, te = D.uniqueValueInfos?.[0]?.symbol?.outline || D.defaultSymbol?.outline;
|
|
1666
1666
|
if (!Me(te)) {
|
|
1667
|
-
for (const
|
|
1668
|
-
|
|
1667
|
+
for (const W of D.uniqueValueInfos || [])
|
|
1668
|
+
W.symbol && (W.symbol.outline = C);
|
|
1669
1669
|
D.defaultSymbol && (D.defaultSymbol.outline = C);
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
O.description && (u = ua(O.description), u.size > 0);
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
|
-
const { paint: y, legend: h, geomType:
|
|
1675
|
+
const { paint: y, legend: h, geomType: i, outlinePaint: g, splitLayers: d } = la(
|
|
1676
1676
|
n,
|
|
1677
1677
|
r.opacity,
|
|
1678
1678
|
u,
|
|
@@ -1684,7 +1684,7 @@ async function Nt(e) {
|
|
|
1684
1684
|
l.push(Dt({
|
|
1685
1685
|
id: D,
|
|
1686
1686
|
title: V,
|
|
1687
|
-
type:
|
|
1687
|
+
type: i,
|
|
1688
1688
|
url: r.url,
|
|
1689
1689
|
opacity: T,
|
|
1690
1690
|
paint: O.paint,
|
|
@@ -1700,7 +1700,7 @@ async function Nt(e) {
|
|
|
1700
1700
|
l.push(Dt({
|
|
1701
1701
|
id: F,
|
|
1702
1702
|
title: V,
|
|
1703
|
-
type:
|
|
1703
|
+
type: i,
|
|
1704
1704
|
url: r.url,
|
|
1705
1705
|
opacity: T,
|
|
1706
1706
|
paint: y,
|
|
@@ -1716,9 +1716,9 @@ async function Nt(e) {
|
|
|
1716
1716
|
return l.sort((r, n) => r.title.localeCompare(n.title)), l;
|
|
1717
1717
|
}
|
|
1718
1718
|
const _t = {}, St = "376af635c84643cd816a8c5d017a53aa", Ja = St;
|
|
1719
|
-
function Ct(e,
|
|
1719
|
+
function Ct(e, a) {
|
|
1720
1720
|
let l = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
|
|
1721
|
-
return
|
|
1721
|
+
return a && (l += `&token=${a}`), l;
|
|
1722
1722
|
}
|
|
1723
1723
|
function Ka() {
|
|
1724
1724
|
return Ct(St);
|
|
@@ -1729,8 +1729,8 @@ function fa(e) {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
let ot, Rt = 0;
|
|
1731
1731
|
async function pa() {
|
|
1732
|
-
const e = typeof import.meta < "u" && _t?.VITE_AGO_USERNAME,
|
|
1733
|
-
if (!(!e || !
|
|
1732
|
+
const e = typeof import.meta < "u" && _t?.VITE_AGO_USERNAME, a = typeof import.meta < "u" && _t?.VITE_AGO_PASSWORD;
|
|
1733
|
+
if (!(!e || !a)) {
|
|
1734
1734
|
if (ot && Date.now() < Rt - 3e5)
|
|
1735
1735
|
return ot;
|
|
1736
1736
|
try {
|
|
@@ -1742,7 +1742,7 @@ async function pa() {
|
|
|
1742
1742
|
body: new URLSearchParams({
|
|
1743
1743
|
f: "json",
|
|
1744
1744
|
username: e,
|
|
1745
|
-
password:
|
|
1745
|
+
password: a,
|
|
1746
1746
|
referer: window.location.origin || "https://localhost",
|
|
1747
1747
|
expiration: "120"
|
|
1748
1748
|
// 2 hours
|
|
@@ -1754,8 +1754,8 @@ async function pa() {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
async function ya(e,
|
|
1758
|
-
const l = Ct(e,
|
|
1757
|
+
async function ya(e, a) {
|
|
1758
|
+
const l = Ct(e, a), o = await fetch(l, { cache: "no-store" });
|
|
1759
1759
|
if (!o.ok)
|
|
1760
1760
|
throw new Error(`Failed to fetch WebMap: ${o.status} ${o.statusText}`);
|
|
1761
1761
|
const r = await o.json();
|
|
@@ -1765,18 +1765,18 @@ async function ya(e, i) {
|
|
|
1765
1765
|
}
|
|
1766
1766
|
async function ma(e) {
|
|
1767
1767
|
try {
|
|
1768
|
-
const
|
|
1768
|
+
const a = await pa(), l = await ya(e, a);
|
|
1769
1769
|
return await Nt(l);
|
|
1770
|
-
} catch (
|
|
1770
|
+
} catch (a) {
|
|
1771
1771
|
throw new Error(
|
|
1772
|
-
`Failed to load dynamic layer configs: ${
|
|
1772
|
+
`Failed to load dynamic layer configs: ${a instanceof Error ? a.message : "Unknown error"}`
|
|
1773
1773
|
);
|
|
1774
1774
|
}
|
|
1775
1775
|
}
|
|
1776
1776
|
async function vt(e = St) {
|
|
1777
|
-
const
|
|
1778
|
-
if (
|
|
1779
|
-
return
|
|
1777
|
+
const a = nt.get(e);
|
|
1778
|
+
if (a)
|
|
1779
|
+
return a;
|
|
1780
1780
|
const l = He.get(e);
|
|
1781
1781
|
if (l)
|
|
1782
1782
|
return l;
|
|
@@ -1791,52 +1791,52 @@ async function vt(e = St) {
|
|
|
1791
1791
|
return He.set(e, o), o;
|
|
1792
1792
|
}
|
|
1793
1793
|
function ha(e) {
|
|
1794
|
-
const
|
|
1795
|
-
for (const
|
|
1796
|
-
|
|
1794
|
+
const a = k({}), l = /* @__PURE__ */ new Map();
|
|
1795
|
+
for (const i of e)
|
|
1796
|
+
a.value[i.id] = {
|
|
1797
1797
|
data: null,
|
|
1798
1798
|
loading: !1,
|
|
1799
1799
|
error: null,
|
|
1800
1800
|
lastFetched: null
|
|
1801
1801
|
};
|
|
1802
|
-
async function o(
|
|
1803
|
-
const g =
|
|
1804
|
-
|
|
1805
|
-
...
|
|
1802
|
+
async function o(i) {
|
|
1803
|
+
const g = i.id;
|
|
1804
|
+
a.value = {
|
|
1805
|
+
...a.value,
|
|
1806
1806
|
[g]: {
|
|
1807
|
-
data:
|
|
1808
|
-
lastFetched:
|
|
1807
|
+
data: a.value[g]?.data ?? null,
|
|
1808
|
+
lastFetched: a.value[g]?.lastFetched ?? null,
|
|
1809
1809
|
loading: !0,
|
|
1810
1810
|
error: null
|
|
1811
1811
|
}
|
|
1812
1812
|
};
|
|
1813
1813
|
try {
|
|
1814
1814
|
let d;
|
|
1815
|
-
if (
|
|
1816
|
-
const L = await fetch(
|
|
1815
|
+
if (i.type === "http-get") {
|
|
1816
|
+
const L = await fetch(i.url, {
|
|
1817
1817
|
method: "GET",
|
|
1818
|
-
...
|
|
1818
|
+
...i.options
|
|
1819
1819
|
});
|
|
1820
1820
|
if (!L.ok)
|
|
1821
1821
|
throw new Error(`HTTP ${L.status}: ${L.statusText}`);
|
|
1822
1822
|
d = await L.json();
|
|
1823
|
-
} else if (
|
|
1824
|
-
const L = await fetch(
|
|
1823
|
+
} else if (i.type === "http-post") {
|
|
1824
|
+
const L = await fetch(i.url, {
|
|
1825
1825
|
method: "POST",
|
|
1826
|
-
...
|
|
1826
|
+
...i.options
|
|
1827
1827
|
});
|
|
1828
1828
|
if (!L.ok)
|
|
1829
1829
|
throw new Error(`HTTP ${L.status}: ${L.statusText}`);
|
|
1830
1830
|
d = await L.json();
|
|
1831
|
-
} else if (
|
|
1832
|
-
const S = `${
|
|
1831
|
+
} else if (i.type === "esri") {
|
|
1832
|
+
const S = `${i.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, I = await fetch(S, i.options);
|
|
1833
1833
|
if (!I.ok)
|
|
1834
1834
|
throw new Error(`HTTP ${I.status}: ${I.statusText}`);
|
|
1835
1835
|
d = (await I.json()).features?.map((V) => V.attributes) || [];
|
|
1836
1836
|
} else
|
|
1837
|
-
throw new Error(`Unknown data source type: ${
|
|
1838
|
-
|
|
1839
|
-
...
|
|
1837
|
+
throw new Error(`Unknown data source type: ${i.type}`);
|
|
1838
|
+
i.transform && (d = i.transform(d)), a.value = {
|
|
1839
|
+
...a.value,
|
|
1840
1840
|
[g]: {
|
|
1841
1841
|
data: d,
|
|
1842
1842
|
loading: !1,
|
|
@@ -1846,11 +1846,11 @@ function ha(e) {
|
|
|
1846
1846
|
};
|
|
1847
1847
|
} catch (d) {
|
|
1848
1848
|
const L = d instanceof Error ? d.message : "Unknown error";
|
|
1849
|
-
|
|
1850
|
-
...
|
|
1849
|
+
a.value = {
|
|
1850
|
+
...a.value,
|
|
1851
1851
|
[g]: {
|
|
1852
|
-
data:
|
|
1853
|
-
lastFetched:
|
|
1852
|
+
data: a.value[g]?.data ?? null,
|
|
1853
|
+
lastFetched: a.value[g]?.lastFetched ?? null,
|
|
1854
1854
|
loading: !1,
|
|
1855
1855
|
error: L
|
|
1856
1856
|
}
|
|
@@ -1858,34 +1858,34 @@ function ha(e) {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
1860
|
async function r() {
|
|
1861
|
-
await Promise.all(e.map((
|
|
1861
|
+
await Promise.all(e.map((i) => o(i)));
|
|
1862
1862
|
}
|
|
1863
|
-
async function n(
|
|
1864
|
-
const g = e.find((d) => d.id ===
|
|
1863
|
+
async function n(i) {
|
|
1864
|
+
const g = e.find((d) => d.id === i);
|
|
1865
1865
|
g && await o(g);
|
|
1866
1866
|
}
|
|
1867
|
-
function u(
|
|
1868
|
-
return
|
|
1867
|
+
function u(i) {
|
|
1868
|
+
return a.value[i]?.data ?? null;
|
|
1869
1869
|
}
|
|
1870
|
-
const w = _(() => Object.values(
|
|
1871
|
-
function p(
|
|
1872
|
-
return
|
|
1870
|
+
const w = _(() => Object.values(a.value).some((i) => i.loading));
|
|
1871
|
+
function p(i) {
|
|
1872
|
+
return a.value[i]?.loading ?? !1;
|
|
1873
1873
|
}
|
|
1874
|
-
function C(
|
|
1875
|
-
return
|
|
1874
|
+
function C(i) {
|
|
1875
|
+
return a.value[i]?.error ?? null;
|
|
1876
1876
|
}
|
|
1877
1877
|
function y() {
|
|
1878
|
-
for (const
|
|
1879
|
-
if (
|
|
1878
|
+
for (const i of e)
|
|
1879
|
+
if (i.pollInterval && i.pollInterval > 0) {
|
|
1880
1880
|
const g = window.setInterval(() => {
|
|
1881
|
-
o(
|
|
1882
|
-
},
|
|
1883
|
-
l.set(
|
|
1881
|
+
o(i);
|
|
1882
|
+
}, i.pollInterval);
|
|
1883
|
+
l.set(i.id, g);
|
|
1884
1884
|
}
|
|
1885
1885
|
}
|
|
1886
1886
|
function h() {
|
|
1887
|
-
for (const [,
|
|
1888
|
-
window.clearInterval(
|
|
1887
|
+
for (const [, i] of l)
|
|
1888
|
+
window.clearInterval(i);
|
|
1889
1889
|
l.clear();
|
|
1890
1890
|
}
|
|
1891
1891
|
return it(() => {
|
|
@@ -1894,7 +1894,7 @@ function ha(e) {
|
|
|
1894
1894
|
h();
|
|
1895
1895
|
}), {
|
|
1896
1896
|
/** Reactive state for all data sources */
|
|
1897
|
-
state: q(
|
|
1897
|
+
state: q(a),
|
|
1898
1898
|
/** Whether any data source is currently loading */
|
|
1899
1899
|
isLoading: w,
|
|
1900
1900
|
/** Fetch all data sources */
|
|
@@ -1955,8 +1955,8 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
1955
1955
|
initialCenter: { default: void 0 }
|
|
1956
1956
|
},
|
|
1957
1957
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
1958
|
-
setup(e, { expose:
|
|
1959
|
-
const o = e, r = l, n = k([]), u = k(!0), w = k(null), p = k(12), C = k(""), y = k(/* @__PURE__ */ new Set()), h = k({}),
|
|
1958
|
+
setup(e, { expose: a, emit: l }) {
|
|
1959
|
+
const o = e, r = l, n = k([]), u = k(!0), w = k(null), p = k(12), C = k(""), y = k(/* @__PURE__ */ new Set()), h = k({}), i = k(/* @__PURE__ */ new Set()), g = k({}), d = k({}), L = k(/* @__PURE__ */ new Set()), S = k({});
|
|
1960
1960
|
function I() {
|
|
1961
1961
|
const v = {};
|
|
1962
1962
|
for (const x of o.tiledLayers)
|
|
@@ -1973,13 +1973,13 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
1973
1973
|
S.value = { ...S.value, [v]: x };
|
|
1974
1974
|
}
|
|
1975
1975
|
const O = o.dataSources.length > 0 ? ha(o.dataSources) : null, D = _(() => O?.state.value ?? {}), te = _(() => O?.isLoading.value ?? !1);
|
|
1976
|
-
function
|
|
1976
|
+
function W(v) {
|
|
1977
1977
|
return O?.getData(v) ?? null;
|
|
1978
1978
|
}
|
|
1979
1979
|
function fe(v) {
|
|
1980
1980
|
return O?.refetch(v) ?? Promise.resolve();
|
|
1981
1981
|
}
|
|
1982
|
-
|
|
1982
|
+
N("layerboard-layers", q(n)), N("layerboard-visible", y), N("layerboard-opacities", h), N("layerboard-loading", q(i)), N("layerboard-errors", q(g)), N("layerboard-zoom", q(p)), N("layerboard-toggle-layer", ze), N("layerboard-set-layer-visible", We), N("layerboard-set-layers-visible", $e), N("layerboard-set-opacity", Pe), N("layerboard-tiled-layers", q(_(() => o.tiledLayers))), N("layerboard-visible-tiled", L), N("layerboard-tiled-opacities", S), N("layerboard-toggle-tiled", F), N("layerboard-set-tiled-opacity", T), N("layerboard-set-tiled-visible", V), N("layerboard-data-sources-state", D), N("layerboard-data-sources-loading", te), N("layerboard-get-data-source", W), N("layerboard-refetch-data-source", fe);
|
|
1983
1983
|
const ve = _(() => ({
|
|
1984
1984
|
backgroundColor: o.themeColor
|
|
1985
1985
|
})), st = _(() => ({
|
|
@@ -1992,9 +1992,9 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
1992
1992
|
async function Ue() {
|
|
1993
1993
|
try {
|
|
1994
1994
|
u.value = !0, w.value = null;
|
|
1995
|
-
const x = (await vt(o.webMapId)).map((
|
|
1996
|
-
let Q =
|
|
1997
|
-
const Se = o.layerStyleOverrides[
|
|
1995
|
+
const x = (await vt(o.webMapId)).map((Z) => {
|
|
1996
|
+
let Q = Z;
|
|
1997
|
+
const Se = o.layerStyleOverrides[Z.id];
|
|
1998
1998
|
Se && (Q = {
|
|
1999
1999
|
...Q,
|
|
2000
2000
|
paint: Se.paint ?? Q.paint,
|
|
@@ -2002,19 +2002,19 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2002
2002
|
legend: Se.legend ?? Q.legend,
|
|
2003
2003
|
type: Se.type ?? Q.type
|
|
2004
2004
|
});
|
|
2005
|
-
const Ve = o.popupOverrides[
|
|
2005
|
+
const Ve = o.popupOverrides[Z.id] || (Z.parentId ? o.popupOverrides[Z.parentId] : void 0);
|
|
2006
2006
|
return Ve && Q.popup && (Q = {
|
|
2007
2007
|
...Q,
|
|
2008
2008
|
popup: { ...Q.popup, ...Ve }
|
|
2009
2009
|
}), Q;
|
|
2010
2010
|
});
|
|
2011
|
-
n.value = x.map((
|
|
2012
|
-
config:
|
|
2013
|
-
component:
|
|
2011
|
+
n.value = x.map((Z) => ({
|
|
2012
|
+
config: Z,
|
|
2013
|
+
component: Z.type
|
|
2014
2014
|
}));
|
|
2015
2015
|
const K = {};
|
|
2016
|
-
x.forEach((
|
|
2017
|
-
K[
|
|
2016
|
+
x.forEach((Z) => {
|
|
2017
|
+
K[Z.id] = Z.opacity ?? 1;
|
|
2018
2018
|
}), h.value = K, r("configs-loaded", x);
|
|
2019
2019
|
} catch (v) {
|
|
2020
2020
|
const x = v instanceof Error ? v.message : "Failed to load layer configurations";
|
|
@@ -2030,13 +2030,13 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2030
2030
|
"select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
|
|
2031
2031
|
), x = await fetch(v);
|
|
2032
2032
|
if (!x.ok) return;
|
|
2033
|
-
const K = await x.json(),
|
|
2033
|
+
const K = await x.json(), Z = {};
|
|
2034
2034
|
for (const Q of K.rows || [])
|
|
2035
2035
|
if (Q.url_text && Q.representation) {
|
|
2036
2036
|
const Se = Vt(Q.url_text), Ve = `https://metadata.phila.gov/#home/representationdetails/${Q.representation}/`;
|
|
2037
|
-
|
|
2037
|
+
Z[Se] = Ve;
|
|
2038
2038
|
}
|
|
2039
|
-
d.value =
|
|
2039
|
+
d.value = Z;
|
|
2040
2040
|
} catch {
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
@@ -2058,7 +2058,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2058
2058
|
h.value = { ...h.value, [v]: x };
|
|
2059
2059
|
}
|
|
2060
2060
|
function je(v, x) {
|
|
2061
|
-
x ?
|
|
2061
|
+
x ? i.value.add(v) : i.value.delete(v), i.value = new Set(i.value);
|
|
2062
2062
|
}
|
|
2063
2063
|
function ut(v, x) {
|
|
2064
2064
|
if (x)
|
|
@@ -2118,8 +2118,8 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2118
2118
|
)
|
|
2119
2119
|
);
|
|
2120
2120
|
if (x.length === 0) return;
|
|
2121
|
-
const K = x[0],
|
|
2122
|
-
v.shiftKey ? document.activeElement === K && (v.preventDefault(),
|
|
2121
|
+
const K = x[0], Z = x[x.length - 1];
|
|
2122
|
+
v.shiftKey ? document.activeElement === K && (v.preventDefault(), Z.focus()) : document.activeElement === Z && (v.preventDefault(), K.focus());
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
2125
|
function ft(v) {
|
|
@@ -2134,11 +2134,11 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2134
2134
|
)
|
|
2135
2135
|
);
|
|
2136
2136
|
if (x.length === 0) return;
|
|
2137
|
-
const K = x[0],
|
|
2138
|
-
v.shiftKey ? document.activeElement === K && (v.preventDefault(),
|
|
2137
|
+
const K = x[0], Z = x[x.length - 1];
|
|
2138
|
+
v.shiftKey ? document.activeElement === K && (v.preventDefault(), Z.focus()) : document.activeElement === Z && (v.preventDefault(), K.focus());
|
|
2139
2139
|
}
|
|
2140
2140
|
}
|
|
2141
|
-
|
|
2141
|
+
N("layerboard-open-modal", Re), N("layerboard-close-modal", re), N("layerboard-is-modal-open", q(ne)), a({
|
|
2142
2142
|
/** Layer configurations */
|
|
2143
2143
|
layerList: n,
|
|
2144
2144
|
/** Set of visible layer IDs */
|
|
@@ -2146,7 +2146,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2146
2146
|
/** Layer opacity values */
|
|
2147
2147
|
layerOpacities: h,
|
|
2148
2148
|
/** Set of currently loading layer IDs */
|
|
2149
|
-
loadingLayers:
|
|
2149
|
+
loadingLayers: i,
|
|
2150
2150
|
/** Map of layer errors by ID */
|
|
2151
2151
|
layerErrors: g,
|
|
2152
2152
|
/** Current map zoom level */
|
|
@@ -2180,7 +2180,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2180
2180
|
/** Whether any data source is loading */
|
|
2181
2181
|
dataSourcesLoading: te,
|
|
2182
2182
|
/** Get data from a specific data source */
|
|
2183
|
-
getDataSourceData:
|
|
2183
|
+
getDataSourceData: W,
|
|
2184
2184
|
/** Refetch a specific data source */
|
|
2185
2185
|
refetchDataSource: fe,
|
|
2186
2186
|
// Modal APIs
|
|
@@ -2308,7 +2308,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2308
2308
|
layers: n.value,
|
|
2309
2309
|
visibleLayers: y.value,
|
|
2310
2310
|
layerOpacities: h.value,
|
|
2311
|
-
loadingLayers:
|
|
2311
|
+
loadingLayers: i.value,
|
|
2312
2312
|
layerErrors: g.value,
|
|
2313
2313
|
currentZoom: p.value,
|
|
2314
2314
|
toggleLayer: ze,
|
|
@@ -2323,7 +2323,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2323
2323
|
setTiledLayerOpacity: T,
|
|
2324
2324
|
dataSourcesState: D.value,
|
|
2325
2325
|
dataSourcesLoading: te.value,
|
|
2326
|
-
getDataSource:
|
|
2326
|
+
getDataSource: W,
|
|
2327
2327
|
refetchDataSource: fe
|
|
2328
2328
|
}, () => [
|
|
2329
2329
|
e.showDefaultSidebar ? (m(), G(Ko, {
|
|
@@ -2331,7 +2331,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2331
2331
|
"layer-list": n.value,
|
|
2332
2332
|
"visible-layers": y.value,
|
|
2333
2333
|
"layer-opacities": h.value,
|
|
2334
|
-
"loading-layers":
|
|
2334
|
+
"loading-layers": i.value,
|
|
2335
2335
|
"layer-errors": g.value,
|
|
2336
2336
|
"current-zoom": p.value,
|
|
2337
2337
|
"search-query": C.value,
|
|
@@ -2439,7 +2439,7 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2439
2439
|
P("span", Ma, H(Le.value === "sidebar" ? "Showing layers panel" : "Showing map"), 1)
|
|
2440
2440
|
]));
|
|
2441
2441
|
}
|
|
2442
|
-
}), Qa = /* @__PURE__ */ xe(Pa, [["__scopeId", "data-v-
|
|
2442
|
+
}), Qa = /* @__PURE__ */ xe(Pa, [["__scopeId", "data-v-b6c04107"]]), Fa = ["aria-expanded"], Ta = {
|
|
2443
2443
|
key: 0,
|
|
2444
2444
|
class: "topic-icon"
|
|
2445
2445
|
}, Ia = { class: "topic-title" }, Ea = /* @__PURE__ */ ge({
|
|
@@ -2452,8 +2452,8 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2452
2452
|
headerClass: { default: void 0 }
|
|
2453
2453
|
},
|
|
2454
2454
|
emits: ["toggle", "layerChange"],
|
|
2455
|
-
setup(e, { emit:
|
|
2456
|
-
const l = e, o =
|
|
2455
|
+
setup(e, { emit: a }) {
|
|
2456
|
+
const l = e, o = a, r = k(l.expanded), n = `topic-panel-${Pt()}`, u = `topic-header-${Pt()}`;
|
|
2457
2457
|
Ee(
|
|
2458
2458
|
() => l.expanded,
|
|
2459
2459
|
(p) => {
|
|
@@ -2524,11 +2524,11 @@ const ga = { class: "layerboard-layout" }, va = ["aria-expanded"], ba = {
|
|
|
2524
2524
|
function Oa(e) {
|
|
2525
2525
|
return e.displayOptions?.shouldShowCheckbox !== !1;
|
|
2526
2526
|
}
|
|
2527
|
-
function Ut(e,
|
|
2528
|
-
return
|
|
2527
|
+
function Ut(e, a) {
|
|
2528
|
+
return a ? e.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
2529
2529
|
}
|
|
2530
|
-
function Wt(e,
|
|
2531
|
-
return
|
|
2530
|
+
function Wt(e, a) {
|
|
2531
|
+
return a ? e.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
2532
2532
|
}
|
|
2533
2533
|
function Oe(e) {
|
|
2534
2534
|
return e.displayOptions?.layerNameChange || e.title;
|
|
@@ -2550,8 +2550,8 @@ const za = ["aria-label"], Da = ["checked", "disabled", "onChange"], _a = { clas
|
|
|
2550
2550
|
groupLabel: { default: void 0 }
|
|
2551
2551
|
},
|
|
2552
2552
|
emits: ["toggleLayer", "setOpacity"],
|
|
2553
|
-
setup(e, { emit:
|
|
2554
|
-
const l = e, o =
|
|
2553
|
+
setup(e, { emit: a }) {
|
|
2554
|
+
const l = e, o = a, { isVisible: r, getLayerOpacity: n, isLayerLoading: u, getLayerError: w, isLayerAvailableAtZoom: p } = Lt(
|
|
2555
2555
|
() => l
|
|
2556
2556
|
);
|
|
2557
2557
|
function C(y) {
|
|
@@ -2562,58 +2562,58 @@ const za = ["aria-label"], Da = ["checked", "disabled", "onChange"], _a = { clas
|
|
|
2562
2562
|
role: "group",
|
|
2563
2563
|
"aria-label": e.groupLabel
|
|
2564
2564
|
}, [
|
|
2565
|
-
(m(!0), M(de, null, we(e.layers, (
|
|
2566
|
-
key:
|
|
2565
|
+
(m(!0), M(de, null, we(e.layers, (i) => (m(), M("div", {
|
|
2566
|
+
key: i.id,
|
|
2567
2567
|
class: "layer-item"
|
|
2568
2568
|
}, [
|
|
2569
|
-
f(Oa)(
|
|
2569
|
+
f(Oa)(i) ? (m(), M("label", {
|
|
2570
2570
|
key: 0,
|
|
2571
2571
|
class: se(["layer-checkbox", {
|
|
2572
|
-
"layer-unavailable": !f(p)(
|
|
2573
|
-
"layer-error": f(w)(
|
|
2572
|
+
"layer-unavailable": !f(p)(i),
|
|
2573
|
+
"layer-error": f(w)(i.id)
|
|
2574
2574
|
}])
|
|
2575
2575
|
}, [
|
|
2576
2576
|
P("input", {
|
|
2577
2577
|
type: "checkbox",
|
|
2578
|
-
checked: f(r)(
|
|
2579
|
-
disabled: !f(p)(
|
|
2580
|
-
onChange: (g) => C(
|
|
2578
|
+
checked: f(r)(i.id),
|
|
2579
|
+
disabled: !f(p)(i),
|
|
2580
|
+
onChange: (g) => C(i.id)
|
|
2581
2581
|
}, null, 40, Da),
|
|
2582
2582
|
P("span", _a, [
|
|
2583
|
-
ke(H(f(Oe)(
|
|
2583
|
+
ke(H(f(Oe)(i)) + " ", 1),
|
|
2584
2584
|
J(lt, {
|
|
2585
|
-
loading: f(u)(
|
|
2586
|
-
error: f(w)(
|
|
2587
|
-
unavailable: !f(p)(
|
|
2585
|
+
loading: f(u)(i.id),
|
|
2586
|
+
error: f(w)(i.id),
|
|
2587
|
+
unavailable: !f(p)(i)
|
|
2588
2588
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
2589
2589
|
])
|
|
2590
2590
|
], 2)) : (m(), M("div", {
|
|
2591
2591
|
key: 1,
|
|
2592
2592
|
class: se(["layer-label-only", {
|
|
2593
|
-
"layer-unavailable": !f(p)(
|
|
2594
|
-
"layer-error": f(w)(
|
|
2593
|
+
"layer-unavailable": !f(p)(i),
|
|
2594
|
+
"layer-error": f(w)(i.id)
|
|
2595
2595
|
}])
|
|
2596
2596
|
}, [
|
|
2597
2597
|
P("span", Ra, [
|
|
2598
|
-
ke(H(f(Oe)(
|
|
2598
|
+
ke(H(f(Oe)(i)) + " ", 1),
|
|
2599
2599
|
J(lt, {
|
|
2600
|
-
loading: f(u)(
|
|
2601
|
-
error: f(w)(
|
|
2602
|
-
unavailable: !f(p)(
|
|
2600
|
+
loading: f(u)(i.id),
|
|
2601
|
+
error: f(w)(i.id),
|
|
2602
|
+
unavailable: !f(p)(i)
|
|
2603
2603
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
2604
2604
|
])
|
|
2605
2605
|
], 2)),
|
|
2606
|
-
f(Ut)(
|
|
2606
|
+
f(Ut)(i, e.showOpacity) && f(r)(i.id) && f(p)(i) ? (m(), G(bt, {
|
|
2607
2607
|
key: 2,
|
|
2608
|
-
"layer-id":
|
|
2609
|
-
"layer-name": f(Oe)(
|
|
2610
|
-
opacity: f(n)(
|
|
2611
|
-
"onUpdate:opacity": (g) => o("setOpacity",
|
|
2608
|
+
"layer-id": i.id,
|
|
2609
|
+
"layer-name": f(Oe)(i),
|
|
2610
|
+
opacity: f(n)(i.id),
|
|
2611
|
+
"onUpdate:opacity": (g) => o("setOpacity", i.id, g)
|
|
2612
2612
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : R("", !0),
|
|
2613
|
-
f(Wt)(
|
|
2613
|
+
f(Wt)(i, e.showLegend) && f(r)(i.id) && f(p)(i) && i.legend?.length ? (m(), G(wt, {
|
|
2614
2614
|
key: 3,
|
|
2615
|
-
items:
|
|
2616
|
-
label: "Legend for " + f(Oe)(
|
|
2615
|
+
items: i.legend,
|
|
2616
|
+
label: "Legend for " + f(Oe)(i)
|
|
2617
2617
|
}, null, 8, ["items", "label"])) : R("", !0)
|
|
2618
2618
|
]))), 128)),
|
|
2619
2619
|
e.layers.length === 0 ? (m(), M("div", Aa, "No layers available")) : R("", !0)
|
|
@@ -2637,12 +2637,12 @@ const za = ["aria-label"], Da = ["checked", "disabled", "onChange"], _a = { clas
|
|
|
2637
2637
|
groupLabel: { default: void 0 }
|
|
2638
2638
|
},
|
|
2639
2639
|
emits: ["selectLayer", "setOpacity"],
|
|
2640
|
-
setup(e, { emit:
|
|
2641
|
-
const l = e, o =
|
|
2640
|
+
setup(e, { emit: a }) {
|
|
2641
|
+
const l = e, o = a, { isVisible: r, getLayerOpacity: n, isLayerLoading: u, getLayerError: w, isLayerAvailableAtZoom: p } = Lt(
|
|
2642
2642
|
() => l
|
|
2643
2643
|
);
|
|
2644
2644
|
function C(y) {
|
|
2645
|
-
const h = l.layers.filter((
|
|
2645
|
+
const h = l.layers.filter((i) => l.visibleLayerIds.has(i.id) && i.id !== y).map((i) => i.id);
|
|
2646
2646
|
o("selectLayer", y, h);
|
|
2647
2647
|
}
|
|
2648
2648
|
return (y, h) => (m(), M("div", {
|
|
@@ -2650,43 +2650,43 @@ const za = ["aria-label"], Da = ["checked", "disabled", "onChange"], _a = { clas
|
|
|
2650
2650
|
role: "radiogroup",
|
|
2651
2651
|
"aria-label": e.groupLabel
|
|
2652
2652
|
}, [
|
|
2653
|
-
(m(!0), M(de, null, we(e.layers, (
|
|
2654
|
-
key:
|
|
2653
|
+
(m(!0), M(de, null, we(e.layers, (i) => (m(), M("div", {
|
|
2654
|
+
key: i.id,
|
|
2655
2655
|
class: "layer-item"
|
|
2656
2656
|
}, [
|
|
2657
2657
|
P("label", {
|
|
2658
2658
|
class: se(["layer-radio", {
|
|
2659
|
-
"layer-unavailable": !f(p)(
|
|
2660
|
-
"layer-error": f(w)(
|
|
2659
|
+
"layer-unavailable": !f(p)(i),
|
|
2660
|
+
"layer-error": f(w)(i.id)
|
|
2661
2661
|
}])
|
|
2662
2662
|
}, [
|
|
2663
2663
|
P("input", {
|
|
2664
2664
|
type: "radio",
|
|
2665
2665
|
name: e.groupName,
|
|
2666
|
-
checked: f(r)(
|
|
2667
|
-
disabled: !f(p)(
|
|
2668
|
-
onChange: (g) => C(
|
|
2666
|
+
checked: f(r)(i.id),
|
|
2667
|
+
disabled: !f(p)(i),
|
|
2668
|
+
onChange: (g) => C(i.id)
|
|
2669
2669
|
}, null, 40, Za),
|
|
2670
2670
|
P("span", Na, [
|
|
2671
|
-
ke(H(f(Oe)(
|
|
2671
|
+
ke(H(f(Oe)(i)) + " ", 1),
|
|
2672
2672
|
J(lt, {
|
|
2673
|
-
loading: f(u)(
|
|
2674
|
-
error: f(w)(
|
|
2675
|
-
unavailable: !f(p)(
|
|
2673
|
+
loading: f(u)(i.id),
|
|
2674
|
+
error: f(w)(i.id),
|
|
2675
|
+
unavailable: !f(p)(i)
|
|
2676
2676
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
2677
2677
|
])
|
|
2678
2678
|
], 2),
|
|
2679
|
-
f(Ut)(
|
|
2679
|
+
f(Ut)(i, e.showOpacity) && f(r)(i.id) && f(p)(i) ? (m(), G(bt, {
|
|
2680
2680
|
key: 0,
|
|
2681
|
-
"layer-id":
|
|
2682
|
-
"layer-name": f(Oe)(
|
|
2683
|
-
opacity: f(n)(
|
|
2684
|
-
"onUpdate:opacity": (g) => o("setOpacity",
|
|
2681
|
+
"layer-id": i.id,
|
|
2682
|
+
"layer-name": f(Oe)(i),
|
|
2683
|
+
opacity: f(n)(i.id),
|
|
2684
|
+
"onUpdate:opacity": (g) => o("setOpacity", i.id, g)
|
|
2685
2685
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : R("", !0),
|
|
2686
|
-
f(Wt)(
|
|
2686
|
+
f(Wt)(i, e.showLegend) && f(r)(i.id) && f(p)(i) && i.legend?.length ? (m(), G(wt, {
|
|
2687
2687
|
key: 1,
|
|
2688
|
-
items:
|
|
2689
|
-
label: "Legend for " + f(Oe)(
|
|
2688
|
+
items: i.legend,
|
|
2689
|
+
label: "Legend for " + f(Oe)(i)
|
|
2690
2690
|
}, null, 8, ["items", "label"])) : R("", !0)
|
|
2691
2691
|
]))), 128)),
|
|
2692
2692
|
e.layers.length === 0 ? (m(), M("div", Ua, "No layers available")) : R("", !0)
|
|
@@ -2694,22 +2694,22 @@ const za = ["aria-label"], Da = ["checked", "disabled", "onChange"], _a = { clas
|
|
|
2694
2694
|
}
|
|
2695
2695
|
}), ei = /* @__PURE__ */ xe(Wa, [["__scopeId", "data-v-c368d815"]]);
|
|
2696
2696
|
function ti(e) {
|
|
2697
|
-
const
|
|
2697
|
+
const a = k([]), l = k(/* @__PURE__ */ new Set()), o = k({}), r = k(/* @__PURE__ */ new Set()), n = k({}), u = k(""), w = k(!1), p = k(!1), C = k(null), y = _(() => {
|
|
2698
2698
|
if (!u.value.trim())
|
|
2699
|
-
return
|
|
2699
|
+
return a.value;
|
|
2700
2700
|
const T = u.value.toLowerCase();
|
|
2701
|
-
return
|
|
2702
|
-
}), h = _(() =>
|
|
2701
|
+
return a.value.filter((O) => O.title.toLowerCase().includes(T));
|
|
2702
|
+
}), h = _(() => a.value.map((T) => ({
|
|
2703
2703
|
config: T,
|
|
2704
2704
|
component: T.type
|
|
2705
2705
|
// "circle", "fill", or "line"
|
|
2706
2706
|
})));
|
|
2707
|
-
async function
|
|
2707
|
+
async function i() {
|
|
2708
2708
|
if (!p.value) {
|
|
2709
2709
|
w.value = !0, C.value = null;
|
|
2710
2710
|
try {
|
|
2711
2711
|
let T;
|
|
2712
|
-
e.mode === "dynamic" || !e.mode ? e.webMapId ? T = await g(e.webMapId) : T = await vt() : T = await vt(),
|
|
2712
|
+
e.mode === "dynamic" || !e.mode ? e.webMapId ? T = await g(e.webMapId) : T = await vt() : T = await vt(), a.value = T;
|
|
2713
2713
|
const O = {};
|
|
2714
2714
|
T.forEach((D) => {
|
|
2715
2715
|
O[D.id] = D.opacity ?? 1;
|
|
@@ -2754,11 +2754,11 @@ function ti(e) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
2756
|
function V() {
|
|
2757
|
-
|
|
2757
|
+
a.value = [], l.value = /* @__PURE__ */ new Set(), o.value = {}, r.value = /* @__PURE__ */ new Set(), n.value = {}, u.value = "", w.value = !1, p.value = !1, C.value = null;
|
|
2758
2758
|
}
|
|
2759
2759
|
return {
|
|
2760
2760
|
// State (readonly)
|
|
2761
|
-
layerConfigs: q(
|
|
2761
|
+
layerConfigs: q(a),
|
|
2762
2762
|
visibleLayers: q(l),
|
|
2763
2763
|
layerOpacities: q(o),
|
|
2764
2764
|
loadingLayers: q(r),
|
|
@@ -2773,7 +2773,7 @@ function ti(e) {
|
|
|
2773
2773
|
// Config
|
|
2774
2774
|
config: e,
|
|
2775
2775
|
// Methods
|
|
2776
|
-
initialize:
|
|
2776
|
+
initialize: i,
|
|
2777
2777
|
toggleLayer: d,
|
|
2778
2778
|
setLayerOpacity: L,
|
|
2779
2779
|
filterLayers: S,
|
|
@@ -2783,29 +2783,29 @@ function ti(e) {
|
|
|
2783
2783
|
};
|
|
2784
2784
|
}
|
|
2785
2785
|
function oi() {
|
|
2786
|
-
const e = k([]),
|
|
2786
|
+
const e = k([]), a = k(/* @__PURE__ */ new Set()), l = k(/* @__PURE__ */ new Set());
|
|
2787
2787
|
function o(n) {
|
|
2788
|
-
|
|
2788
|
+
a.value.has(n) ? a.value.delete(n) : a.value.add(n);
|
|
2789
2789
|
}
|
|
2790
2790
|
function r(n) {
|
|
2791
2791
|
e.value = n;
|
|
2792
2792
|
}
|
|
2793
2793
|
return {
|
|
2794
2794
|
layers: _(() => e.value),
|
|
2795
|
-
visibleLayerIds: _(() =>
|
|
2795
|
+
visibleLayerIds: _(() => a.value),
|
|
2796
2796
|
loadingLayerIds: _(() => l.value),
|
|
2797
2797
|
toggleLayer: o,
|
|
2798
2798
|
setLayers: r
|
|
2799
2799
|
};
|
|
2800
2800
|
}
|
|
2801
2801
|
function ja(e) {
|
|
2802
|
-
const
|
|
2802
|
+
const a = k(null), l = k(!1), o = k(null), r = k(0);
|
|
2803
2803
|
async function n(p = {}) {
|
|
2804
2804
|
l.value = !0, o.value = null;
|
|
2805
2805
|
const C = e.pageSize || 2e3;
|
|
2806
|
-
let y = 0, h = [],
|
|
2806
|
+
let y = 0, h = [], i = !0;
|
|
2807
2807
|
try {
|
|
2808
|
-
for (;
|
|
2808
|
+
for (; i; ) {
|
|
2809
2809
|
const d = e.url.replace(/\/$/, ""), L = encodeURIComponent(p.where || e.where || "1=1");
|
|
2810
2810
|
let S = `${d}/query?where=${L}&outFields=*&returnGeometry=true&resultRecordCount=${C}&resultOffset=${y}&f=geojson`;
|
|
2811
2811
|
if (p.bounds) {
|
|
@@ -2822,13 +2822,13 @@ function ja(e) {
|
|
|
2822
2822
|
if (!I.ok)
|
|
2823
2823
|
throw new Error(`HTTP ${I.status}: ${I.statusText}`);
|
|
2824
2824
|
const F = await I.json();
|
|
2825
|
-
F.features && F.features.length > 0 ? (h = h.concat(F.features), y += F.features.length,
|
|
2825
|
+
F.features && F.features.length > 0 ? (h = h.concat(F.features), y += F.features.length, i = F.features.length === C) : i = !1;
|
|
2826
2826
|
}
|
|
2827
2827
|
const g = {
|
|
2828
2828
|
type: "FeatureCollection",
|
|
2829
2829
|
features: h
|
|
2830
2830
|
};
|
|
2831
|
-
return
|
|
2831
|
+
return a.value = g, r.value = h.length, g;
|
|
2832
2832
|
} catch (g) {
|
|
2833
2833
|
const d = g instanceof Error ? g : new Error("Failed to fetch features");
|
|
2834
2834
|
throw o.value = d, d;
|
|
@@ -2837,14 +2837,14 @@ function ja(e) {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
2839
|
function u() {
|
|
2840
|
-
|
|
2840
|
+
a.value = null, r.value = 0, o.value = null;
|
|
2841
2841
|
}
|
|
2842
2842
|
async function w(p = {}) {
|
|
2843
2843
|
return n(p);
|
|
2844
2844
|
}
|
|
2845
2845
|
return {
|
|
2846
2846
|
// State (readonly)
|
|
2847
|
-
data: q(
|
|
2847
|
+
data: q(a),
|
|
2848
2848
|
isLoading: q(l),
|
|
2849
2849
|
error: q(o),
|
|
2850
2850
|
totalFeatures: q(r),
|
|
@@ -2856,10 +2856,10 @@ function ja(e) {
|
|
|
2856
2856
|
clear: u
|
|
2857
2857
|
};
|
|
2858
2858
|
}
|
|
2859
|
-
function ai(e,
|
|
2859
|
+
function ai(e, a, l) {
|
|
2860
2860
|
const o = ja(e);
|
|
2861
2861
|
return Ee(
|
|
2862
|
-
|
|
2862
|
+
a,
|
|
2863
2863
|
async (r) => {
|
|
2864
2864
|
if (r) {
|
|
2865
2865
|
const n = l(r);
|