@phila/layerboard 3.0.0-beta.0 → 3.0.0-beta.1
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 +1 -1
- package/dist/index.mjs +222 -222
- package/dist/layerboard.css +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -6,15 +6,15 @@ function Ue(e, n, o = {}) {
|
|
|
6
6
|
return (o.id === 0 || o.id) && (t.id = o.id), o.bbox && (t.bbox = o.bbox), t.properties = n || {}, t.geometry = e, t;
|
|
7
7
|
}
|
|
8
8
|
function Bt(e, n, o = {}) {
|
|
9
|
-
for (const
|
|
10
|
-
if (
|
|
9
|
+
for (const l of e) {
|
|
10
|
+
if (l.length < 4)
|
|
11
11
|
throw new Error(
|
|
12
12
|
"Each LinearRing of a Polygon must have 4 or more Positions."
|
|
13
13
|
);
|
|
14
|
-
if (
|
|
14
|
+
if (l[l.length - 1].length !== l[0].length)
|
|
15
15
|
throw new Error("First and last Position are not equivalent.");
|
|
16
|
-
for (let
|
|
17
|
-
if (
|
|
16
|
+
for (let a = 0; a < l[l.length - 1].length; a++)
|
|
17
|
+
if (l[l.length - 1][a] !== l[0][a])
|
|
18
18
|
throw new Error("First and last Position are not equivalent.");
|
|
19
19
|
}
|
|
20
20
|
return Ue({
|
|
@@ -46,27 +46,27 @@ function jt(e) {
|
|
|
46
46
|
return e.type === "Feature" ? e.geometry : e;
|
|
47
47
|
}
|
|
48
48
|
function qt(e, n, o) {
|
|
49
|
-
var t = e.length,
|
|
49
|
+
var t = e.length, l = Te(e[0], n), a = [], c, p, d;
|
|
50
50
|
let S, y;
|
|
51
51
|
for (o || (o = []), c = 1; c < t; c++) {
|
|
52
52
|
for (S = e[c - 1], y = e[c], p = d = Te(y, n); ; )
|
|
53
|
-
if (
|
|
54
|
-
if (
|
|
53
|
+
if (l | p) {
|
|
54
|
+
if (l & p)
|
|
55
55
|
break;
|
|
56
|
-
|
|
56
|
+
l ? (S = it(S, y, l, n), l = Te(S, n)) : (y = it(S, y, p, n), p = Te(y, n));
|
|
57
57
|
} else {
|
|
58
|
-
|
|
58
|
+
a.push(S), p !== d ? (a.push(y), c < t - 1 && (o.push(a), a = [])) : c === t - 1 && a.push(y);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
l = d;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return a.length && o.push(a), o;
|
|
64
64
|
}
|
|
65
65
|
function Gt(e, n) {
|
|
66
|
-
var o, t,
|
|
66
|
+
var o, t, l, a, c, p, d;
|
|
67
67
|
for (t = 1; t <= 8; t *= 2) {
|
|
68
|
-
for (o = [],
|
|
69
|
-
p = e[c], d = !(Te(p, n) & t), d !==
|
|
68
|
+
for (o = [], l = e[e.length - 1], a = !(Te(l, n) & t), c = 0; c < e.length; c++)
|
|
69
|
+
p = e[c], d = !(Te(p, n) & t), d !== a && o.push(it(l, p, t, n)), d && o.push(p), l = p, a = d;
|
|
70
70
|
if (e = o, !e.length) break;
|
|
71
71
|
}
|
|
72
72
|
return o;
|
|
@@ -79,22 +79,22 @@ function Te(e, n) {
|
|
|
79
79
|
return e[0] < n[0] ? o |= 1 : e[0] > n[2] && (o |= 2), e[1] < n[1] ? o |= 4 : e[1] > n[3] && (o |= 8), o;
|
|
80
80
|
}
|
|
81
81
|
function Ht(e, n) {
|
|
82
|
-
const o = jt(e), t = o.type,
|
|
83
|
-
let
|
|
82
|
+
const o = jt(e), t = o.type, l = e.type === "Feature" ? e.properties : {};
|
|
83
|
+
let a = o.coordinates;
|
|
84
84
|
switch (t) {
|
|
85
85
|
case "LineString":
|
|
86
86
|
case "MultiLineString": {
|
|
87
87
|
const c = [];
|
|
88
|
-
return t === "LineString" && (
|
|
88
|
+
return t === "LineString" && (a = [a]), a.forEach((p) => {
|
|
89
89
|
qt(p, n, c);
|
|
90
|
-
}), c.length === 1 ? Wt(c[0],
|
|
90
|
+
}), c.length === 1 ? Wt(c[0], l) : Ut(c, l);
|
|
91
91
|
}
|
|
92
92
|
case "Polygon":
|
|
93
|
-
return Bt(mt(
|
|
93
|
+
return Bt(mt(a, n), l);
|
|
94
94
|
case "MultiPolygon":
|
|
95
95
|
return Vt(
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
a.map((c) => mt(c, n)),
|
|
97
|
+
l
|
|
98
98
|
);
|
|
99
99
|
default:
|
|
100
100
|
throw new Error("geometry " + t + " not supported");
|
|
@@ -103,8 +103,8 @@ function Ht(e, n) {
|
|
|
103
103
|
function mt(e, n) {
|
|
104
104
|
const o = [];
|
|
105
105
|
for (const t of e) {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const l = Gt(t, n);
|
|
107
|
+
l.length > 0 && ((l[0][0] !== l[l.length - 1][0] || l[0][1] !== l[l.length - 1][1]) && l.push(l[0]), l.length >= 4 && o.push(l));
|
|
108
108
|
}
|
|
109
109
|
return o;
|
|
110
110
|
}
|
|
@@ -132,9 +132,9 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
132
132
|
},
|
|
133
133
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
134
134
|
setup(e, { emit: n }) {
|
|
135
|
-
const o = e, t = n,
|
|
135
|
+
const o = e, t = n, l = $(null), a = $(null), c = $(0);
|
|
136
136
|
function p(i) {
|
|
137
|
-
t("zoom", i),
|
|
137
|
+
t("zoom", i), a.value && (c.value = d(a.value));
|
|
138
138
|
}
|
|
139
139
|
function d(i) {
|
|
140
140
|
const u = i.getZoom(), x = i.getCenter().lat, k = 559082264028e-3, T = x * Math.PI / 180;
|
|
@@ -200,7 +200,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
200
200
|
y.value = i.bounds, m(i.bounds);
|
|
201
201
|
}
|
|
202
202
|
function g(i) {
|
|
203
|
-
|
|
203
|
+
a.value = i;
|
|
204
204
|
const u = i.getBounds();
|
|
205
205
|
y.value = {
|
|
206
206
|
west: u.getWest(),
|
|
@@ -398,7 +398,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
function Pe(i) {
|
|
401
|
-
const u =
|
|
401
|
+
const u = a.value;
|
|
402
402
|
if (!u) return;
|
|
403
403
|
const r = [];
|
|
404
404
|
o.layerList.forEach((G) => {
|
|
@@ -449,7 +449,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
449
449
|
break;
|
|
450
450
|
case "ArrowRight":
|
|
451
451
|
case "ArrowDown":
|
|
452
|
-
i.preventDefault(),
|
|
452
|
+
i.preventDefault(), le();
|
|
453
453
|
break;
|
|
454
454
|
case "Escape":
|
|
455
455
|
i.preventDefault(), te();
|
|
@@ -461,7 +461,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
461
461
|
}), Lt(() => {
|
|
462
462
|
window.removeEventListener("keydown", be);
|
|
463
463
|
});
|
|
464
|
-
function
|
|
464
|
+
function le() {
|
|
465
465
|
const i = oe.value.length;
|
|
466
466
|
i <= 1 || (J.value = (J.value + 1) % i);
|
|
467
467
|
}
|
|
@@ -472,7 +472,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
472
472
|
const b = R(() => oe.value.length === 0 ? null : oe.value[J.value]), P = R(() => {
|
|
473
473
|
const i = b.value;
|
|
474
474
|
return !i || !i.popupConfig ? i?.layerTitle || "" : ve(i.popupConfig.title, i.properties);
|
|
475
|
-
}),
|
|
475
|
+
}), ae = R(() => {
|
|
476
476
|
const i = b.value;
|
|
477
477
|
if (!i) return "";
|
|
478
478
|
let u = '<div class="popup-content">';
|
|
@@ -620,7 +620,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
620
620
|
ge.value = null;
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
|
-
const u =
|
|
623
|
+
const u = a.value;
|
|
624
624
|
if (!u || !pe.value) return;
|
|
625
625
|
const r = [];
|
|
626
626
|
o.layerList.forEach((O) => {
|
|
@@ -652,7 +652,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
652
652
|
return (i, u) => (f(), L("div", Qt, [
|
|
653
653
|
ee(_(Ot), {
|
|
654
654
|
ref_key: "mapRef",
|
|
655
|
-
ref:
|
|
655
|
+
ref: l,
|
|
656
656
|
zoom: o.initialZoom,
|
|
657
657
|
center: o.initialCenter,
|
|
658
658
|
"navigation-controls": { position: o.navigationControlPosition },
|
|
@@ -753,14 +753,14 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
753
753
|
b.value && pe.value ? (f(), X(_(Nt), {
|
|
754
754
|
key: 1,
|
|
755
755
|
"lng-lat": pe.value,
|
|
756
|
-
html:
|
|
756
|
+
html: ae.value,
|
|
757
757
|
"close-on-click": !1,
|
|
758
758
|
"show-navigation": oe.value.length > 1,
|
|
759
759
|
"current-feature-index": J.value,
|
|
760
760
|
"total-features": oe.value.length,
|
|
761
761
|
"layer-name": b.value.layerTitle,
|
|
762
762
|
onClose: te,
|
|
763
|
-
onNext:
|
|
763
|
+
onNext: le,
|
|
764
764
|
onPrevious: De
|
|
765
765
|
}, null, 8, ["lng-lat", "html", "show-navigation", "current-feature-index", "total-features", "layer-name"])) : I("", !0)
|
|
766
766
|
]),
|
|
@@ -770,8 +770,8 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
770
770
|
}
|
|
771
771
|
}), _e = (e, n) => {
|
|
772
772
|
const o = e.__vccOpts || e;
|
|
773
|
-
for (const [t,
|
|
774
|
-
o[t] =
|
|
773
|
+
for (const [t, l] of n)
|
|
774
|
+
o[t] = l;
|
|
775
775
|
return o;
|
|
776
776
|
}, Xt = /* @__PURE__ */ _e(Kt, [["__scopeId", "data-v-38b78874"]]), Yt = ["disabled"], eo = /* @__PURE__ */ we({
|
|
777
777
|
inheritAttrs: !1,
|
|
@@ -802,7 +802,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
802
802
|
n.iconOnly && "icon-button",
|
|
803
803
|
n.iconOnly && n.variant === "standard" && "icon-button--standard",
|
|
804
804
|
n.className
|
|
805
|
-
)),
|
|
805
|
+
)), l = R(() => o(n) ? "to" in n && n.to !== void 0 ? {
|
|
806
806
|
to: n.to,
|
|
807
807
|
disabled: n.disabled,
|
|
808
808
|
className: t.value
|
|
@@ -812,7 +812,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
812
812
|
rel: n.rel,
|
|
813
813
|
disabled: n.disabled,
|
|
814
814
|
className: t.value
|
|
815
|
-
} : {}),
|
|
815
|
+
} : {}), a = R(
|
|
816
816
|
() => ({
|
|
817
817
|
iconDefinition: n.iconDefinition,
|
|
818
818
|
iconClass: n.iconClass,
|
|
@@ -823,9 +823,9 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
823
823
|
size: n.size
|
|
824
824
|
})
|
|
825
825
|
);
|
|
826
|
-
return (c, p) => o(n) ? (f(), X(_(Zt), ot({ key: 0 }, { ...
|
|
826
|
+
return (c, p) => o(n) ? (f(), X(_(Zt), ot({ key: 0 }, { ...l.value, ...c.$attrs }, { role: "button" }), {
|
|
827
827
|
default: Ne(() => [
|
|
828
|
-
ee(_(gt), dt(ft(
|
|
828
|
+
ee(_(gt), dt(ft(a.value)), {
|
|
829
829
|
default: Ne(() => [
|
|
830
830
|
se(c.$slots, "default", {}, () => [
|
|
831
831
|
he(j(n.text), 1)
|
|
@@ -841,7 +841,7 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
|
|
|
841
841
|
disabled: n.disabled,
|
|
842
842
|
class: t.value
|
|
843
843
|
}, c.$attrs), [
|
|
844
|
-
ee(_(gt), dt(ft(
|
|
844
|
+
ee(_(gt), dt(ft(a.value)), {
|
|
845
845
|
default: Ne(() => [
|
|
846
846
|
se(c.$slots, "default", {}, () => [
|
|
847
847
|
he(j(n.text), 1)
|
|
@@ -861,7 +861,7 @@ var to = {
|
|
|
861
861
|
iconName: "xmark",
|
|
862
862
|
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
|
|
863
863
|
}, io = no;
|
|
864
|
-
const
|
|
864
|
+
const lo = ["for"], ao = { class: "state-layer" }, ro = { class: "content" }, so = { class: "input-text-container" }, co = ["id", "placeholder"], uo = {
|
|
865
865
|
key: 1,
|
|
866
866
|
class: "has-text-body-small phila-supporting-text"
|
|
867
867
|
}, fo = {
|
|
@@ -883,9 +883,9 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
883
883
|
} }
|
|
884
884
|
},
|
|
885
885
|
setup(e, { emit: n }) {
|
|
886
|
-
const o = Ft(), t = e,
|
|
886
|
+
const o = Ft(), t = e, l = R(() => typeof t.error == "string" ? t.error : t.error[0]), a = Mt(t, "id"), c = R(() => {
|
|
887
887
|
const S = ["default-class"];
|
|
888
|
-
return o.disabled != null && S.push("phila-input--disabled"),
|
|
888
|
+
return o.disabled != null && S.push("phila-input--disabled"), l.value && S.push("phila-input--error"), o.required != null && S.push("phila-input--required"), nt(...S);
|
|
889
889
|
}), p = $(""), d = R(() => {
|
|
890
890
|
const S = [];
|
|
891
891
|
return p.value !== "" && S.push("phila-text-field--filled"), t.className && S.push(t.className), nt(...S);
|
|
@@ -895,13 +895,13 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
895
895
|
}, [
|
|
896
896
|
t.label ? (f(), L("label", {
|
|
897
897
|
key: 0,
|
|
898
|
-
for:
|
|
898
|
+
for: a.value,
|
|
899
899
|
class: "has-text-label-small phila-label"
|
|
900
|
-
}, j(t.label), 9,
|
|
900
|
+
}, j(t.label), 9, lo)) : I("", !0),
|
|
901
901
|
F("div", {
|
|
902
902
|
class: ne(["phila-text-field", d.value])
|
|
903
903
|
}, [
|
|
904
|
-
F("div",
|
|
904
|
+
F("div", ao, [
|
|
905
905
|
t.leadingIcon ? (f(), X(_(me), {
|
|
906
906
|
key: 0,
|
|
907
907
|
"icon-class": t.leadingIcon,
|
|
@@ -910,7 +910,7 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
910
910
|
F("div", ro, [
|
|
911
911
|
F("div", so, [
|
|
912
912
|
St(F("input", ot({
|
|
913
|
-
id:
|
|
913
|
+
id: a.value,
|
|
914
914
|
"onUpdate:modelValue": y[0] || (y[0] = (h) => p.value = h),
|
|
915
915
|
class: "phila-text-field-input has-text-body-default",
|
|
916
916
|
placeholder: t.placeholder
|
|
@@ -935,13 +935,13 @@ const ao = ["for"], lo = { class: "state-layer" }, ro = { class: "content" }, so
|
|
|
935
935
|
])
|
|
936
936
|
], 2),
|
|
937
937
|
t.supportingText ? (f(), L("div", uo, j(t.supportingText), 1)) : I("", !0),
|
|
938
|
-
|
|
938
|
+
l.value ? (f(), L("div", fo, [
|
|
939
939
|
ee(_(me), {
|
|
940
940
|
"icon-definition": _(oo),
|
|
941
941
|
size: "small",
|
|
942
942
|
inline: ""
|
|
943
943
|
}, null, 8, ["icon-definition"]),
|
|
944
|
-
he(" " + j(
|
|
944
|
+
he(" " + j(l.value), 1)
|
|
945
945
|
])) : I("", !0)
|
|
946
946
|
], 2));
|
|
947
947
|
}
|
|
@@ -1010,7 +1010,7 @@ const vo = { class: "layer-panel" }, bo = {
|
|
|
1010
1010
|
},
|
|
1011
1011
|
emits: ["toggleLayer", "setOpacity", "updateSearch"],
|
|
1012
1012
|
setup(e, { emit: n }) {
|
|
1013
|
-
const o = e, t = n,
|
|
1013
|
+
const o = e, t = n, l = R(() => {
|
|
1014
1014
|
if (!o.searchQuery.trim())
|
|
1015
1015
|
return o.layerList;
|
|
1016
1016
|
const C = o.searchQuery.toLowerCase();
|
|
@@ -1018,12 +1018,12 @@ const vo = { class: "layer-panel" }, bo = {
|
|
|
1018
1018
|
(g) => g.config.title.toLowerCase().includes(C)
|
|
1019
1019
|
);
|
|
1020
1020
|
});
|
|
1021
|
-
function
|
|
1021
|
+
function a(C) {
|
|
1022
1022
|
let g = C.split("?")[0] || C;
|
|
1023
1023
|
return g = g.replace(/\/query$/, ""), g = g.replace(/\/$/, ""), g.toLowerCase();
|
|
1024
1024
|
}
|
|
1025
1025
|
function c(C) {
|
|
1026
|
-
const g =
|
|
1026
|
+
const g = a(C);
|
|
1027
1027
|
return o.layerMetadata[g] || null;
|
|
1028
1028
|
}
|
|
1029
1029
|
const p = R(() => o.layerList.some((C) => c(C.config.url)));
|
|
@@ -1071,7 +1071,7 @@ const vo = { class: "layer-panel" }, bo = {
|
|
|
1071
1071
|
key: 2,
|
|
1072
1072
|
class: ne(["layer-list", { "has-metadata": p.value }])
|
|
1073
1073
|
}, [
|
|
1074
|
-
(f(!0), L(ie, null, re(
|
|
1074
|
+
(f(!0), L(ie, null, re(l.value, (w) => (f(), L("div", {
|
|
1075
1075
|
key: w.config.id,
|
|
1076
1076
|
class: "layer-item"
|
|
1077
1077
|
}, [
|
|
@@ -1154,15 +1154,15 @@ const vo = { class: "layer-panel" }, bo = {
|
|
|
1154
1154
|
]))), 128))
|
|
1155
1155
|
])) : I("", !0)
|
|
1156
1156
|
]))), 128)),
|
|
1157
|
-
|
|
1157
|
+
l.value.length === 0 ? (f(), L("div", Io, ' No layers match "' + j(e.searchQuery) + '" ', 1)) : I("", !0)
|
|
1158
1158
|
], 2))
|
|
1159
1159
|
]));
|
|
1160
1160
|
}
|
|
1161
1161
|
}), Ro = /* @__PURE__ */ _e(Oo, [["__scopeId", "data-v-82d84fbe"]]);
|
|
1162
1162
|
function D(e) {
|
|
1163
1163
|
if (!e || !Array.isArray(e) || e.length < 3) return "#888888";
|
|
1164
|
-
const n = e[0], o = e[1], t = e[2],
|
|
1165
|
-
return
|
|
1164
|
+
const n = e[0], o = e[1], t = e[2], a = (e[3] ?? 255) / 255;
|
|
1165
|
+
return a === 1 ? `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}` : `rgba(${n}, ${o}, ${t}, ${a.toFixed(2)})`;
|
|
1166
1166
|
}
|
|
1167
1167
|
function ue(e) {
|
|
1168
1168
|
return e !== void 0 ? e : 1;
|
|
@@ -1207,10 +1207,10 @@ function tt(e) {
|
|
|
1207
1207
|
return String(e);
|
|
1208
1208
|
}
|
|
1209
1209
|
function Ct(e, n, o) {
|
|
1210
|
-
const t = e.symbol,
|
|
1211
|
-
console.log("[Transformer] convertSimpleRenderer - geomType:",
|
|
1212
|
-
let
|
|
1213
|
-
if (
|
|
1210
|
+
const t = e.symbol, l = Ve(t);
|
|
1211
|
+
console.log("[Transformer] convertSimpleRenderer - geomType:", l, "symbol:", t);
|
|
1212
|
+
let a = {}, c = [], p = null;
|
|
1213
|
+
if (l === "fill" && t) {
|
|
1214
1214
|
const d = t.color === null ? 0 : t.color?.[3] ?? 255, S = d === 0 ? "rgba(0, 0, 0, 0)" : D(t.color), y = d === 0 ? 0 : d < 255 ? 1 : ue(n);
|
|
1215
1215
|
if (console.log(`[Transformer] Fill layer opacity calculation for "${o}":`, {
|
|
1216
1216
|
symbolColor: t.color,
|
|
@@ -1218,7 +1218,7 @@ function Ct(e, n, o) {
|
|
|
1218
1218
|
layerOpacity: n,
|
|
1219
1219
|
fillOpacity: y,
|
|
1220
1220
|
fillColor: S
|
|
1221
|
-
}),
|
|
1221
|
+
}), a = {
|
|
1222
1222
|
"fill-color": S,
|
|
1223
1223
|
"fill-opacity": y
|
|
1224
1224
|
}, Fe(t.outline)) {
|
|
@@ -1228,7 +1228,7 @@ function Ct(e, n, o) {
|
|
|
1228
1228
|
outlineWidth: h,
|
|
1229
1229
|
outlineColor: s,
|
|
1230
1230
|
willCreateOutlinePaint: h > 1 || d === 0
|
|
1231
|
-
}), d !== 0 && (
|
|
1231
|
+
}), d !== 0 && (a["fill-outline-color"] = s), (h > 1 || d === 0) && (p = {
|
|
1232
1232
|
"line-color": s,
|
|
1233
1233
|
"line-width": h
|
|
1234
1234
|
}, console.log("[Transformer] Created outlinePaint:", p));
|
|
@@ -1239,8 +1239,8 @@ function Ct(e, n, o) {
|
|
|
1239
1239
|
color: D(t.color),
|
|
1240
1240
|
label: e.label || "Feature"
|
|
1241
1241
|
}];
|
|
1242
|
-
} else if (
|
|
1243
|
-
|
|
1242
|
+
} else if (l === "line" && t)
|
|
1243
|
+
a = {
|
|
1244
1244
|
"line-color": D(t.color),
|
|
1245
1245
|
"line-width": t.width || 1,
|
|
1246
1246
|
"line-opacity": ue(n)
|
|
@@ -1250,29 +1250,29 @@ function Ct(e, n, o) {
|
|
|
1250
1250
|
width: t.width || 1,
|
|
1251
1251
|
label: e.label || "Feature"
|
|
1252
1252
|
}];
|
|
1253
|
-
else if (
|
|
1253
|
+
else if (l === "circle" && t) {
|
|
1254
1254
|
const d = Math.round((t.size || 6) * 0.71 * 100) / 100;
|
|
1255
|
-
|
|
1255
|
+
a = {
|
|
1256
1256
|
"circle-color": D(t.color),
|
|
1257
1257
|
"circle-radius": d,
|
|
1258
1258
|
"circle-opacity": ue(n)
|
|
1259
|
-
}, Fe(t.outline) && (
|
|
1259
|
+
}, Fe(t.outline) && (a["circle-stroke-color"] = D(t.outline.color), a["circle-stroke-width"] = t.outline.width || 1), c = [{
|
|
1260
1260
|
type: "circle",
|
|
1261
1261
|
color: D(t.color),
|
|
1262
1262
|
label: e.label || "Feature"
|
|
1263
1263
|
}];
|
|
1264
1264
|
}
|
|
1265
|
-
return { paint:
|
|
1265
|
+
return { paint: a, legend: c, geomType: l, outlinePaint: p };
|
|
1266
1266
|
}
|
|
1267
1267
|
function No(e, n, o) {
|
|
1268
|
-
const t = e.field1,
|
|
1269
|
-
if (
|
|
1270
|
-
return Ct({ ...e, symbol:
|
|
1271
|
-
const c =
|
|
1268
|
+
const t = e.field1, l = e.uniqueValueInfos || [], a = e.defaultSymbol;
|
|
1269
|
+
if (l.length === 0)
|
|
1270
|
+
return Ct({ ...e, symbol: a }, n);
|
|
1271
|
+
const c = l[0]?.symbol || a, p = Ve(c);
|
|
1272
1272
|
let d = {}, S = [], y = null;
|
|
1273
1273
|
if (p === "fill") {
|
|
1274
1274
|
const h = ["match", ["to-string", ["get", t]]];
|
|
1275
|
-
for (const s of
|
|
1275
|
+
for (const s of l) {
|
|
1276
1276
|
h.push(tt(s.value)), h.push(D(s.symbol?.color));
|
|
1277
1277
|
const v = String(s.value), m = o?.get(v) || s.label || v;
|
|
1278
1278
|
S.push({
|
|
@@ -1281,7 +1281,7 @@ function No(e, n, o) {
|
|
|
1281
1281
|
label: m
|
|
1282
1282
|
});
|
|
1283
1283
|
}
|
|
1284
|
-
if (h.push(
|
|
1284
|
+
if (h.push(a ? D(a.color) : "#888888"), d = {
|
|
1285
1285
|
"fill-color": h,
|
|
1286
1286
|
"fill-opacity": ue(n)
|
|
1287
1287
|
}, Fe(c?.outline)) {
|
|
@@ -1293,7 +1293,7 @@ function No(e, n, o) {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
} else if (p === "line") {
|
|
1295
1295
|
const h = ["match", ["to-string", ["get", t]]];
|
|
1296
|
-
for (const s of
|
|
1296
|
+
for (const s of l) {
|
|
1297
1297
|
h.push(tt(s.value)), h.push(D(s.symbol?.color));
|
|
1298
1298
|
const v = String(s.value), m = o?.get(v) || s.label || v;
|
|
1299
1299
|
S.push({
|
|
@@ -1303,14 +1303,14 @@ function No(e, n, o) {
|
|
|
1303
1303
|
label: m
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
|
-
h.push(
|
|
1306
|
+
h.push(a ? D(a.color) : "#888888"), d = {
|
|
1307
1307
|
"line-color": h,
|
|
1308
1308
|
"line-width": c?.width || 2,
|
|
1309
1309
|
"line-opacity": ue(n)
|
|
1310
1310
|
};
|
|
1311
1311
|
} else if (p === "circle") {
|
|
1312
1312
|
const h = ["match", ["to-string", ["get", t]]];
|
|
1313
|
-
for (const v of
|
|
1313
|
+
for (const v of l) {
|
|
1314
1314
|
h.push(tt(v.value)), h.push(D(v.symbol?.color));
|
|
1315
1315
|
const E = String(v.value), C = o?.get(E) || v.label || E;
|
|
1316
1316
|
S.push({
|
|
@@ -1319,7 +1319,7 @@ function No(e, n, o) {
|
|
|
1319
1319
|
label: C
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
|
-
h.push(
|
|
1322
|
+
h.push(a ? D(a.color) : "#888888");
|
|
1323
1323
|
const s = Math.round((c?.size || 6) * 0.71 * 100) / 100;
|
|
1324
1324
|
d = {
|
|
1325
1325
|
"circle-color": h,
|
|
@@ -1330,12 +1330,12 @@ function No(e, n, o) {
|
|
|
1330
1330
|
return { paint: d, legend: S, geomType: p, outlinePaint: y };
|
|
1331
1331
|
}
|
|
1332
1332
|
function Zo(e, n) {
|
|
1333
|
-
const o = e.field, t = e.classBreakInfos || [],
|
|
1334
|
-
if (
|
|
1335
|
-
return Bo(
|
|
1333
|
+
const o = e.field, t = e.classBreakInfos || [], l = e.visualVariables?.find((y) => y.type === "colorInfo");
|
|
1334
|
+
if (l?.stops && l.stops.length > 0)
|
|
1335
|
+
return Bo(l, o, e, n);
|
|
1336
1336
|
if (t.length === 0)
|
|
1337
1337
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1338
|
-
const
|
|
1338
|
+
const a = t[0]?.symbol, c = Ve(a);
|
|
1339
1339
|
let p = {}, d = [], S = null;
|
|
1340
1340
|
if (c === "fill") {
|
|
1341
1341
|
const y = ["step", ["get", o]];
|
|
@@ -1351,8 +1351,8 @@ function Zo(e, n) {
|
|
|
1351
1351
|
if (p = {
|
|
1352
1352
|
"fill-color": y,
|
|
1353
1353
|
"fill-opacity": ue(n)
|
|
1354
|
-
}, Fe(
|
|
1355
|
-
const h =
|
|
1354
|
+
}, Fe(a?.outline)) {
|
|
1355
|
+
const h = a.outline.width || 1, s = D(a.outline.color);
|
|
1356
1356
|
p["fill-outline-color"] = s, h > 1 && (S = {
|
|
1357
1357
|
"line-color": s,
|
|
1358
1358
|
"line-width": h
|
|
@@ -1367,11 +1367,11 @@ function Zo(e, n) {
|
|
|
1367
1367
|
v > 0 && (y.push(t[v - 1].classMaxValue), y.push(D(E.symbol?.color))), d.push({
|
|
1368
1368
|
type: "line",
|
|
1369
1369
|
color: D(E.symbol?.color),
|
|
1370
|
-
width: E.symbol?.width ||
|
|
1370
|
+
width: E.symbol?.width || a?.width || 2,
|
|
1371
1371
|
label: E.label || `${h} - ${E.classMaxValue}`
|
|
1372
1372
|
}), h = E.classMaxValue + 1;
|
|
1373
1373
|
}
|
|
1374
|
-
const s =
|
|
1374
|
+
const s = a?.width || 2;
|
|
1375
1375
|
p = {
|
|
1376
1376
|
"line-color": y,
|
|
1377
1377
|
"line-width": s,
|
|
@@ -1381,14 +1381,14 @@ function Zo(e, n) {
|
|
|
1381
1381
|
return { paint: p, legend: d, geomType: c, outlinePaint: S };
|
|
1382
1382
|
}
|
|
1383
1383
|
function Bo(e, n, o, t) {
|
|
1384
|
-
const
|
|
1385
|
-
if (
|
|
1384
|
+
const l = e.stops || [];
|
|
1385
|
+
if (l.length === 0)
|
|
1386
1386
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1387
|
-
const
|
|
1387
|
+
const a = o.classBreakInfos?.[0]?.symbol || o.defaultSymbol, c = Ve(a);
|
|
1388
1388
|
let p = {}, d = [], S = null;
|
|
1389
1389
|
if (c === "fill") {
|
|
1390
1390
|
const y = ["interpolate", ["linear"], ["get", n]];
|
|
1391
|
-
for (const s of
|
|
1391
|
+
for (const s of l)
|
|
1392
1392
|
y.push(s.value), y.push(D(s.color)), d.push({
|
|
1393
1393
|
type: "fill",
|
|
1394
1394
|
color: D(s.color),
|
|
@@ -1404,8 +1404,8 @@ function Bo(e, n, o, t) {
|
|
|
1404
1404
|
// Otherwise use the interpolated color
|
|
1405
1405
|
],
|
|
1406
1406
|
"fill-opacity": ue(t)
|
|
1407
|
-
}, Fe(
|
|
1408
|
-
const s =
|
|
1407
|
+
}, Fe(a?.outline)) {
|
|
1408
|
+
const s = a.outline.width || 1, v = D(a.outline.color);
|
|
1409
1409
|
p["fill-outline-color"] = v, s > 1 && (S = {
|
|
1410
1410
|
"line-color": v,
|
|
1411
1411
|
"line-width": s
|
|
@@ -1417,26 +1417,26 @@ function Bo(e, n, o, t) {
|
|
|
1417
1417
|
function Wo(e, n, o, t) {
|
|
1418
1418
|
if (!e?.renderer)
|
|
1419
1419
|
return console.warn("[Transformer] No renderer found in drawingInfo - layer will use service default (not available in WebMap)"), { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1420
|
-
const
|
|
1421
|
-
switch (
|
|
1420
|
+
const l = e.renderer;
|
|
1421
|
+
switch (l.type) {
|
|
1422
1422
|
case "simple":
|
|
1423
|
-
return Ct(
|
|
1423
|
+
return Ct(l, n, t);
|
|
1424
1424
|
case "uniqueValue":
|
|
1425
|
-
return No(
|
|
1425
|
+
return No(l, n, o);
|
|
1426
1426
|
case "classBreaks":
|
|
1427
|
-
return Zo(
|
|
1427
|
+
return Zo(l, n);
|
|
1428
1428
|
default:
|
|
1429
|
-
return console.warn(`Unknown renderer type: ${
|
|
1429
|
+
return console.warn(`Unknown renderer type: ${l.type}`), { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
1432
|
function Uo(e) {
|
|
1433
1433
|
if (!e) return null;
|
|
1434
|
-
const n = e.title || "", t = (e.fieldInfos || []).filter((
|
|
1435
|
-
const
|
|
1436
|
-
field:
|
|
1437
|
-
label:
|
|
1434
|
+
const n = e.title || "", t = (e.fieldInfos || []).filter((l) => l.visible === !0).map((l) => {
|
|
1435
|
+
const a = {
|
|
1436
|
+
field: l.fieldName,
|
|
1437
|
+
label: l.label || l.fieldName
|
|
1438
1438
|
};
|
|
1439
|
-
return
|
|
1439
|
+
return l.format && (a.format = {}, l.format.dateFormat && (a.format.dateFormat = l.format.dateFormat), l.format.digitSeparator !== void 0 && (a.format.digitSeparator = l.format.digitSeparator), l.format.places !== void 0 && (a.format.places = l.format.places), Object.keys(a.format).length === 0 && delete a.format), a;
|
|
1440
1440
|
});
|
|
1441
1441
|
return {
|
|
1442
1442
|
title: n,
|
|
@@ -1458,10 +1458,10 @@ function Go(e) {
|
|
|
1458
1458
|
return n;
|
|
1459
1459
|
const o = e.split(`
|
|
1460
1460
|
`), t = /^(\d{1,3})\s+(.+)$/;
|
|
1461
|
-
for (const
|
|
1462
|
-
const
|
|
1463
|
-
if (
|
|
1464
|
-
const [, c, p] =
|
|
1461
|
+
for (const l of o) {
|
|
1462
|
+
const a = l.trim().match(t);
|
|
1463
|
+
if (a) {
|
|
1464
|
+
const [, c, p] = a;
|
|
1465
1465
|
c && p && n.set(c, p.trim());
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
@@ -1485,60 +1485,60 @@ async function Ho(e) {
|
|
|
1485
1485
|
async function kt(e) {
|
|
1486
1486
|
const n = e.operationalLayers || [], o = [], t = ["Zoning and Planning_Land Use"];
|
|
1487
1487
|
console.log("🔄 [Transformer] ===== STARTING FRESH TRANSFORMATION ====="), console.log("[Transformer] Starting transformation of", n.length, "layers");
|
|
1488
|
-
for (const
|
|
1489
|
-
if (!
|
|
1490
|
-
console.log(`Skipping layer without URL: ${
|
|
1488
|
+
for (const l of n) {
|
|
1489
|
+
if (!l.url) {
|
|
1490
|
+
console.log(`Skipping layer without URL: ${l.title}`);
|
|
1491
1491
|
continue;
|
|
1492
1492
|
}
|
|
1493
|
-
if (
|
|
1494
|
-
console.log(`Skipping layer with under-construction itemId: ${
|
|
1493
|
+
if (l.itemId === "4f39b829b96d437da9231727d9c91fab") {
|
|
1494
|
+
console.log(`Skipping layer with under-construction itemId: ${l.title}`);
|
|
1495
1495
|
continue;
|
|
1496
1496
|
}
|
|
1497
|
-
console.log("[Transformer] Processing layer:",
|
|
1497
|
+
console.log("[Transformer] Processing layer:", l.title), console.log(`[Transformer] Layer "${l.title}" - Renderer type:`, l.layerDefinition?.drawingInfo?.renderer?.type);
|
|
1498
1498
|
try {
|
|
1499
|
-
let
|
|
1500
|
-
const p = !
|
|
1501
|
-
if ((p || d) &&
|
|
1502
|
-
console.log(d ? `[Transformer] Layer "${
|
|
1503
|
-
const M = await Ho(
|
|
1504
|
-
M ? (
|
|
1499
|
+
let a = l.layerDefinition?.drawingInfo, c;
|
|
1500
|
+
const p = !a || !a.renderer, d = t.includes(l.title);
|
|
1501
|
+
if ((p || d) && l.url) {
|
|
1502
|
+
console.log(d ? `[Transformer] Layer "${l.title}" configured to use service renderer instead of WebMap renderer` : `[Transformer] Layer "${l.title}" has no renderer in WebMap, fetching from service...`);
|
|
1503
|
+
const M = await Ho(l.url);
|
|
1504
|
+
M ? (a = M.drawingInfo, console.log(`[Transformer] Fetched renderer from service for "${l.title}":`, M.drawingInfo?.renderer?.type), M.description && (c = Go(M.description), c.size > 0 && console.log(`[Transformer] Parsed ${c.size} custom labels from service description`))) : console.warn(`[Transformer] Failed to fetch renderer from service for "${l.title}"`);
|
|
1505
1505
|
}
|
|
1506
1506
|
const { paint: S, legend: y, geomType: h, outlinePaint: s } = Wo(
|
|
1507
|
-
|
|
1508
|
-
|
|
1507
|
+
a,
|
|
1508
|
+
l.opacity,
|
|
1509
1509
|
c,
|
|
1510
|
-
|
|
1510
|
+
l.title
|
|
1511
1511
|
);
|
|
1512
|
-
console.log(`[Transformer] Layer "${
|
|
1513
|
-
const v = Uo(
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
), C = jo(
|
|
1517
|
-
let w =
|
|
1512
|
+
console.log(`[Transformer] Layer "${l.title}" - Result: geomType=${h}, hasOutlinePaint=${!!s}`);
|
|
1513
|
+
const v = Uo(l.popupInfo), E = Vo(l.layerDefinition), m = Ao(
|
|
1514
|
+
l.layerDefinition?.minScale,
|
|
1515
|
+
l.layerDefinition?.maxScale
|
|
1516
|
+
), C = jo(l.title), g = qo(l.title);
|
|
1517
|
+
let w = l.opacity ?? 1;
|
|
1518
1518
|
const z = {
|
|
1519
1519
|
id: C,
|
|
1520
1520
|
title: g,
|
|
1521
1521
|
type: h,
|
|
1522
|
-
url:
|
|
1522
|
+
url: l.url,
|
|
1523
1523
|
opacity: w,
|
|
1524
1524
|
paint: S,
|
|
1525
1525
|
legend: y,
|
|
1526
1526
|
popup: v
|
|
1527
1527
|
};
|
|
1528
1528
|
E && (z.where = E), m.minZoom !== void 0 && (z.minZoom = m.minZoom), m.maxZoom !== void 0 && (z.maxZoom = m.maxZoom), s && (z.outlinePaint = s), o.push(z);
|
|
1529
|
-
} catch (
|
|
1530
|
-
console.error(`Error transforming layer ${
|
|
1529
|
+
} catch (a) {
|
|
1530
|
+
console.error(`Error transforming layer ${l.title}:`, a);
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
return o.sort((
|
|
1533
|
+
return o.sort((l, a) => l.title.localeCompare(a.title)), o;
|
|
1534
1534
|
}
|
|
1535
|
-
const bt = {},
|
|
1535
|
+
const bt = {}, at = "376af635c84643cd816a8c5d017a53aa", Dn = at;
|
|
1536
1536
|
function Be(e, n) {
|
|
1537
1537
|
let o = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
|
|
1538
1538
|
return n && (o += `&token=${n}`), o;
|
|
1539
1539
|
}
|
|
1540
1540
|
function An() {
|
|
1541
|
-
return Be(
|
|
1541
|
+
return Be(at);
|
|
1542
1542
|
}
|
|
1543
1543
|
const We = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map();
|
|
1544
1544
|
function Jo(e) {
|
|
@@ -1583,10 +1583,10 @@ async function Ko(e, n) {
|
|
|
1583
1583
|
const t = await fetch(o);
|
|
1584
1584
|
if (!t.ok)
|
|
1585
1585
|
throw new Error(`Failed to fetch WebMap: ${t.status} ${t.statusText}`);
|
|
1586
|
-
const
|
|
1587
|
-
if (
|
|
1588
|
-
throw new Error(`ArcGIS error: ${
|
|
1589
|
-
return
|
|
1586
|
+
const l = await t.json();
|
|
1587
|
+
if (l.error)
|
|
1588
|
+
throw new Error(`ArcGIS error: ${l.error.message || l.error.code || "Unknown error"}`);
|
|
1589
|
+
return l;
|
|
1590
1590
|
}
|
|
1591
1591
|
async function Xo(e) {
|
|
1592
1592
|
try {
|
|
@@ -1599,7 +1599,7 @@ async function Xo(e) {
|
|
|
1599
1599
|
throw console.error("[LayerConfigService] Error loading dynamic configs:", n), new Error(`Failed to load dynamic layer configs: ${n instanceof Error ? n.message : "Unknown error"}`);
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
async function
|
|
1602
|
+
async function lt(e = at) {
|
|
1603
1603
|
const n = We.get(e);
|
|
1604
1604
|
if (n)
|
|
1605
1605
|
return console.log(`[LayerConfigService] ⚠️ Returning CACHED configs for ${e} (transformer will NOT run)`), console.log("[LayerConfigService] To force refresh, call clearCache() or reload with Ctrl+Shift+R"), n;
|
|
@@ -1609,8 +1609,8 @@ async function at(e = lt) {
|
|
|
1609
1609
|
console.log(`[LayerConfigService] Mode: dynamic, WebMap: ${e}`);
|
|
1610
1610
|
const t = (async () => {
|
|
1611
1611
|
try {
|
|
1612
|
-
const
|
|
1613
|
-
return We.set(e,
|
|
1612
|
+
const l = await Xo(e);
|
|
1613
|
+
return We.set(e, l), l;
|
|
1614
1614
|
} finally {
|
|
1615
1615
|
ze.delete(e);
|
|
1616
1616
|
}
|
|
@@ -1684,10 +1684,10 @@ function Yo(e) {
|
|
|
1684
1684
|
};
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
1687
|
-
async function
|
|
1687
|
+
async function l() {
|
|
1688
1688
|
await Promise.all(e.map((s) => t(s)));
|
|
1689
1689
|
}
|
|
1690
|
-
async function
|
|
1690
|
+
async function a(s) {
|
|
1691
1691
|
const v = e.find((E) => E.id === s);
|
|
1692
1692
|
v ? await t(v) : console.warn(`Data source "${s}" not found`);
|
|
1693
1693
|
}
|
|
@@ -1716,7 +1716,7 @@ function Yo(e) {
|
|
|
1716
1716
|
o.clear();
|
|
1717
1717
|
}
|
|
1718
1718
|
return Ze(() => {
|
|
1719
|
-
|
|
1719
|
+
l(), y();
|
|
1720
1720
|
}), Lt(() => {
|
|
1721
1721
|
h();
|
|
1722
1722
|
}), {
|
|
@@ -1725,9 +1725,9 @@ function Yo(e) {
|
|
|
1725
1725
|
/** Whether any data source is currently loading */
|
|
1726
1726
|
isLoading: p,
|
|
1727
1727
|
/** Fetch all data sources */
|
|
1728
|
-
fetchAll:
|
|
1728
|
+
fetchAll: l,
|
|
1729
1729
|
/** Refetch a specific data source by id */
|
|
1730
|
-
refetch:
|
|
1730
|
+
refetch: a,
|
|
1731
1731
|
/** Get data for a specific source */
|
|
1732
1732
|
getData: c,
|
|
1733
1733
|
/** Check if a specific source is loading */
|
|
@@ -1741,10 +1741,10 @@ function Yo(e) {
|
|
|
1741
1741
|
const en = { class: "layerboard-layout" }, tn = {
|
|
1742
1742
|
key: 0,
|
|
1743
1743
|
class: "layerboard-subtitle"
|
|
1744
|
-
}, on = { class: "layerboard-mobile-menu-content" }, nn = { class: "layerboard-main" },
|
|
1744
|
+
}, on = { class: "layerboard-mobile-menu-content" }, nn = { class: "layerboard-main" }, ln = {
|
|
1745
1745
|
key: 0,
|
|
1746
1746
|
class: "layerboard-loading"
|
|
1747
|
-
},
|
|
1747
|
+
}, an = {
|
|
1748
1748
|
key: 1,
|
|
1749
1749
|
class: "layerboard-error"
|
|
1750
1750
|
}, rn = { key: 0 }, sn = { key: 1 }, cn = { class: "layerboard-modal" }, un = /* @__PURE__ */ we({
|
|
@@ -1776,7 +1776,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1776
1776
|
},
|
|
1777
1777
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
1778
1778
|
setup(e, { expose: n, emit: o }) {
|
|
1779
|
-
const t = e,
|
|
1779
|
+
const t = e, l = o, a = $([]), c = $(!0), p = $(null), d = $(12), S = $(""), y = $(/* @__PURE__ */ new Set()), h = $({}), s = $(/* @__PURE__ */ new Set()), v = $({}), E = $({}), m = $(/* @__PURE__ */ new Set()), C = $({});
|
|
1780
1780
|
function g() {
|
|
1781
1781
|
const b = {};
|
|
1782
1782
|
for (const P of t.tiledLayers)
|
|
@@ -1799,7 +1799,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1799
1799
|
function Se(b) {
|
|
1800
1800
|
return N?.refetch(b) ?? Promise.resolve();
|
|
1801
1801
|
}
|
|
1802
|
-
U("layerboard-layers", V(
|
|
1802
|
+
U("layerboard-layers", V(a)), U("layerboard-visible", y), U("layerboard-opacities", h), U("layerboard-loading", V(s)), U("layerboard-errors", V(v)), U("layerboard-zoom", V(d)), U("layerboard-toggle-layer", Ce), U("layerboard-set-layer-visible", de), U("layerboard-set-layers-visible", ke), U("layerboard-set-opacity", fe), U("layerboard-tiled-layers", V(R(() => t.tiledLayers))), U("layerboard-visible-tiled", m), U("layerboard-tiled-opacities", C), U("layerboard-toggle-tiled", w), U("layerboard-set-tiled-opacity", M), U("layerboard-set-tiled-visible", z), U("layerboard-data-sources-state", q), U("layerboard-data-sources-loading", ce), U("layerboard-get-data-source", Le), U("layerboard-refetch-data-source", Se);
|
|
1803
1803
|
const je = R(() => ({
|
|
1804
1804
|
backgroundColor: t.themeColor
|
|
1805
1805
|
})), qe = R(() => ({
|
|
@@ -1812,7 +1812,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1812
1812
|
async function Ee() {
|
|
1813
1813
|
try {
|
|
1814
1814
|
c.value = !0, p.value = null;
|
|
1815
|
-
const P = (await
|
|
1815
|
+
const P = (await lt(t.webMapId)).map((Z) => {
|
|
1816
1816
|
const Q = t.layerStyleOverrides[Z.id];
|
|
1817
1817
|
return Q ? (console.log(`[Layerboard] Applying style override for layer: ${Z.id}`), {
|
|
1818
1818
|
...Z,
|
|
@@ -1822,18 +1822,18 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1822
1822
|
type: Q.type ?? Z.type
|
|
1823
1823
|
}) : Z;
|
|
1824
1824
|
});
|
|
1825
|
-
|
|
1825
|
+
a.value = P.map((Z) => ({
|
|
1826
1826
|
config: Z,
|
|
1827
1827
|
component: Z.type
|
|
1828
1828
|
}));
|
|
1829
|
-
const
|
|
1829
|
+
const ae = {};
|
|
1830
1830
|
P.forEach((Z) => {
|
|
1831
|
-
|
|
1832
|
-
}), h.value =
|
|
1831
|
+
ae[Z.id] = Z.opacity ?? 1;
|
|
1832
|
+
}), h.value = ae, console.log(`[Layerboard] Loaded ${P.length} layer configs from WebMap ${t.webMapId}`), console.log("[Layerboard] Layer IDs:", P.map((Z) => Z.id)), l("configs-loaded", P);
|
|
1833
1833
|
} catch (b) {
|
|
1834
1834
|
console.error("[Layerboard] Failed to load layer configs:", b);
|
|
1835
1835
|
const P = b instanceof Error ? b.message : "Failed to load layer configurations";
|
|
1836
|
-
p.value = P,
|
|
1836
|
+
p.value = P, l("load-error", P);
|
|
1837
1837
|
} finally {
|
|
1838
1838
|
c.value = !1;
|
|
1839
1839
|
}
|
|
@@ -1849,8 +1849,8 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1849
1849
|
"select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
|
|
1850
1850
|
), P = await fetch(b);
|
|
1851
1851
|
if (!P.ok) return;
|
|
1852
|
-
const
|
|
1853
|
-
for (const Q of
|
|
1852
|
+
const ae = await P.json(), Z = {};
|
|
1853
|
+
for (const Q of ae.rows || [])
|
|
1854
1854
|
if (Q.url_text && Q.representation) {
|
|
1855
1855
|
const Ke = Oe(Q.url_text), Xe = `https://metadata.phila.gov/#home/representationdetails/${Q.representation}/`;
|
|
1856
1856
|
Z[Ke] = Xe;
|
|
@@ -1861,7 +1861,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
}
|
|
1863
1863
|
function He(b) {
|
|
1864
|
-
d.value = b,
|
|
1864
|
+
d.value = b, l("zoom", b);
|
|
1865
1865
|
}
|
|
1866
1866
|
function Ce(b) {
|
|
1867
1867
|
y.value.has(b) ? y.value.delete(b) : y.value.add(b), y.value = new Set(y.value);
|
|
@@ -1870,8 +1870,8 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1870
1870
|
P ? y.value.add(b) : y.value.delete(b), y.value = new Set(y.value);
|
|
1871
1871
|
}
|
|
1872
1872
|
function ke(b, P) {
|
|
1873
|
-
for (const
|
|
1874
|
-
P ? y.value.add(
|
|
1873
|
+
for (const ae of b)
|
|
1874
|
+
P ? y.value.add(ae) : y.value.delete(ae);
|
|
1875
1875
|
y.value = new Set(y.value);
|
|
1876
1876
|
}
|
|
1877
1877
|
function fe(b, P) {
|
|
@@ -1884,7 +1884,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1884
1884
|
if (P)
|
|
1885
1885
|
v.value = { ...v.value, [b]: P };
|
|
1886
1886
|
else {
|
|
1887
|
-
const { [b]:
|
|
1887
|
+
const { [b]: ae, ...Z } = v.value;
|
|
1888
1888
|
v.value = Z;
|
|
1889
1889
|
}
|
|
1890
1890
|
}
|
|
@@ -1910,15 +1910,15 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1910
1910
|
function be() {
|
|
1911
1911
|
te.value = !0;
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
1913
|
+
function le() {
|
|
1914
1914
|
te.value = !1;
|
|
1915
1915
|
}
|
|
1916
1916
|
function De(b) {
|
|
1917
|
-
b.target.classList.contains("layerboard-modal-backdrop") &&
|
|
1917
|
+
b.target.classList.contains("layerboard-modal-backdrop") && le();
|
|
1918
1918
|
}
|
|
1919
|
-
return U("layerboard-open-modal", be), U("layerboard-close-modal",
|
|
1919
|
+
return U("layerboard-open-modal", be), U("layerboard-close-modal", le), U("layerboard-is-modal-open", V(te)), n({
|
|
1920
1920
|
/** Layer configurations */
|
|
1921
|
-
layerList:
|
|
1921
|
+
layerList: a,
|
|
1922
1922
|
/** Set of visible layer IDs */
|
|
1923
1923
|
visibleLayers: y,
|
|
1924
1924
|
/** Layer opacity values */
|
|
@@ -1967,7 +1967,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
1967
1967
|
/** Open the modal */
|
|
1968
1968
|
openModal: be,
|
|
1969
1969
|
/** Close the modal */
|
|
1970
|
-
closeModal:
|
|
1970
|
+
closeModal: le
|
|
1971
1971
|
}), Ze(() => {
|
|
1972
1972
|
Ee(), Ge(), g();
|
|
1973
1973
|
}), (b, P) => (f(), L("div", en, [
|
|
@@ -2008,7 +2008,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2008
2008
|
F("div", on, [
|
|
2009
2009
|
se(b.$slots, "footer", {
|
|
2010
2010
|
openModal: be,
|
|
2011
|
-
closeModal:
|
|
2011
|
+
closeModal: le,
|
|
2012
2012
|
isModalOpen: te.value
|
|
2013
2013
|
}, () => [
|
|
2014
2014
|
P[0] || (P[0] = he(" City of Philadelphia ", -1))
|
|
@@ -2033,13 +2033,13 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2033
2033
|
})) : I("", !0)
|
|
2034
2034
|
], 4),
|
|
2035
2035
|
F("div", nn, [
|
|
2036
|
-
c.value ? (f(), L("div",
|
|
2036
|
+
c.value ? (f(), L("div", ln, [
|
|
2037
2037
|
F("div", {
|
|
2038
2038
|
class: "layerboard-spinner",
|
|
2039
2039
|
style: Y({ borderTopColor: e.themeColor })
|
|
2040
2040
|
}, null, 4),
|
|
2041
2041
|
F("p", null, "Loading " + j(e.title) + "...", 1)
|
|
2042
|
-
])) : p.value ? (f(), L("div",
|
|
2042
|
+
])) : p.value ? (f(), L("div", an, [
|
|
2043
2043
|
P[3] || (P[3] = F("h2", null, "Error Loading Layers", -1)),
|
|
2044
2044
|
F("p", null, j(p.value), 1),
|
|
2045
2045
|
F("button", {
|
|
@@ -2053,7 +2053,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2053
2053
|
style: Y(Ie.value)
|
|
2054
2054
|
}, [
|
|
2055
2055
|
se(b.$slots, "sidebar", {
|
|
2056
|
-
layers:
|
|
2056
|
+
layers: a.value,
|
|
2057
2057
|
visibleLayers: y.value,
|
|
2058
2058
|
layerOpacities: h.value,
|
|
2059
2059
|
loadingLayers: s.value,
|
|
@@ -2076,7 +2076,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2076
2076
|
}, () => [
|
|
2077
2077
|
e.showDefaultSidebar ? (f(), X(Ro, {
|
|
2078
2078
|
key: 0,
|
|
2079
|
-
"layer-list":
|
|
2079
|
+
"layer-list": a.value,
|
|
2080
2080
|
"visible-layers": y.value,
|
|
2081
2081
|
"layer-opacities": h.value,
|
|
2082
2082
|
"loading-layers": s.value,
|
|
@@ -2096,7 +2096,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2096
2096
|
ee(Xt, {
|
|
2097
2097
|
"visible-layers": y.value,
|
|
2098
2098
|
"layer-opacities": h.value,
|
|
2099
|
-
"layer-list":
|
|
2099
|
+
"layer-list": a.value,
|
|
2100
2100
|
"tiled-layers": e.tiledLayers,
|
|
2101
2101
|
"visible-tiled-layers": m.value,
|
|
2102
2102
|
"tiled-layer-opacities": C.value,
|
|
@@ -2143,7 +2143,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2143
2143
|
}, [
|
|
2144
2144
|
se(b.$slots, "footer", {
|
|
2145
2145
|
openModal: be,
|
|
2146
|
-
closeModal:
|
|
2146
|
+
closeModal: le,
|
|
2147
2147
|
isModalOpen: te.value
|
|
2148
2148
|
}, () => [
|
|
2149
2149
|
P[4] || (P[4] = he(" City of Philadelphia ", -1))
|
|
@@ -2157,7 +2157,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2157
2157
|
F("div", cn, [
|
|
2158
2158
|
F("button", {
|
|
2159
2159
|
class: "layerboard-modal-close",
|
|
2160
|
-
onClick:
|
|
2160
|
+
onClick: le,
|
|
2161
2161
|
"aria-label": "Close modal"
|
|
2162
2162
|
}, [
|
|
2163
2163
|
ee(_(me), {
|
|
@@ -2166,12 +2166,12 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2166
2166
|
decorative: ""
|
|
2167
2167
|
}, null, 8, ["icon-definition"])
|
|
2168
2168
|
]),
|
|
2169
|
-
se(b.$slots, "modal", { closeModal:
|
|
2169
|
+
se(b.$slots, "modal", { closeModal: le }, void 0, !0)
|
|
2170
2170
|
])
|
|
2171
2171
|
])) : I("", !0)
|
|
2172
2172
|
]));
|
|
2173
2173
|
}
|
|
2174
|
-
}), Nn = /* @__PURE__ */ _e(un, [["__scopeId", "data-v-
|
|
2174
|
+
}), Nn = /* @__PURE__ */ _e(un, [["__scopeId", "data-v-54d854f8"]]), dn = ["aria-expanded"], fn = {
|
|
2175
2175
|
key: 0,
|
|
2176
2176
|
class: "topic-icon"
|
|
2177
2177
|
}, pn = { class: "topic-title" }, yn = { class: "topic-content" }, gn = /* @__PURE__ */ we({
|
|
@@ -2185,26 +2185,26 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2185
2185
|
},
|
|
2186
2186
|
emits: ["toggle", "layerChange"],
|
|
2187
2187
|
setup(e, { emit: n }) {
|
|
2188
|
-
const o = e, t = n,
|
|
2188
|
+
const o = e, t = n, l = $(o.expanded);
|
|
2189
2189
|
xe(
|
|
2190
2190
|
() => o.expanded,
|
|
2191
2191
|
(c) => {
|
|
2192
|
-
|
|
2192
|
+
l.value = c;
|
|
2193
2193
|
}
|
|
2194
2194
|
);
|
|
2195
|
-
function
|
|
2196
|
-
|
|
2195
|
+
function a() {
|
|
2196
|
+
l.value = !l.value, t("toggle", l.value);
|
|
2197
2197
|
}
|
|
2198
2198
|
return (c, p) => {
|
|
2199
2199
|
const d = _t("font-awesome-icon");
|
|
2200
2200
|
return f(), L("div", {
|
|
2201
|
-
class: ne(["topic-accordion", { "is-expanded":
|
|
2201
|
+
class: ne(["topic-accordion", { "is-expanded": l.value }])
|
|
2202
2202
|
}, [
|
|
2203
2203
|
F("button", {
|
|
2204
2204
|
class: ne(["topic-header", e.headerClass]),
|
|
2205
2205
|
type: "button",
|
|
2206
|
-
"aria-expanded":
|
|
2207
|
-
onClick:
|
|
2206
|
+
"aria-expanded": l.value,
|
|
2207
|
+
onClick: a
|
|
2208
2208
|
}, [
|
|
2209
2209
|
e.icon || c.$slots.icon ? (f(), L("span", fn, [
|
|
2210
2210
|
se(c.$slots, "icon", {}, () => [
|
|
@@ -2216,7 +2216,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2216
2216
|
])) : I("", !0),
|
|
2217
2217
|
F("span", pn, j(e.title), 1),
|
|
2218
2218
|
F("span", {
|
|
2219
|
-
class: ne(["topic-chevron", { "is-rotated":
|
|
2219
|
+
class: ne(["topic-chevron", { "is-rotated": l.value }])
|
|
2220
2220
|
}, [...p[0] || (p[0] = [
|
|
2221
2221
|
F("svg", {
|
|
2222
2222
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2238,7 +2238,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2238
2238
|
p[1] || (p[1] = F("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
|
|
2239
2239
|
], !0)
|
|
2240
2240
|
], 512), [
|
|
2241
|
-
[It,
|
|
2241
|
+
[It, l.value]
|
|
2242
2242
|
])
|
|
2243
2243
|
], 2);
|
|
2244
2244
|
};
|
|
@@ -2279,10 +2279,10 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2279
2279
|
emits: ["toggleLayer", "setOpacity"],
|
|
2280
2280
|
setup(e, { emit: n }) {
|
|
2281
2281
|
const o = e, t = n;
|
|
2282
|
-
function
|
|
2282
|
+
function l(m) {
|
|
2283
2283
|
return o.visibleLayerIds.has(m);
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function a(m) {
|
|
2286
2286
|
return o.layerOpacities[m] ?? 1;
|
|
2287
2287
|
}
|
|
2288
2288
|
function c(m) {
|
|
@@ -2328,7 +2328,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2328
2328
|
}, [
|
|
2329
2329
|
F("input", {
|
|
2330
2330
|
type: "checkbox",
|
|
2331
|
-
checked:
|
|
2331
|
+
checked: l(g.id),
|
|
2332
2332
|
disabled: !d(g),
|
|
2333
2333
|
onChange: (w) => v(g.id)
|
|
2334
2334
|
}, null, 40, hn),
|
|
@@ -2360,19 +2360,19 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2360
2360
|
d(g) ? I("", !0) : (f(), L("span", $n, " (zoom in) "))
|
|
2361
2361
|
])
|
|
2362
2362
|
], 2)),
|
|
2363
|
-
y(g) &&
|
|
2364
|
-
F("label", xn, " Opacity: " + j(Math.round(
|
|
2363
|
+
y(g) && l(g.id) ? (f(), L("div", Pn, [
|
|
2364
|
+
F("label", xn, " Opacity: " + j(Math.round(a(g.id) * 100)) + "% ", 1),
|
|
2365
2365
|
F("input", {
|
|
2366
2366
|
type: "range",
|
|
2367
2367
|
min: "0",
|
|
2368
2368
|
max: "1",
|
|
2369
2369
|
step: "0.05",
|
|
2370
|
-
value:
|
|
2370
|
+
value: a(g.id),
|
|
2371
2371
|
class: "opacity-slider",
|
|
2372
2372
|
onInput: (w) => E(g.id, w)
|
|
2373
2373
|
}, null, 40, Tn)
|
|
2374
2374
|
])) : I("", !0),
|
|
2375
|
-
h(g) &&
|
|
2375
|
+
h(g) && l(g.id) && g.legend?.length ? (f(), L("ul", Fn, [
|
|
2376
2376
|
(f(!0), L(ie, null, re(g.legend, (w, z) => (f(), L("li", {
|
|
2377
2377
|
key: z,
|
|
2378
2378
|
class: "legend-item"
|
|
@@ -2402,7 +2402,7 @@ const en = { class: "layerboard-layout" }, tn = {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
}), Bn = /* @__PURE__ */ _e(zn, [["__scopeId", "data-v-cc5e50fd"]]);
|
|
2404
2404
|
function Wn(e) {
|
|
2405
|
-
const n = $([]), o = $(/* @__PURE__ */ new Set()), t = $({}),
|
|
2405
|
+
const n = $([]), o = $(/* @__PURE__ */ new Set()), t = $({}), l = $(/* @__PURE__ */ new Set()), a = $({}), c = $(""), p = $(!1), d = $(!1), S = $(null), y = R(() => {
|
|
2406
2406
|
if (!c.value.trim())
|
|
2407
2407
|
return n.value;
|
|
2408
2408
|
const M = c.value.toLowerCase();
|
|
@@ -2422,7 +2422,7 @@ function Wn(e) {
|
|
|
2422
2422
|
p.value = !0, S.value = null;
|
|
2423
2423
|
try {
|
|
2424
2424
|
let M;
|
|
2425
|
-
e.mode === "dynamic" || !e.mode ? e.webMapId ? M = await v(e.webMapId) : M = await
|
|
2425
|
+
e.mode === "dynamic" || !e.mode ? e.webMapId ? M = await v(e.webMapId) : M = await lt() : M = await lt(), n.value = M;
|
|
2426
2426
|
const N = {};
|
|
2427
2427
|
M.forEach((q) => {
|
|
2428
2428
|
N[q.id] = q.opacity ?? 1;
|
|
@@ -2456,27 +2456,27 @@ function Wn(e) {
|
|
|
2456
2456
|
c.value = M;
|
|
2457
2457
|
}
|
|
2458
2458
|
function g(M, N) {
|
|
2459
|
-
const q = new Set(
|
|
2460
|
-
N ? q.add(M) : q.delete(M),
|
|
2459
|
+
const q = new Set(l.value);
|
|
2460
|
+
N ? q.add(M) : q.delete(M), l.value = q;
|
|
2461
2461
|
}
|
|
2462
2462
|
function w(M, N) {
|
|
2463
2463
|
if (N)
|
|
2464
|
-
|
|
2464
|
+
a.value = { ...a.value, [M]: N };
|
|
2465
2465
|
else {
|
|
2466
|
-
const { [M]: q, ...ce } =
|
|
2467
|
-
|
|
2466
|
+
const { [M]: q, ...ce } = a.value;
|
|
2467
|
+
a.value = ce;
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
2470
|
function z() {
|
|
2471
|
-
n.value = [], o.value = /* @__PURE__ */ new Set(), t.value = {},
|
|
2471
|
+
n.value = [], o.value = /* @__PURE__ */ new Set(), t.value = {}, l.value = /* @__PURE__ */ new Set(), a.value = {}, c.value = "", p.value = !1, d.value = !1, S.value = null;
|
|
2472
2472
|
}
|
|
2473
2473
|
return {
|
|
2474
2474
|
// State (readonly)
|
|
2475
2475
|
layerConfigs: V(n),
|
|
2476
2476
|
visibleLayers: V(o),
|
|
2477
2477
|
layerOpacities: V(t),
|
|
2478
|
-
loadingLayers: V(
|
|
2479
|
-
layerErrors: V(
|
|
2478
|
+
loadingLayers: V(l),
|
|
2479
|
+
layerErrors: V(a),
|
|
2480
2480
|
searchQuery: V(c),
|
|
2481
2481
|
isLoading: V(p),
|
|
2482
2482
|
isInitialized: V(d),
|
|
@@ -2498,23 +2498,23 @@ function Wn(e) {
|
|
|
2498
2498
|
}
|
|
2499
2499
|
function Un() {
|
|
2500
2500
|
const e = $([]), n = $(/* @__PURE__ */ new Set()), o = $(/* @__PURE__ */ new Set());
|
|
2501
|
-
function t(
|
|
2502
|
-
n.value.has(
|
|
2501
|
+
function t(a) {
|
|
2502
|
+
n.value.has(a) ? n.value.delete(a) : n.value.add(a);
|
|
2503
2503
|
}
|
|
2504
|
-
function a
|
|
2505
|
-
e.value =
|
|
2504
|
+
function l(a) {
|
|
2505
|
+
e.value = a;
|
|
2506
2506
|
}
|
|
2507
2507
|
return {
|
|
2508
2508
|
layers: R(() => e.value),
|
|
2509
2509
|
visibleLayerIds: R(() => n.value),
|
|
2510
2510
|
loadingLayerIds: R(() => o.value),
|
|
2511
2511
|
toggleLayer: t,
|
|
2512
|
-
setLayers:
|
|
2512
|
+
setLayers: l
|
|
2513
2513
|
};
|
|
2514
2514
|
}
|
|
2515
2515
|
function _n(e) {
|
|
2516
|
-
const n = $(null), o = $(!1), t = $(null),
|
|
2517
|
-
async function
|
|
2516
|
+
const n = $(null), o = $(!1), t = $(null), l = $(0);
|
|
2517
|
+
async function a(d = {}) {
|
|
2518
2518
|
o.value = !0, t.value = null;
|
|
2519
2519
|
const S = e.pageSize || 2e3;
|
|
2520
2520
|
let y = 0, h = [], s = !0;
|
|
@@ -2542,7 +2542,7 @@ function _n(e) {
|
|
|
2542
2542
|
type: "FeatureCollection",
|
|
2543
2543
|
features: h
|
|
2544
2544
|
};
|
|
2545
|
-
return n.value = v,
|
|
2545
|
+
return n.value = v, l.value = h.length, v;
|
|
2546
2546
|
} catch (v) {
|
|
2547
2547
|
const E = v instanceof Error ? v : new Error("Failed to fetch features");
|
|
2548
2548
|
throw t.value = E, E;
|
|
@@ -2551,21 +2551,21 @@ function _n(e) {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
}
|
|
2553
2553
|
function c() {
|
|
2554
|
-
n.value = null,
|
|
2554
|
+
n.value = null, l.value = 0, t.value = null;
|
|
2555
2555
|
}
|
|
2556
2556
|
async function p(d = {}) {
|
|
2557
|
-
return
|
|
2557
|
+
return a(d);
|
|
2558
2558
|
}
|
|
2559
2559
|
return {
|
|
2560
2560
|
// State (readonly)
|
|
2561
2561
|
data: V(n),
|
|
2562
2562
|
isLoading: V(o),
|
|
2563
2563
|
error: V(t),
|
|
2564
|
-
totalFeatures: V(
|
|
2564
|
+
totalFeatures: V(l),
|
|
2565
2565
|
// Config
|
|
2566
2566
|
config: e,
|
|
2567
2567
|
// Methods
|
|
2568
|
-
fetch:
|
|
2568
|
+
fetch: a,
|
|
2569
2569
|
refetch: p,
|
|
2570
2570
|
clear: c
|
|
2571
2571
|
};
|
|
@@ -2574,10 +2574,10 @@ function Vn(e, n, o) {
|
|
|
2574
2574
|
const t = _n(e);
|
|
2575
2575
|
return xe(
|
|
2576
2576
|
n,
|
|
2577
|
-
async (
|
|
2578
|
-
if (
|
|
2579
|
-
const
|
|
2580
|
-
await t.fetch(
|
|
2577
|
+
async (l) => {
|
|
2578
|
+
if (l) {
|
|
2579
|
+
const a = o(l);
|
|
2580
|
+
await t.fetch(a);
|
|
2581
2581
|
}
|
|
2582
2582
|
},
|
|
2583
2583
|
{ immediate: !0 }
|
|
@@ -2592,7 +2592,7 @@ export {
|
|
|
2592
2592
|
Dn as WEBMAP_ID,
|
|
2593
2593
|
Be as buildWebMapUrl,
|
|
2594
2594
|
Jo as clearCache,
|
|
2595
|
-
|
|
2595
|
+
lt as getLayerConfigs,
|
|
2596
2596
|
An as getWebMapUrl,
|
|
2597
2597
|
kt as transformWebMapToLayerConfigs,
|
|
2598
2598
|
Yo as useApiDataSources,
|