@abi-software/flatmap-viewer 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +78 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91790,7 +91790,7 @@ class pyA {
|
|
|
91790
91790
|
const i = A.options.navigationControl, E = typeof i == "string" && ["top-left", "top-right", "bottom-right", "bottom-left"].includes(i) ? i : "bottom-right";
|
|
91791
91791
|
this.#e.addControl(new eyA(A), E);
|
|
91792
91792
|
}
|
|
91793
|
-
A.options.addCloseControl && this.addCloseControl(), A.options.standalone && (this.#e.addControl(new GyA(A)), this.#e.addControl(new ryA(A)), A.options.allControls && (this.#D = new iyA(A), this.#e.addControl(this.#D), this.#e.addControl(new hyA(A, B)), A.options.style === zB.ANATOMICAL && this.#h.haveCentrelines && this.#e.addControl(new wyA(A, this)), A.options.style === zB.FUNCTIONAL ? (this.#e.addControl(new kyA(A, this.#T.systems)), this.#e.addControl(new ayA(A, A.options.layerOptions))) : this.#e.addControl(new uyA(A)), A.hasFlightpaths && this.#e.addControl(new lyA(A, !!A.options.flightPaths)), A.options.annotator && this.#e.addControl(new syA(A)), this.#e.addControl(new oyA(A, this.#o)))), this.#
|
|
91793
|
+
A.options.addCloseControl && this.addCloseControl(), A.options.standalone && (this.#e.addControl(new GyA(A)), this.#e.addControl(new ryA(A)), A.options.allControls && (this.#D = new iyA(A), this.#e.addControl(this.#D), this.#e.addControl(new hyA(A, B)), A.options.style === zB.ANATOMICAL && this.#h.haveCentrelines && this.#e.addControl(new wyA(A, this)), A.options.style === zB.FUNCTIONAL ? (this.#e.addControl(new kyA(A, this.#T.systems)), this.#e.addControl(new ayA(A, A.options.layerOptions))) : this.#e.addControl(new uyA(A)), A.hasFlightpaths && this.#e.addControl(new lyA(A, !!A.options.flightPaths)), A.options.annotator && this.#e.addControl(new syA(A)), this.#e.addControl(new oyA(A, this.#o)))), this.#J(), this.#Q = new cyA(A, !1), this.#e.addControl(this.#Q), A.options.flightPaths === !0 && this.#o.setFlightPathMode(!0);
|
|
91794
91794
|
const C = this.#iA.bind(this);
|
|
91795
91795
|
this.#e.on("click", this.#CA.bind(this)), this.#e.on("dblclick", (i) => {
|
|
91796
91796
|
const E = this.#o.featuresAtPoint(i.point);
|
|
@@ -91866,7 +91866,7 @@ class pyA {
|
|
|
91866
91866
|
changeAnnotationDrawMode(A) {
|
|
91867
91867
|
this.#Q && this.#Q.changeMode(A);
|
|
91868
91868
|
}
|
|
91869
|
-
#
|
|
91869
|
+
#J() {
|
|
91870
91870
|
this.#s = new Map([...this.#t.annotations.entries()].map((A) => [A[1].id, A[0]]));
|
|
91871
91871
|
for (const A of this.#s.values()) {
|
|
91872
91872
|
const I = this.mapFeature(A);
|
|
@@ -91924,7 +91924,7 @@ class pyA {
|
|
|
91924
91924
|
#C(A) {
|
|
91925
91925
|
return yy(A) ? this.mapFeature(A.properties.featureId || -1) : A;
|
|
91926
91926
|
}
|
|
91927
|
-
#
|
|
91927
|
+
#q(A) {
|
|
91928
91928
|
const I = this.#C(A);
|
|
91929
91929
|
if (I)
|
|
91930
91930
|
return this.#e.getFeatureState(I);
|
|
@@ -91938,18 +91938,18 @@ class pyA {
|
|
|
91938
91938
|
}
|
|
91939
91939
|
return null;
|
|
91940
91940
|
}
|
|
91941
|
-
#
|
|
91941
|
+
#p(A, I) {
|
|
91942
91942
|
const Q = this.#C(A);
|
|
91943
91943
|
Q && this.#e.removeFeatureState(Q, I), this.#o.removeFeatureState(+A.id, I);
|
|
91944
91944
|
}
|
|
91945
|
-
#
|
|
91945
|
+
#L(A, I) {
|
|
91946
91946
|
const Q = this.#C(A);
|
|
91947
91947
|
Q && this.#e.setFeatureState(Q, I), this.#o.setFeatureState(+A.id, I);
|
|
91948
91948
|
}
|
|
91949
91949
|
enableMapFeature(A, I = !0) {
|
|
91950
91950
|
if (A) {
|
|
91951
|
-
const Q = this.#
|
|
91952
|
-
"hidden" in Q ? I ? this.#
|
|
91951
|
+
const Q = this.#q(A);
|
|
91952
|
+
"hidden" in Q ? I ? this.#p(A, "hidden") : Q.hidden || this.#L(A, { hidden: !0 }) : I || this.#L(A, { hidden: !0 }), this.#m(+A.id, I);
|
|
91953
91953
|
}
|
|
91954
91954
|
}
|
|
91955
91955
|
enableFeature(A, I = !0, Q = !1) {
|
|
@@ -91964,18 +91964,18 @@ class pyA {
|
|
|
91964
91964
|
this.enableFeatureWithChildren(C, I, Q);
|
|
91965
91965
|
}
|
|
91966
91966
|
}
|
|
91967
|
-
#
|
|
91967
|
+
#m(A, I = !0) {
|
|
91968
91968
|
const Q = this.#G.get(A);
|
|
91969
91969
|
if (Q) {
|
|
91970
91970
|
const B = document.getElementById(`marker-${Q}`);
|
|
91971
91971
|
B && (B.style.visibility = I ? "visible" : "hidden");
|
|
91972
91972
|
}
|
|
91973
91973
|
}
|
|
91974
|
-
#
|
|
91974
|
+
#b(A) {
|
|
91975
91975
|
if (A === null)
|
|
91976
91976
|
return !1;
|
|
91977
91977
|
if (A.id) {
|
|
91978
|
-
const I = this.#
|
|
91978
|
+
const I = this.#q(A);
|
|
91979
91979
|
return I && !I.hidden && !I.invisible;
|
|
91980
91980
|
}
|
|
91981
91981
|
return lN.includes(A.layer.id);
|
|
@@ -91998,8 +91998,8 @@ class pyA {
|
|
|
91998
91998
|
else {
|
|
91999
91999
|
const i = this.mapFeature(A);
|
|
92000
92000
|
if (i) {
|
|
92001
|
-
const E = this.#
|
|
92002
|
-
E && (!("hidden" in E) || !E.hidden) && (this.#
|
|
92001
|
+
const E = this.#q(i);
|
|
92002
|
+
E && (!("hidden" in E) || !E.hidden) && (this.#L(i, { selected: !0 }), this.#u.set(A, 1), B = !0);
|
|
92003
92003
|
}
|
|
92004
92004
|
}
|
|
92005
92005
|
return B && C && this.#K({ ...this.#B, dimmed: I }), B;
|
|
@@ -92011,7 +92011,7 @@ class pyA {
|
|
|
92011
92011
|
this.#u.set(+A, I - 1);
|
|
92012
92012
|
else {
|
|
92013
92013
|
const Q = this.mapFeature(+A);
|
|
92014
|
-
Q && (this.#
|
|
92014
|
+
Q && (this.#p(Q, "selected"), this.#u.delete(+A));
|
|
92015
92015
|
}
|
|
92016
92016
|
}
|
|
92017
92017
|
this.#u.size === 0 && this.#K({ ...this.#B, dimmed: !1 });
|
|
@@ -92019,13 +92019,13 @@ class pyA {
|
|
|
92019
92019
|
unselectFeatures() {
|
|
92020
92020
|
for (const A of this.#u.keys()) {
|
|
92021
92021
|
const I = this.mapFeature(A);
|
|
92022
|
-
I && this.#
|
|
92022
|
+
I && this.#p(I, "selected");
|
|
92023
92023
|
}
|
|
92024
92024
|
this.#u.clear(), this.#K({ ...this.#B, dimmed: !1 });
|
|
92025
92025
|
}
|
|
92026
92026
|
activateFeature(A) {
|
|
92027
92027
|
if (A) {
|
|
92028
|
-
this.#
|
|
92028
|
+
this.#L(A, { active: !0 }), this.#A.has(+A.id) || this.#A.set(+A.id, A);
|
|
92029
92029
|
for (const I of this.#t.featureIdsByNerveId(+A.id))
|
|
92030
92030
|
+A.id !== I && this.activateFeature(this.mapFeature(+I));
|
|
92031
92031
|
}
|
|
@@ -92038,9 +92038,9 @@ class pyA {
|
|
|
92038
92038
|
this.activateFeature(this.mapFeature(B));
|
|
92039
92039
|
}
|
|
92040
92040
|
}
|
|
92041
|
-
#
|
|
92041
|
+
#P() {
|
|
92042
92042
|
for (const A of this.#A.values())
|
|
92043
|
-
this.#
|
|
92043
|
+
this.#p(A, "active");
|
|
92044
92044
|
this.#A.clear();
|
|
92045
92045
|
}
|
|
92046
92046
|
/* UNUSED
|
|
@@ -92068,11 +92068,11 @@ class pyA {
|
|
|
92068
92068
|
#z() {
|
|
92069
92069
|
this.#R = !0;
|
|
92070
92070
|
}
|
|
92071
|
-
#
|
|
92071
|
+
#v() {
|
|
92072
92072
|
this.#R = !1;
|
|
92073
92073
|
}
|
|
92074
92074
|
reset() {
|
|
92075
|
-
this.#
|
|
92075
|
+
this.#v(), this.#Z(), this.unselectFeatures();
|
|
92076
92076
|
}
|
|
92077
92077
|
clearSearchResults(A = !0) {
|
|
92078
92078
|
this.unselectFeatures();
|
|
@@ -92127,7 +92127,7 @@ class pyA {
|
|
|
92127
92127
|
if (B || C) {
|
|
92128
92128
|
this.#i && (Q && Q.preserveSelection && (this.#i.options.preserveSelection = Q.preserveSelection), this.#i.remove()), Q && Q.preserveSelection ? delete Q.preserveSelection : this.unselectFeatures(), this.selectFeature(A);
|
|
92129
92129
|
let i;
|
|
92130
|
-
if ("positionAtLastClick" in Q && Q.positionAtLastClick && this.#n !== null ? i = this.#n : C ? i = Q.annotationFeatureGeometry : i = this.markerPosition(B), this.#e.getBounds().contains(i) || this.#e.panTo(i), this.#z(), this.#i = new wC.Popup(Q).addTo(this.#e), this.#i.on("close", this.#
|
|
92130
|
+
if ("positionAtLastClick" in Q && Q.positionAtLastClick && this.#n !== null ? i = this.#n : C ? i = Q.annotationFeatureGeometry : i = this.markerPosition(B), this.#e.getBounds().contains(i) || this.#e.panTo(i), this.#z(), this.#i = new wC.Popup(Q).addTo(this.#e), this.#i.on("close", this.#O.bind(this)), C) {
|
|
92131
92131
|
const E = {
|
|
92132
92132
|
type: "created",
|
|
92133
92133
|
feature: {
|
|
@@ -92143,10 +92143,10 @@ class pyA {
|
|
|
92143
92143
|
this.#i.setLngLat(i), typeof I == "object" ? this.#i.setDOMContent(I) : this.#i.setText(I);
|
|
92144
92144
|
}
|
|
92145
92145
|
}
|
|
92146
|
-
#
|
|
92147
|
-
this.#i && (this.#
|
|
92146
|
+
#O() {
|
|
92147
|
+
this.#i && (this.#v(), this.#i.options && this.#i.options.preserveSelection || this.unselectFeatures(), this.#i = null);
|
|
92148
92148
|
}
|
|
92149
|
-
#
|
|
92149
|
+
#U() {
|
|
92150
92150
|
this.#S && (this.#S.remove(), this.#S = null);
|
|
92151
92151
|
}
|
|
92152
92152
|
/**
|
|
@@ -92155,7 +92155,7 @@ class pyA {
|
|
|
92155
92155
|
removePopup() {
|
|
92156
92156
|
this.#i && (this.#i.remove(), this.#i = null);
|
|
92157
92157
|
}
|
|
92158
|
-
#
|
|
92158
|
+
#X(A) {
|
|
92159
92159
|
const I = [];
|
|
92160
92160
|
for (const Q of A) {
|
|
92161
92161
|
const B = Q.properties;
|
|
@@ -92167,7 +92167,7 @@ class pyA {
|
|
|
92167
92167
|
}
|
|
92168
92168
|
return I.length === 0 ? "" : `<div class='flatmap-feature-label'>${I.join("<hr/>")}</div>`;
|
|
92169
92169
|
}
|
|
92170
|
-
#
|
|
92170
|
+
#x(A, I = !1) {
|
|
92171
92171
|
const Q = [];
|
|
92172
92172
|
if ("error" in A && Q.push(`<div class="feature-error">Error: ${A.error}</div>`), "warning" in A && Q.push(`<div class="feature-error">Warning: ${A.warning}</div>`), ("label" in A || "hyperlink" in A || "user_label" in A) && (I || !("tooltip" in A) || A.tooltip)) {
|
|
92173
92173
|
const B = dyA(A);
|
|
@@ -92175,7 +92175,7 @@ class pyA {
|
|
|
92175
92175
|
}
|
|
92176
92176
|
return Q.length === 0 ? "" : `<div class='flatmap-feature-label'>${Q.join("<hr/>")}</div>`;
|
|
92177
92177
|
}
|
|
92178
|
-
#
|
|
92178
|
+
#_(A, I, Q = {}) {
|
|
92179
92179
|
let B;
|
|
92180
92180
|
if (yy(I)) {
|
|
92181
92181
|
const C = Object.assign({}, I.properties, Q), i = C.models;
|
|
@@ -92188,10 +92188,10 @@ class pyA {
|
|
|
92188
92188
|
return this.#t.featureEvent(A, I);
|
|
92189
92189
|
}
|
|
92190
92190
|
#IA() {
|
|
92191
|
-
this.#
|
|
92191
|
+
this.#U(), this.#e.getCanvas().style.cursor = "default", this.#P();
|
|
92192
92192
|
}
|
|
92193
92193
|
#QA(A) {
|
|
92194
|
-
return this.#o.featuresAtPoint(A).filter((Q) => this.#
|
|
92194
|
+
return this.#o.featuresAtPoint(A).filter((Q) => this.#b(Q));
|
|
92195
92195
|
}
|
|
92196
92196
|
#iA(A) {
|
|
92197
92197
|
this.#BA(A.point, A.lngLat);
|
|
@@ -92209,20 +92209,20 @@ class pyA {
|
|
|
92209
92209
|
}
|
|
92210
92210
|
const i = C[0], E = yy(i) ? +i.id : +i.properties.featureId, o = "properties" in i && "models" in i.properties ? i.properties.models : null;
|
|
92211
92211
|
if (this.#c !== E && (this.#w === null || this.#w !== o))
|
|
92212
|
-
this.#
|
|
92212
|
+
this.#_(
|
|
92213
92213
|
"mouseenter",
|
|
92214
92214
|
i,
|
|
92215
92215
|
this.#AA(+E, I)
|
|
92216
92216
|
) ? (this.#c = E, this.#w = o) : (this.#c = null, this.#w = null);
|
|
92217
92217
|
else if (this.#t.options.style === zB.CENTRELINE && i.properties.centreline && this.#c === E) {
|
|
92218
92218
|
const G = this.#AA(+E, I);
|
|
92219
|
-
"location" in G && this.#
|
|
92219
|
+
"location" in G && this.#_("mousemove", i, G);
|
|
92220
92220
|
}
|
|
92221
92221
|
let a = "", n = "", c = null;
|
|
92222
92222
|
Q ? ("tooltip" in C[0].properties || this.activateFeature(i), a = this.#D.featureInformation(C, B)) : this.#t.options.showId && (this.activateFeature(i), c = i);
|
|
92223
92223
|
const w = C.filter((G) => "centreline" in G.properties || "type" in G.properties && G.properties.type.startsWith("line"));
|
|
92224
92224
|
if (w.length > 0)
|
|
92225
|
-
n = this.#
|
|
92225
|
+
n = this.#X(w), c = w[0], this.activateLineFeatures(w);
|
|
92226
92226
|
else {
|
|
92227
92227
|
const G = i.sourceLayer;
|
|
92228
92228
|
let N = C.filter((k) => k.sourceLayer === G && ("hyperlink" in k.properties || "label" in k.properties || "user_label" in k.properties || this.#t.options.showId && "id" in k.properties) && (!("tooltip" in k.properties) || k.properties.tooltip)).sort((k, f) => k.properties.area - f.properties.area);
|
|
@@ -92230,7 +92230,7 @@ class pyA {
|
|
|
92230
92230
|
const k = this.#e.getZoom(), f = N.filter((K) => K.properties.group && k < K.properties.scale + 1);
|
|
92231
92231
|
f.length > 0 && (N = f);
|
|
92232
92232
|
const d = N[0];
|
|
92233
|
-
if (d.properties.user_drawn && (d.id = d.properties.id), n = this.#
|
|
92233
|
+
if (d.properties.user_drawn && (d.id = d.properties.id), n = this.#x(d.properties), c = d, this.#t.options.debug) {
|
|
92234
92234
|
const K = [
|
|
92235
92235
|
"featureId",
|
|
92236
92236
|
"nerveId",
|
|
@@ -92292,10 +92292,10 @@ class pyA {
|
|
|
92292
92292
|
I = I.filter((C) => C.id);
|
|
92293
92293
|
const B = I[0];
|
|
92294
92294
|
if (this.#R)
|
|
92295
|
-
this.#H && (this.#IA(), this.unselectFeatures(), this.#
|
|
92295
|
+
this.#H && (this.#IA(), this.unselectFeatures(), this.#v());
|
|
92296
92296
|
else if (Q.length > 0) {
|
|
92297
92297
|
const C = Q.filter((E) => E.source === "mapbox-gl-draw-cold")[0], i = Q.filter((E) => E.source === "mapbox-gl-draw-hot")[0];
|
|
92298
|
-
this.#
|
|
92298
|
+
this.#_(
|
|
92299
92299
|
"click",
|
|
92300
92300
|
C || B || i
|
|
92301
92301
|
);
|
|
@@ -92303,9 +92303,9 @@ class pyA {
|
|
|
92303
92303
|
if (this.#n = A.lngLat, this.#t.options.style !== zB.CENTRELINE) {
|
|
92304
92304
|
this.#$(A.originalEvent);
|
|
92305
92305
|
const C = I.filter((i) => "centreline" in i.properties || "type" in i.properties && i.properties.type.startsWith("line"));
|
|
92306
|
-
C.length > 0 ? this.#gA("click", C.map((i) => i.properties)) : "details-layer" in B.properties || this.#
|
|
92306
|
+
C.length > 0 ? this.#gA("click", C.map((i) => i.properties)) : "details-layer" in B.properties || this.#_("click", B);
|
|
92307
92307
|
} else if (this.#$(A.originalEvent), !(B.properties.kind === "centreline"))
|
|
92308
|
-
this.#
|
|
92308
|
+
this.#_("click", B);
|
|
92309
92309
|
else {
|
|
92310
92310
|
const i = new zi(), E = [];
|
|
92311
92311
|
for (const o of I)
|
|
@@ -92436,7 +92436,7 @@ class pyA {
|
|
|
92436
92436
|
const w = { element: n };
|
|
92437
92437
|
"className" in I && (w.className = I.className);
|
|
92438
92438
|
const G = new wC.Marker(w).setLngLat(E).addTo(this.#e);
|
|
92439
|
-
n.addEventListener("mouseenter", this.#W.bind(this, G)), n.addEventListener("mousemove", this.#W.bind(this, G)), n.addEventListener("mouseleave", this.#W.bind(this, G)), n.addEventListener("click", this.#W.bind(this, G)), this.#M.set(G, B), this.#
|
|
92439
|
+
n.addEventListener("mouseenter", this.#W.bind(this, G)), n.addEventListener("mousemove", this.#W.bind(this, G)), n.addEventListener("mouseleave", this.#W.bind(this, G)), n.addEventListener("click", this.#W.bind(this, G)), this.#M.set(G, B), this.#b(this.mapFeature(C)) || (n.style.visibility = "hidden"), this.#G.set(C, B), this.#I.set(B, i);
|
|
92440
92440
|
}
|
|
92441
92441
|
}
|
|
92442
92442
|
return B === -1 && console.warn(`Unable to find feature '${A}' on which to place marker`), B;
|
|
@@ -92473,21 +92473,21 @@ class pyA {
|
|
|
92473
92473
|
return A;
|
|
92474
92474
|
}
|
|
92475
92475
|
#W(A, I) {
|
|
92476
|
-
if (!(this.#R || this.#g !== null && I.type === "mouseleave") && (this.#
|
|
92476
|
+
if (!(this.#R || this.#g !== null && I.type === "mouseleave") && (this.#U(), ["mouseenter", "mousemove", "click"].includes(I.type))) {
|
|
92477
92477
|
this.#g = A, A.setPopup(null), A.getElement().style.cursor = "default";
|
|
92478
92478
|
const Q = this.#M.get(A);
|
|
92479
92479
|
if (Q) {
|
|
92480
|
-
const B = this.#I.get(Q), C = this.#
|
|
92480
|
+
const B = this.#I.get(Q), C = this.#x(B, !0);
|
|
92481
92481
|
this.#V(C, A.getLngLat()), this.markerEvent(I, Q, A.getLngLat().toArray(), B);
|
|
92482
92482
|
}
|
|
92483
92483
|
I.stopPropagation();
|
|
92484
92484
|
}
|
|
92485
92485
|
}
|
|
92486
92486
|
markerEvent(A, I, Q, B) {
|
|
92487
|
-
if (["mousemove", "click"].includes(A.type) && (this.#
|
|
92487
|
+
if (["mousemove", "click"].includes(A.type) && (this.#U(), ["mouseenter", "mousemove", "click"].includes(A.type))) {
|
|
92488
92488
|
const C = this.mapFeature(B.featureId);
|
|
92489
|
-
C && (A.type === "mouseenter" ? (this.#
|
|
92490
|
-
const i = this.#
|
|
92489
|
+
C && (A.type === "mouseenter" ? (this.#P(), this.activateFeature(C)) : this.#$(A));
|
|
92490
|
+
const i = this.#x(B, !0);
|
|
92491
92491
|
this.#V(i, new wC.LngLat(...Q)), this.#t.markerEvent(A.type, I, B);
|
|
92492
92492
|
}
|
|
92493
92493
|
}
|
|
@@ -101856,20 +101856,21 @@ class cuA {
|
|
|
101856
101856
|
#f = -1;
|
|
101857
101857
|
#S;
|
|
101858
101858
|
#H;
|
|
101859
|
-
#
|
|
101859
|
+
#J = /* @__PURE__ */ new Map();
|
|
101860
101860
|
#K = /* @__PURE__ */ new Map();
|
|
101861
101861
|
#C = null;
|
|
101862
|
+
#q;
|
|
101862
101863
|
#p;
|
|
101863
101864
|
#L = /* @__PURE__ */ new Map();
|
|
101864
101865
|
constructor(A, I, Q) {
|
|
101865
|
-
this.#B = A, this.#G = I, this.#g = I.url(), this.#n = Q.id, this.#p = Q.uuid, this.#t = Q.details, this.#e = Q.mapMetadata, this.#a = Q.mapMetadata.created, this.#H = Q.taxon, this.#I = Q.biologicalSex, this.#E.push(Q.callback), this.#w = Q.layers, this.#h = Q.options, this.#Y = Q.pathways, this.#S = Q.style, this.#N = new vIA();
|
|
101866
|
+
this.#B = A, this.#G = I, this.#g = I.url(), this.#n = Q.id, this.#q = `${this.#g}flatmap/${Q.uuid}`, this.#p = Q.uuid, this.#t = Q.details, this.#e = Q.mapMetadata, this.#a = Q.mapMetadata.created, this.#H = Q.taxon, this.#I = Q.biologicalSex, this.#E.push(Q.callback), this.#w = Q.layers, this.#h = Q.options, this.#Y = Q.pathways, this.#S = Q.style, this.#N = new vIA();
|
|
101866
101867
|
const B = Q.details.connectivity;
|
|
101867
101868
|
B ? "knowledge-source" in B ? this.#y = B["knowledge-source"] || "" : "npo" in B ? this.#y = `${B.npo.release}-npo` : this.#y = this.#G.latestSource : this.#y = this.#G.latestSource;
|
|
101868
101869
|
for (const [C, i] of Object.entries(Q.annotations))
|
|
101869
|
-
this.#
|
|
101870
|
+
this.#X(+C, i), this.#T.indexMetadata(+C, i);
|
|
101870
101871
|
if (Q.mapKnowledge)
|
|
101871
101872
|
try {
|
|
101872
|
-
this.#u.load(
|
|
101873
|
+
this.#u.load(this.#q, Q.mapKnowledge);
|
|
101873
101874
|
} catch (C) {
|
|
101874
101875
|
console.log(C, Q.mapKnowledge);
|
|
101875
101876
|
}
|
|
@@ -101891,39 +101892,39 @@ class cuA {
|
|
|
101891
101892
|
}
|
|
101892
101893
|
i || Q.options.images.push(C);
|
|
101893
101894
|
}
|
|
101894
|
-
this.#
|
|
101895
|
+
this.#b();
|
|
101895
101896
|
}
|
|
101896
101897
|
/**
|
|
101897
101898
|
* Force the maplibregl instance to lose it's GL conontext
|
|
101898
101899
|
*
|
|
101899
101900
|
*/
|
|
101900
101901
|
forceContextLoss() {
|
|
101901
|
-
this.#
|
|
101902
|
+
this.#m();
|
|
101902
101903
|
}
|
|
101903
|
-
#
|
|
101904
|
-
this.#i || (this.closeMinimap(), this.#C.freeLayersResource(), this.#o.getCanvas().removeEventListener("webglcontextlost", this.#
|
|
101904
|
+
#m(A = void 0) {
|
|
101905
|
+
this.#i || (this.closeMinimap(), this.#C.freeLayersResource(), this.#o.getCanvas().removeEventListener("webglcontextlost", this.#m, !1), this.#o.remove(), this.#i = !0, this.#f = -1, this.callback("context-lost", void 0), A && A.preventDefault());
|
|
101905
101906
|
}
|
|
101906
101907
|
/**
|
|
101907
101908
|
* Restore a maplibregl instance after the cotnext is lost
|
|
101908
101909
|
*
|
|
101909
101910
|
*/
|
|
101910
101911
|
forceContextRestore() {
|
|
101911
|
-
this.#i && this.#
|
|
101912
|
+
this.#i && this.#b();
|
|
101912
101913
|
}
|
|
101913
101914
|
/**
|
|
101914
101915
|
* Initialise a maplibregl map instance
|
|
101915
101916
|
*
|
|
101916
101917
|
*/
|
|
101917
|
-
#
|
|
101918
|
+
#b() {
|
|
101918
101919
|
const A = {
|
|
101919
101920
|
style: this.#S,
|
|
101920
101921
|
container: this.#B,
|
|
101921
101922
|
attributionControl: !1
|
|
101922
101923
|
};
|
|
101923
|
-
"maxZoom" in this.#h && (A.maxZoom = this.#h.maxZoom - 1e-3), "minZoom" in this.#h && (A.minZoom = this.#h.minZoom), "bounds" in this.#h && (A.bounds = this.#h.bounds), this.#o = new wC.Map(A), this.#o.getCanvas().addEventListener("webglcontextlost", this.#
|
|
101924
|
+
"maxZoom" in this.#h && (A.maxZoom = this.#h.maxZoom - 1e-3), "minZoom" in this.#h && (A.minZoom = this.#h.minZoom), "bounds" in this.#h && (A.bounds = this.#h.bounds), this.#o = new wC.Map(A), this.#o.getCanvas().addEventListener("webglcontextlost", this.#m.bind(this), !1), this.#h.debug === !0 && (this.#o.showTileBoundaries = !0, this.#o.showCollisionBoxes = !0), this.#o.setRenderWorldCopies(!1);
|
|
101924
101925
|
const Q = this.#o.on("idle", async () => {
|
|
101925
101926
|
if (this.#f === -1)
|
|
101926
|
-
this.#f = 0, await this.#
|
|
101927
|
+
this.#f = 0, await this.#j();
|
|
101927
101928
|
else if (this.#f === 1) {
|
|
101928
101929
|
this.#f = 2, this.#o.setRenderWorldCopies(!0), this.#Q = this.#o.getBounds(), this.#Q.getEast() >= 180 && this.#Q.setNorthEast(new wC.LngLat(179.9, this.#Q.getNorth())), this.#Q.getWest() <= -180 && this.#Q.setSouthWest(new wC.LngLat(-179.9, this.#Q.getSouth()));
|
|
101929
101930
|
const B = this.#Q.toArray(), C = wC.MercatorCoordinate.fromLngLat(B[0]), i = wC.MercatorCoordinate.fromLngLat(B[1]);
|
|
@@ -101935,12 +101936,12 @@ class cuA {
|
|
|
101935
101936
|
for (; this.#f < 3; )
|
|
101936
101937
|
await MAA(10);
|
|
101937
101938
|
}
|
|
101938
|
-
async #
|
|
101939
|
-
await this.#
|
|
101939
|
+
async #j() {
|
|
101940
|
+
await this.#x(this.#H);
|
|
101940
101941
|
for (const A of this.taxonIdentifiers)
|
|
101941
|
-
await this.#
|
|
101942
|
+
await this.#x(A);
|
|
101942
101943
|
for (const A of this.#h.images || [])
|
|
101943
|
-
await this.#
|
|
101944
|
+
await this.#v(A.id, A.url, "", A.options);
|
|
101944
101945
|
if (await HAA(this.#o), !this.#F) {
|
|
101945
101946
|
const A = await this.#G.mapTermGraph(this.#p);
|
|
101946
101947
|
this.#N.load(A), this.#F = !0;
|
|
@@ -101967,7 +101968,7 @@ class cuA {
|
|
|
101967
101968
|
* @group Properties
|
|
101968
101969
|
*/
|
|
101969
101970
|
get flatmapLegend() {
|
|
101970
|
-
return this.#e.legend ? this.#e.legend : this.options.style
|
|
101971
|
+
return this.#e.legend ? this.#e.legend : this.options.style === zB.ANATOMICAL ? q$ : [];
|
|
101971
101972
|
}
|
|
101972
101973
|
/**
|
|
101973
101974
|
* @group Properties
|
|
@@ -102074,18 +102075,18 @@ class cuA {
|
|
|
102074
102075
|
*
|
|
102075
102076
|
* @private
|
|
102076
102077
|
*/
|
|
102077
|
-
async #
|
|
102078
|
+
async #P(A) {
|
|
102078
102079
|
return (await this.#o.loadImage(A)).data;
|
|
102079
102080
|
}
|
|
102080
|
-
#
|
|
102081
|
+
#z(A) {
|
|
102081
102082
|
return new Promise((I, Q) => {
|
|
102082
102083
|
const B = new Image();
|
|
102083
102084
|
B.src = A, B.onload = (C) => I(C.target);
|
|
102084
102085
|
});
|
|
102085
102086
|
}
|
|
102086
|
-
async #
|
|
102087
|
+
async #v(A, I, Q, B = {}) {
|
|
102087
102088
|
if (!this.#o.hasImage(A)) {
|
|
102088
|
-
const C = await (I.startsWith("data:image") ? this.#
|
|
102089
|
+
const C = await (I.startsWith("data:image") ? this.#z(I) : this.#P(I.startsWith("/") ? this.makeServerUrl(I) : new URL(I, Q).href));
|
|
102089
102090
|
this.#o.addImage(A, C, B);
|
|
102090
102091
|
}
|
|
102091
102092
|
}
|
|
@@ -102237,25 +102238,25 @@ class cuA {
|
|
|
102237
102238
|
setFeatureAnnotated(A) {
|
|
102238
102239
|
this.#C !== null && this.#C.setFeatureAnnotated(A);
|
|
102239
102240
|
}
|
|
102240
|
-
#
|
|
102241
|
+
#O(A, I, Q) {
|
|
102241
102242
|
if (Q) {
|
|
102242
102243
|
const B = K1(A), C = I.get(B);
|
|
102243
102244
|
C ? C.push(Q) : I.set(B, [Q]);
|
|
102244
102245
|
}
|
|
102245
102246
|
}
|
|
102246
|
-
#
|
|
102247
|
+
#U(A, I, Q, B = null) {
|
|
102247
102248
|
if (!(this.options.style !== zB.CENTRELINE && Q.centreline))
|
|
102248
102249
|
if (A in Q && Q[A].length) {
|
|
102249
102250
|
const C = Q[A];
|
|
102250
102251
|
if (Array.isArray(C))
|
|
102251
102252
|
for (const i of C)
|
|
102252
|
-
this.#
|
|
102253
|
+
this.#O(i, I, Q.featureId);
|
|
102253
102254
|
else
|
|
102254
|
-
this.#
|
|
102255
|
-
} else B !== null && "models" in Q && Q.models.startsWith(NAA) && this.#
|
|
102255
|
+
this.#O(C, I, Q.featureId);
|
|
102256
|
+
} else B !== null && "models" in Q && Q.models.startsWith(NAA) && this.#O(B, I, Q.featureId);
|
|
102256
102257
|
}
|
|
102257
|
-
#
|
|
102258
|
-
I.featureId = A, this.#l.set(+A, I), this.#
|
|
102258
|
+
#X(A, I) {
|
|
102259
|
+
I.featureId = A, this.#l.set(+A, I), this.#U("dataset", this.#s, I), this.#U("models", this.#R, I), this.#U("source", this.#M, I), this.#U("taxons", this.#K, I, fb);
|
|
102259
102260
|
for (const [Q, B] of Object.entries(I))
|
|
102260
102261
|
if (!ruA.includes(Q)) {
|
|
102261
102262
|
this.#D.has(Q) || this.#D.set(Q, new zi());
|
|
@@ -102284,13 +102285,13 @@ class cuA {
|
|
|
102284
102285
|
I.extend(this.modelFeatureIds(Q));
|
|
102285
102286
|
else
|
|
102286
102287
|
I.extend(this.modelFeatureIds(A));
|
|
102287
|
-
if (I.length
|
|
102288
|
+
if (I.length === 0)
|
|
102288
102289
|
if (Array.isArray(A))
|
|
102289
102290
|
for (const Q of A)
|
|
102290
102291
|
I.extend(this.#s.get(Q) || []), I.extend(this.#M.get(Q) || []);
|
|
102291
102292
|
else
|
|
102292
102293
|
I.extend(this.#s.get(A) || []), I.extend(this.#M.get(A) || []);
|
|
102293
|
-
return I.length
|
|
102294
|
+
return I.length === 0 && this.#C !== null && I.extend(this.#C.pathFeatureIds(A)), I;
|
|
102294
102295
|
}
|
|
102295
102296
|
modelForFeature(A) {
|
|
102296
102297
|
const I = this.#l.get(+A);
|
|
@@ -102326,13 +102327,13 @@ class cuA {
|
|
|
102326
102327
|
return [...new zi(I || [])];
|
|
102327
102328
|
}
|
|
102328
102329
|
taxonName(A) {
|
|
102329
|
-
return this.#
|
|
102330
|
+
return this.#J.has(A) ? this.#J.get(A) : A;
|
|
102330
102331
|
}
|
|
102331
|
-
async #
|
|
102332
|
-
if (A && !this.#
|
|
102332
|
+
async #x(A) {
|
|
102333
|
+
if (A && !this.#J.has(A)) {
|
|
102333
102334
|
const I = await this.queryLabels(A);
|
|
102334
102335
|
if (I.length && "label" in I[0])
|
|
102335
|
-
return this.#
|
|
102336
|
+
return this.#J.set(A, I[0].label);
|
|
102336
102337
|
}
|
|
102337
102338
|
}
|
|
102338
102339
|
/**
|
|
@@ -103129,7 +103130,7 @@ class cuA {
|
|
|
103129
103130
|
}
|
|
103130
103131
|
//==========================================================================
|
|
103131
103132
|
}
|
|
103132
|
-
const wuA = "4.5.
|
|
103133
|
+
const wuA = "4.5.2", huA = 1.4;
|
|
103133
103134
|
class xuA {
|
|
103134
103135
|
/**
|
|
103135
103136
|
* The released version of the viewer
|