@thibezer/ui-components-kit 2.2.1 → 2.2.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/CHANGELOG.md +10 -0
- package/dist/camadas.cjs +67 -67
- package/dist/camadas.js +433 -345
- package/dist/canvas.cjs +14 -14
- package/dist/canvas.js +316 -298
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
- package/dist/custom-elements.json +11443 -11404
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +5 -1
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +1 -0
- package/package.json +1 -1
package/dist/canvas.js
CHANGED
|
@@ -4,7 +4,7 @@ var p = (n, t, e) => Wo(n, typeof t != "symbol" ? t + "" : t, e);
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import y from "leaflet";
|
|
6
6
|
import { e as _, p as B, r as Ct, b as Mt, a as $t, o as qt, c as Ee, l as Uo } from "./leaflet-PPDKB6Dd.js";
|
|
7
|
-
import { f as
|
|
7
|
+
import { f as rs } from "./leaflet-PPDKB6Dd.js";
|
|
8
8
|
import { L as pe } from "./listener-bag-DQgv7OON.js";
|
|
9
9
|
import { d as Xo, S as Zo } from "./ssr-safe-5cWfJP-s.js";
|
|
10
10
|
const Ie = {
|
|
@@ -24,13 +24,13 @@ const Ie = {
|
|
|
24
24
|
crosshair: !1,
|
|
25
25
|
satOpacity: 1,
|
|
26
26
|
magnetSnap: !1
|
|
27
|
-
},
|
|
27
|
+
}, lt = class lt {
|
|
28
28
|
constructor() {
|
|
29
29
|
p(this, "config");
|
|
30
30
|
this.config = this.loadConfig();
|
|
31
31
|
}
|
|
32
32
|
static getInstance() {
|
|
33
|
-
return
|
|
33
|
+
return lt.instance || (lt.instance = new lt()), lt.instance;
|
|
34
34
|
}
|
|
35
35
|
loadConfig() {
|
|
36
36
|
try {
|
|
@@ -49,8 +49,8 @@ const Ie = {
|
|
|
49
49
|
return this.config = this.loadConfig(), { ...this.config };
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
p(
|
|
53
|
-
let fe =
|
|
52
|
+
p(lt, "instance");
|
|
53
|
+
let fe = lt;
|
|
54
54
|
async function Yo(n, t, e, o) {
|
|
55
55
|
const i = n.getSize(), a = n.getBounds(), s = a.getSouthWest(), r = a.getNorthEast(), c = `${s.lng},${s.lat},${r.lng},${r.lat}`;
|
|
56
56
|
let l = 0, d = 0;
|
|
@@ -400,7 +400,7 @@ const vo = ["poligono", "linha", "ponto", "texto"];
|
|
|
400
400
|
function yo(n, t) {
|
|
401
401
|
return `${me(n)}-${t}`;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function at(n, t, e) {
|
|
404
404
|
const o = n.getPane(me(t)) ?? n.createPane(me(t)), i = yo(t, e);
|
|
405
405
|
if (!n.getPane(i)) {
|
|
406
406
|
const a = n.createPane(i, o);
|
|
@@ -485,7 +485,7 @@ function li(n, t, e) {
|
|
|
485
485
|
!0
|
|
486
486
|
), !0);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Ha(n, t, e) {
|
|
489
489
|
return xo(n, t, n.mouseEventToLayerPoint(e))[0] ?? null;
|
|
490
490
|
}
|
|
491
491
|
class di {
|
|
@@ -638,7 +638,7 @@ class di {
|
|
|
638
638
|
this.desativar();
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
class
|
|
641
|
+
class F {
|
|
642
642
|
static register(t, e) {
|
|
643
643
|
this.renderers.set(t.toLowerCase(), e);
|
|
644
644
|
}
|
|
@@ -652,7 +652,7 @@ class O {
|
|
|
652
652
|
return Array.from(this.renderers.keys());
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
p(
|
|
655
|
+
p(F, "renderers", /* @__PURE__ */ new Map());
|
|
656
656
|
class hi {
|
|
657
657
|
render(t, e, o) {
|
|
658
658
|
var c, l, d;
|
|
@@ -710,7 +710,7 @@ function bo(n, t, e) {
|
|
|
710
710
|
}
|
|
711
711
|
return Math.max(1, Math.round(o * i));
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function pt(n, t, e, o, i) {
|
|
714
714
|
const a = Math.max(Math.round(e + 3), 4);
|
|
715
715
|
y.polyline(t, {
|
|
716
716
|
color: "#080d0a",
|
|
@@ -744,15 +744,15 @@ function De(n, t, e, o, i) {
|
|
|
744
744
|
};
|
|
745
745
|
if (s && Array.isArray(s)) {
|
|
746
746
|
s.forEach((v) => {
|
|
747
|
-
var z, S, w, E, I,
|
|
747
|
+
var z, S, w, E, I, O, T;
|
|
748
748
|
const b = m(v.origemId), A = m(v.destinoId);
|
|
749
749
|
if (b && A && b.lat && b.lon && A.lat && A.lon) {
|
|
750
|
-
const
|
|
751
|
-
|
|
750
|
+
const U = v.tipoLinha === "tracejada" || ((z = v.estilo) == null ? void 0 : z.tipoLinha) === "tracejada", $ = ((S = v.estilo) == null ? void 0 : S.cor) || ((w = v.estilo) == null ? void 0 : w.color) || n.estilo.corPrimaria || "#00f5a0", N = ((E = v.estilo) == null ? void 0 : E.espessura) || ((I = v.estilo) == null ? void 0 : I.weight) || l, q = [[b.lat, b.lon], [A.lat, A.lon]], R = U ? "6, 6" : n.estilo.dashArray;
|
|
751
|
+
pt(t, q, N, i, R);
|
|
752
752
|
const D = y.polyline(q, {
|
|
753
753
|
color: $,
|
|
754
754
|
weight: N,
|
|
755
|
-
opacity: ((
|
|
755
|
+
opacity: ((O = v.estilo) == null ? void 0 : O.opacidade) ?? d,
|
|
756
756
|
dashArray: R,
|
|
757
757
|
pane: i,
|
|
758
758
|
interactive: h
|
|
@@ -765,12 +765,12 @@ function De(n, t, e, o, i) {
|
|
|
765
765
|
<div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Tipo: ${_(v.tipoLinha || "contínua")}</div>
|
|
766
766
|
${Y}
|
|
767
767
|
</div>
|
|
768
|
-
`, { className: "compact-popup", maxWidth: 220 }), D.on("popupopen", (
|
|
768
|
+
`, { className: "compact-popup", maxWidth: 220 }), D.on("popupopen", (st) => {
|
|
769
769
|
if (o.modoSequencial) {
|
|
770
770
|
D.closePopup();
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
|
-
Mt(
|
|
773
|
+
Mt(st.popup, v, o, D);
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
776
|
D.addTo(t);
|
|
@@ -784,8 +784,8 @@ function De(n, t, e, o, i) {
|
|
|
784
784
|
const E = qt(w);
|
|
785
785
|
if (E.length < 2) return;
|
|
786
786
|
const I = E.map((T) => [T.lat, T.lon]);
|
|
787
|
-
|
|
788
|
-
const
|
|
787
|
+
pt(t, I, l, i, n.estilo.dashArray);
|
|
788
|
+
const O = y.polyline(I, {
|
|
789
789
|
color: z,
|
|
790
790
|
weight: l,
|
|
791
791
|
opacity: d,
|
|
@@ -793,14 +793,14 @@ function De(n, t, e, o, i) {
|
|
|
793
793
|
pane: i,
|
|
794
794
|
interactive: h
|
|
795
795
|
});
|
|
796
|
-
if (h &&
|
|
796
|
+
if (h && O.bindPopup(`
|
|
797
797
|
<div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
|
|
798
798
|
<div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">Polilinha: Grupo ${_(S)}</div>
|
|
799
799
|
<div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Vértices: ${E.length}</div>
|
|
800
800
|
</div>
|
|
801
|
-
`, { className: "compact-popup", maxWidth: 220 }),
|
|
802
|
-
const T = I[I.length - 1],
|
|
803
|
-
|
|
801
|
+
`, { className: "compact-popup", maxWidth: 220 }), O.addTo(t), A && I.length >= 3) {
|
|
802
|
+
const T = I[I.length - 1], U = I[0], $ = [T, U];
|
|
803
|
+
pt(t, $, l, i, "4, 4"), y.polyline($, {
|
|
804
804
|
color: z,
|
|
805
805
|
weight: l,
|
|
806
806
|
opacity: d,
|
|
@@ -817,12 +817,12 @@ function De(n, t, e, o, i) {
|
|
|
817
817
|
var z;
|
|
818
818
|
const b = u.find((S) => String(S.id) === String(v.ponto_inicio_id)), A = u.find((S) => String(S.id) === String(v.ponto_fim_id));
|
|
819
819
|
if (b && A && b.lat && b.lon && A.lat && A.lon) {
|
|
820
|
-
const S = v.tipo_limite_sigef || v.tipo_limite || "", w = v.metodo_posicionamento_sigef || v.metodo_posicionamento || "", E = S === "LA1" ? "#10b981" : S === "LN1" ? "#3b82f6" : "#00f5a0", I = v.id != null ? v.id : `${v.ponto_inicio_id}-${v.ponto_fim_id}`,
|
|
821
|
-
|
|
822
|
-
const q = y.polyline(
|
|
820
|
+
const S = v.tipo_limite_sigef || v.tipo_limite || "", w = v.metodo_posicionamento_sigef || v.metodo_posicionamento || "", E = S === "LA1" ? "#10b981" : S === "LN1" ? "#3b82f6" : "#00f5a0", I = v.id != null ? v.id : `${v.ponto_inicio_id}-${v.ponto_fim_id}`, O = o.selectedSegmentoId != null && (String(o.selectedSegmentoId) === String(v.id) || String(o.selectedSegmentoId) === String(I)), T = O ? "#facc15" : n.estilo.corPrimaria || E, U = [[b.lat, b.lon], [A.lat, A.lon]], $ = O ? l + 3 : l, N = S === "LN1" ? "6, 6" : n.estilo.dashArray;
|
|
821
|
+
pt(t, U, O ? $ + 2 : $, i, N);
|
|
822
|
+
const q = y.polyline(U, {
|
|
823
823
|
color: T,
|
|
824
824
|
weight: $,
|
|
825
|
-
opacity:
|
|
825
|
+
opacity: O ? 1 : d,
|
|
826
826
|
dashArray: N,
|
|
827
827
|
pane: i,
|
|
828
828
|
interactive: h
|
|
@@ -860,7 +860,7 @@ function De(n, t, e, o, i) {
|
|
|
860
860
|
const E = qt(w);
|
|
861
861
|
if (E.length < 2) return;
|
|
862
862
|
const I = E.map((T) => [T.lat, T.lon]);
|
|
863
|
-
if (
|
|
863
|
+
if (pt(t, I, l, i, S), y.polyline(I, {
|
|
864
864
|
color: z,
|
|
865
865
|
weight: l,
|
|
866
866
|
opacity: d,
|
|
@@ -868,8 +868,8 @@ function De(n, t, e, o, i) {
|
|
|
868
868
|
pane: i,
|
|
869
869
|
interactive: h
|
|
870
870
|
}).addTo(t), I.length >= 3) {
|
|
871
|
-
const T = I[I.length - 1],
|
|
872
|
-
|
|
871
|
+
const T = I[I.length - 1], U = I[0], $ = a ? "6, 8" : "4, 4", N = [T, U];
|
|
872
|
+
pt(t, N, l, i, $), y.polyline(N, {
|
|
873
873
|
color: z,
|
|
874
874
|
weight: l,
|
|
875
875
|
opacity: d,
|
|
@@ -886,7 +886,7 @@ class pi {
|
|
|
886
886
|
p(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
|
|
887
887
|
}
|
|
888
888
|
render(t, e, o) {
|
|
889
|
-
const i = y.layerGroup(), a =
|
|
889
|
+
const i = y.layerGroup(), a = at(e, t.id, "linha");
|
|
890
890
|
De(t, i, e, o, a);
|
|
891
891
|
const s = () => {
|
|
892
892
|
if (t.estilo.scaleMode === "world") {
|
|
@@ -899,7 +899,7 @@ class pi {
|
|
|
899
899
|
return e.on("zoomend", s), this.zoomListenerMap.set(i, s), i;
|
|
900
900
|
}
|
|
901
901
|
update(t, e, o, i, a) {
|
|
902
|
-
(o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), De(t, e, a, i,
|
|
902
|
+
(o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), De(t, e, a, i, at(a, t.id, "linha")));
|
|
903
903
|
}
|
|
904
904
|
destroy(t, e) {
|
|
905
905
|
const o = this.zoomListenerMap.get(t);
|
|
@@ -968,7 +968,7 @@ class mi {
|
|
|
968
968
|
p(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
|
|
969
969
|
}
|
|
970
970
|
render(t, e, o) {
|
|
971
|
-
const i = y.layerGroup(), a =
|
|
971
|
+
const i = y.layerGroup(), a = at(e, t.id, "ponto");
|
|
972
972
|
this.rebuildPoints(t, i, e, o, a);
|
|
973
973
|
const s = () => {
|
|
974
974
|
i.eachLayer((r) => {
|
|
@@ -1033,8 +1033,8 @@ class mi {
|
|
|
1033
1033
|
`, {
|
|
1034
1034
|
className: "compact-popup",
|
|
1035
1035
|
maxWidth: 240
|
|
1036
|
-
}), E && E.length > 0 && S.on("popupopen", (
|
|
1037
|
-
Mt(
|
|
1036
|
+
}), E && E.length > 0 && S.on("popupopen", (O) => {
|
|
1037
|
+
Mt(O.popup, f, i, S);
|
|
1038
1038
|
}), S.on("click", () => {
|
|
1039
1039
|
i.onMarkerClick && i.onMarkerClick(f.id, l, f, { lat: Number(g), lon: Number(x) });
|
|
1040
1040
|
});
|
|
@@ -1044,7 +1044,7 @@ class mi {
|
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
1046
|
update(t, e, o, i, a) {
|
|
1047
|
-
(o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), this.rebuildPoints(t, e, a, i,
|
|
1047
|
+
(o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), this.rebuildPoints(t, e, a, i, at(a, t.id, "ponto")));
|
|
1048
1048
|
}
|
|
1049
1049
|
destroy(t, e) {
|
|
1050
1050
|
const o = this.zoomListenerMap.get(t);
|
|
@@ -1058,11 +1058,11 @@ class gi {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
rebuildPolygons(t, e, o, i) {
|
|
1060
1060
|
var m, f;
|
|
1061
|
-
const a =
|
|
1061
|
+
const a = at(i, t.id, "poligono"), s = at(i, t.id, "ponto"), c = (((m = t.dados) == null ? void 0 : m.poligonos) ?? (Array.isArray(t.dados) ? t.dados : null)) || ((f = t.dados) == null ? void 0 : f.confrontantes) || o.confrontantes || [], l = t.interativo && !t.bloqueada, d = t.estilo.corPrimaria || "#a855f7", h = t.estilo.espessuraLinha || 1, u = t.opacidade !== void 0 ? t.opacidade : 0.8;
|
|
1062
1062
|
c.forEach((g) => {
|
|
1063
|
-
var b, A, z, S, w, E, I,
|
|
1063
|
+
var b, A, z, S, w, E, I, O, T, U;
|
|
1064
1064
|
if (!g) return;
|
|
1065
|
-
const x = ((b = g.estilo) == null ? void 0 : b.cor) || ((A = g.estilo) == null ? void 0 : A.color) || d, M = ((z = g.estilo) == null ? void 0 : z.espessura) || ((S = g.estilo) == null ? void 0 : S.weight) || h, C = ((w = g.estilo) == null ? void 0 : w.opacidade) ?? u, L = ((E = g.estilo) == null ? void 0 : E.fillColor) || x, k = ((I = g.estilo) == null ? void 0 : I.fillOpacity) ?? Math.min(0.14, C * 0.1), P = ((
|
|
1065
|
+
const x = ((b = g.estilo) == null ? void 0 : b.cor) || ((A = g.estilo) == null ? void 0 : A.color) || d, M = ((z = g.estilo) == null ? void 0 : z.espessura) || ((S = g.estilo) == null ? void 0 : S.weight) || h, C = ((w = g.estilo) == null ? void 0 : w.opacidade) ?? u, L = ((E = g.estilo) == null ? void 0 : E.fillColor) || x, k = ((I = g.estilo) == null ? void 0 : I.fillOpacity) ?? Math.min(0.14, C * 0.1), P = ((O = g.estilo) == null ? void 0 : O.dashArray) || t.estilo.dashArray || "4, 6";
|
|
1066
1066
|
if (g.coordenadas && Array.isArray(g.coordenadas) && g.coordenadas.length >= 3) {
|
|
1067
1067
|
const $ = Array.isArray(g.coordenadas[0]) && Array.isArray(g.coordenadas[0][0]);
|
|
1068
1068
|
let N;
|
|
@@ -1110,8 +1110,8 @@ class gi {
|
|
|
1110
1110
|
const V = D[1].split(",").map((G) => {
|
|
1111
1111
|
const Y = G.trim().split(/\s+/);
|
|
1112
1112
|
if (Y.length < 2) return null;
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1113
|
+
const st = B(Y[1], Y[0]);
|
|
1114
|
+
return st ? [st.lat, st.lon] : null;
|
|
1115
1115
|
}).filter((G) => G !== null);
|
|
1116
1116
|
V.length >= 3 && R.push(V);
|
|
1117
1117
|
}), R.length > 0) {
|
|
@@ -1127,7 +1127,7 @@ class gi {
|
|
|
1127
1127
|
interactive: l
|
|
1128
1128
|
});
|
|
1129
1129
|
if (V.poligonoId = g.id, V.layerId = t.id, l) {
|
|
1130
|
-
const G = g.acoes || t.acoes || ((
|
|
1130
|
+
const G = g.acoes || t.acoes || ((U = t.dados) == null ? void 0 : U.acoes) || [], Y = Ct(G, g.id);
|
|
1131
1131
|
V.bindPopup(`
|
|
1132
1132
|
<div style="font-family:var(--ui-fonte-base, sans-serif); color:rgba(255, 255, 255, 0.9); line-height:1.3; min-width:180px;">
|
|
1133
1133
|
<div style="font-weight:700; font-size:12px; color:#c084fc; margin-bottom:3px; border-bottom:1px solid rgba(255,255,255,0.1); padding-bottom:3px;">${N}</div>
|
|
@@ -1135,12 +1135,12 @@ class gi {
|
|
|
1135
1135
|
${g.nome ? `<div style="font-size:11px;"><strong>Proprietário:</strong> ${q}</div>` : ""}
|
|
1136
1136
|
${Y}
|
|
1137
1137
|
</div>
|
|
1138
|
-
`, { className: "compact-popup", maxWidth: 220 }), V.on("popupopen", (
|
|
1138
|
+
`, { className: "compact-popup", maxWidth: 220 }), V.on("popupopen", (st) => {
|
|
1139
1139
|
if (o.modoSequencial) {
|
|
1140
1140
|
V.closePopup();
|
|
1141
1141
|
return;
|
|
1142
1142
|
}
|
|
1143
|
-
Mt(
|
|
1143
|
+
Mt(st.popup, g, o, V);
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
V.addTo(e);
|
|
@@ -1230,7 +1230,7 @@ class vi {
|
|
|
1230
1230
|
o && (e.off("zoomend moveend", o), this.moveListenerMap.delete(t)), t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function W(n) {
|
|
1234
1234
|
return n.partes && n.partes.length > 1 ? n.partes : [n.coordenadas];
|
|
1235
1235
|
}
|
|
1236
1236
|
function Nt(n) {
|
|
@@ -1240,16 +1240,16 @@ function wt(n) {
|
|
|
1240
1240
|
return n.length > 1 ? { tipo: "LineString", coordenadas: n[0], partes: n } : { tipo: "LineString", coordenadas: n[0] };
|
|
1241
1241
|
}
|
|
1242
1242
|
const xe = 63710088e-1, ot = (n) => n * Math.PI / 180;
|
|
1243
|
-
function
|
|
1243
|
+
function ht(n, t) {
|
|
1244
1244
|
const e = ot(t[0] - n[0]), o = ot(t[1] - n[1]), i = Math.sin(e / 2) ** 2 + Math.cos(ot(n[0])) * Math.cos(ot(t[0])) * Math.sin(o / 2) ** 2;
|
|
1245
1245
|
return 2 * xe * Math.asin(Math.min(1, Math.sqrt(i)));
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1247
|
+
function Ot(n, t = !1) {
|
|
1248
1248
|
let e = 0;
|
|
1249
|
-
for (let o = 1; o < n.length; o++) e +=
|
|
1250
|
-
return t && n.length > 2 && (e +=
|
|
1249
|
+
for (let o = 1; o < n.length; o++) e += ht(n[o - 1], n[o]);
|
|
1250
|
+
return t && n.length > 2 && (e += ht(n[n.length - 1], n[0])), e;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Oe(n) {
|
|
1253
1253
|
const t = ot(n.reduce((i, a) => i + a[0], 0) / n.length), e = n.map((i) => [ot(i[1]) * Math.cos(t) * xe, ot(i[0]) * xe]);
|
|
1254
1254
|
let o = 0;
|
|
1255
1255
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1260,31 +1260,31 @@ function Fe(n) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
function yi(n) {
|
|
1262
1262
|
const [t, ...e] = n;
|
|
1263
|
-
return t ? Math.max(0,
|
|
1263
|
+
return t ? Math.max(0, Oe(t) - e.reduce((o, i) => o + Oe(i), 0)) : 0;
|
|
1264
1264
|
}
|
|
1265
|
-
const xi = new Intl.NumberFormat("pt-BR", { minimumFractionDigits: 4, maximumFractionDigits: 4 }),
|
|
1266
|
-
function
|
|
1265
|
+
const xi = new Intl.NumberFormat("pt-BR", { minimumFractionDigits: 4, maximumFractionDigits: 4 }), Fe = new Intl.NumberFormat("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
1266
|
+
function ut(n) {
|
|
1267
1267
|
return `${xi.format(n / 1e4)} ha`;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return n >= 1e3 ? `${
|
|
1269
|
+
function H(n) {
|
|
1270
|
+
return n >= 1e3 ? `${Fe.format(n / 1e3)} km` : `${Fe.format(n)} m`;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function it(n) {
|
|
1273
1273
|
return n.tipo === "Polygon" ? yi(n.aneis) : n.tipo === "Circle" ? Math.PI * n.raioMetros ** 2 : null;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return n.tipo === "LineString" ?
|
|
1275
|
+
function nt(n) {
|
|
1276
|
+
return n.tipo === "LineString" ? W(n).reduce((t, e) => t + Ot(e), 0) : n.tipo === "Polygon" ? Ot(n.aneis[0] ?? [], !0) : n.tipo === "Circle" ? 2 * Math.PI * n.raioMetros : null;
|
|
1277
1277
|
}
|
|
1278
1278
|
function bi(n, t) {
|
|
1279
1279
|
var i;
|
|
1280
1280
|
const e = t ?? "name";
|
|
1281
1281
|
if (e === "area") {
|
|
1282
|
-
const a =
|
|
1283
|
-
return a === null ? "" :
|
|
1282
|
+
const a = it(n.geometria);
|
|
1283
|
+
return a === null ? "" : ut(a);
|
|
1284
1284
|
}
|
|
1285
1285
|
if (e === "extensao") {
|
|
1286
|
-
const a =
|
|
1287
|
-
return a === null ? "" :
|
|
1286
|
+
const a = nt(n.geometria);
|
|
1287
|
+
return a === null ? "" : H(a);
|
|
1288
1288
|
}
|
|
1289
1289
|
if (e === "id") return n.id;
|
|
1290
1290
|
const o = (i = n.propriedades) == null ? void 0 : i[e];
|
|
@@ -1298,7 +1298,7 @@ function Lo(n) {
|
|
|
1298
1298
|
t = [n.coordenada];
|
|
1299
1299
|
break;
|
|
1300
1300
|
case "LineString":
|
|
1301
|
-
t =
|
|
1301
|
+
t = W(n).flat();
|
|
1302
1302
|
break;
|
|
1303
1303
|
case "Polygon":
|
|
1304
1304
|
t = n.aneis.flat();
|
|
@@ -1437,11 +1437,11 @@ function Ai(n, t) {
|
|
|
1437
1437
|
return o.pop(), o.length >= 3 ? o : n;
|
|
1438
1438
|
}
|
|
1439
1439
|
function Mo(n) {
|
|
1440
|
-
return (n.tipo === "LineString" || n.tipo === "Polygon") && n.curva ? 0 : n.tipo === "LineString" ?
|
|
1440
|
+
return (n.tipo === "LineString" || n.tipo === "Polygon") && n.curva ? 0 : n.tipo === "LineString" ? W(n).reduce((t, e) => t + e.length, 0) : n.tipo === "Polygon" ? n.aneis.reduce((t, e) => t + e.length, 0) : 0;
|
|
1441
1441
|
}
|
|
1442
1442
|
function ki(n, t) {
|
|
1443
1443
|
const e = Mi(t);
|
|
1444
|
-
return e === 0 || Mo(n) < So ? n : n.tipo === "LineString" ? wt(
|
|
1444
|
+
return e === 0 || Mo(n) < So ? n : n.tipo === "LineString" ? wt(W(n).map((o) => Co(o, e))) : n.tipo === "Polygon" ? { tipo: "Polygon", aneis: n.aneis.map((o) => Ai(o, e)) } : n;
|
|
1445
1445
|
}
|
|
1446
1446
|
const zi = /* @__PURE__ */ new Set(["previa", "prévia", "preview", "rascunho", "draft", "proposta"]);
|
|
1447
1447
|
function J(n) {
|
|
@@ -1602,17 +1602,17 @@ class Io extends y.Polygon {
|
|
|
1602
1602
|
zo(this, !0) || y.Polygon.prototype._updatePath.call(this);
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Ft(n) {
|
|
1606
1606
|
return n.tipo === "LineString" ? n.curva && n.curva.length >= 2 && !(n.partes && n.partes.length > 1) ? n.curva : null : n.tipo === "Polygon" && n.curva && n.curva.length >= 3 && n.aneis.length === 1 ? n.curva : null;
|
|
1607
1607
|
}
|
|
1608
1608
|
function _o(n, t) {
|
|
1609
|
-
const e =
|
|
1609
|
+
const e = Ft(n);
|
|
1610
1610
|
if (!e) return null;
|
|
1611
1611
|
const o = n.tipo === "Polygon" ? new Io(n.aneis[0], t) : new Eo(n.coordenadas, t);
|
|
1612
1612
|
return o.definirCurva(e), o;
|
|
1613
1613
|
}
|
|
1614
1614
|
function $i(n, t) {
|
|
1615
|
-
n.definirCurva(
|
|
1615
|
+
n.definirCurva(Ft(t)), n.setLatLngs(t.tipo === "Polygon" ? t.aneis[0] : t.coordenadas);
|
|
1616
1616
|
}
|
|
1617
1617
|
const Rt = 55, qi = 17, Di = 8;
|
|
1618
1618
|
function Le(n, t) {
|
|
@@ -1624,7 +1624,7 @@ function Ni(n) {
|
|
|
1624
1624
|
t += o.coordenada[0], e += o.coordenada[1];
|
|
1625
1625
|
return [t / n.length, e / n.length];
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function Wa(n, t, e) {
|
|
1628
1628
|
if (!Le(n.length, t)) return { clusters: [], isolados: n };
|
|
1629
1629
|
const o = /* @__PURE__ */ new Map();
|
|
1630
1630
|
for (const s of n) {
|
|
@@ -1636,7 +1636,7 @@ function ja(n, t, e) {
|
|
|
1636
1636
|
r.length === 1 ? a.push(r[0]) : i.push({ chave: s, coordenada: Ni(r), membros: r });
|
|
1637
1637
|
return { clusters: i, isolados: a };
|
|
1638
1638
|
}
|
|
1639
|
-
class
|
|
1639
|
+
class Oi {
|
|
1640
1640
|
constructor(t, e) {
|
|
1641
1641
|
p(this, "celulas", /* @__PURE__ */ new Map());
|
|
1642
1642
|
p(this, "celulaDe", /* @__PURE__ */ new Map());
|
|
@@ -1690,9 +1690,9 @@ const Qt = {
|
|
|
1690
1690
|
warning: '<path d="M12 3 L22 20 H2 Z M12 9 V14 M12 17 V17.5" />',
|
|
1691
1691
|
water: '<path d="M12 3 C12 3 5 11 5 15.5 A7 7 0 0 0 19 15.5 C19 11 12 3 12 3 Z" />',
|
|
1692
1692
|
boundary: '<path d="M12 2 L22 12 L12 22 L2 12 Z" />'
|
|
1693
|
-
}, te = "#38bdf8",
|
|
1693
|
+
}, te = "#38bdf8", Fi = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\([0-9.,%\s\/-]+\)|[a-z]{3,20})$/i;
|
|
1694
1694
|
function K(n, t) {
|
|
1695
|
-
return n &&
|
|
1695
|
+
return n && Fi.test(n.trim()) ? n.trim() : t;
|
|
1696
1696
|
}
|
|
1697
1697
|
const bt = "#38bdf8", Ri = 150, Bi = 100, He = 300, We = 0.75, Vi = 0.3, ee = typeof requestAnimationFrame == "function" ? (n) => {
|
|
1698
1698
|
requestAnimationFrame(n);
|
|
@@ -1916,7 +1916,7 @@ class ji {
|
|
|
1916
1916
|
return t.agrupador = null, null;
|
|
1917
1917
|
const i = t.agrupador;
|
|
1918
1918
|
if (i && i.zoom === e && t.agrupadorRev === t.revisaoBase) return i;
|
|
1919
|
-
const a = new
|
|
1919
|
+
const a = new Oi(e, (s) => t.map.project(y.latLng(s[0], s[1]), e));
|
|
1920
1920
|
for (const s of t.loja.values())
|
|
1921
1921
|
s.geometria.tipo === "Point" && o(s) && a.inserir({ id: s.id, coordenada: s.geometria.coordenada });
|
|
1922
1922
|
return t.agrupador = a, t.agrupadorRev = t.revisaoBase, a;
|
|
@@ -2037,11 +2037,11 @@ class ji {
|
|
|
2037
2037
|
this.tirarCluster(t, e, v);
|
|
2038
2038
|
continue;
|
|
2039
2039
|
}
|
|
2040
|
-
const
|
|
2040
|
+
const O = [z / E, S / E];
|
|
2041
2041
|
this.colocarCluster(t, e, v, {
|
|
2042
|
-
coordenada:
|
|
2042
|
+
coordenada: O,
|
|
2043
2043
|
total: A,
|
|
2044
|
-
assinatura: `${v}:${A}:${E}:${
|
|
2044
|
+
assinatura: `${v}:${A}:${E}:${O[0].toFixed(7)}:${O[1].toFixed(7)}`
|
|
2045
2045
|
});
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
@@ -2052,7 +2052,7 @@ class ji {
|
|
|
2052
2052
|
html: `<div style="width:${a}px;height:${a}px;border-radius:50%;background:${s};opacity:.9;border:2px solid rgba(255,255,255,.85);display:flex;align-items:center;justify-content:center;color:#fff;font:700 12px sans-serif;text-shadow:0 0 2px #000">${e}</div>`
|
|
2053
2053
|
}), c = y.marker(t, {
|
|
2054
2054
|
icon: r,
|
|
2055
|
-
pane:
|
|
2055
|
+
pane: at(i.map, i.layerDef.id, "ponto"),
|
|
2056
2056
|
keyboard: !1
|
|
2057
2057
|
});
|
|
2058
2058
|
return c.bindTooltip(`${e} feições agrupadas`, { direction: "top" }), c.on("click", () => {
|
|
@@ -2099,7 +2099,7 @@ class ji {
|
|
|
2099
2099
|
formaDe(t) {
|
|
2100
2100
|
var o;
|
|
2101
2101
|
const e = t.geometria;
|
|
2102
|
-
return e.tipo === "Point" ? `Point:${(o = t.estilo) != null && o.icone && Qt[t.estilo.icone] ? t.estilo.icone : ""}` :
|
|
2102
|
+
return e.tipo === "Point" ? `Point:${(o = t.estilo) != null && o.icone && Qt[t.estilo.icone] ? t.estilo.icone : ""}` : Ft(e) ? `${e.tipo}:curva` : e.tipo;
|
|
2103
2103
|
}
|
|
2104
2104
|
paneDe(t) {
|
|
2105
2105
|
switch (t.geometria.tipo) {
|
|
@@ -2130,7 +2130,7 @@ class ji {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
criar(t, e, o, i, a) {
|
|
2132
2132
|
var d, h;
|
|
2133
|
-
const s =
|
|
2133
|
+
const s = at(o, e.id, this.paneDe(t)), r = t.geometria, c = this.estiloVetor(t, e, i, a), l = _o(r, { ...c, pane: s });
|
|
2134
2134
|
if (l) return l;
|
|
2135
2135
|
switch (r.tipo) {
|
|
2136
2136
|
case "Polygon":
|
|
@@ -2138,7 +2138,7 @@ class ji {
|
|
|
2138
2138
|
case "Circle":
|
|
2139
2139
|
return y.circle(r.centro, { ...c, radius: r.raioMetros, pane: s });
|
|
2140
2140
|
case "LineString":
|
|
2141
|
-
return y.polyline(r.partes && r.partes.length > 1 ?
|
|
2141
|
+
return y.polyline(r.partes && r.partes.length > 1 ? W(r) : r.coordenadas, { ...c, pane: s });
|
|
2142
2142
|
case "Point": {
|
|
2143
2143
|
const u = (d = t.estilo) == null ? void 0 : d.icone;
|
|
2144
2144
|
return u && Qt[u] ? y.marker(r.coordenada, { icon: this.iconeSvg(t, e, a), pane: s, interactive: i }) : y.circleMarker(r.coordenada, {
|
|
@@ -2159,7 +2159,7 @@ class ji {
|
|
|
2159
2159
|
remendar(t, e, o, i, a) {
|
|
2160
2160
|
var c, l, d;
|
|
2161
2161
|
const s = e.geometria, r = this.estiloVetor(e, o, i, a);
|
|
2162
|
-
(t instanceof Eo || t instanceof Io) &&
|
|
2162
|
+
(t instanceof Eo || t instanceof Io) && Ft(s) ? ($i(t, s), t.setStyle(r)) : s.tipo === "Polygon" ? (t.setLatLngs(s.aneis.length === 1 ? s.aneis[0] : s.aneis), t.setStyle(r)) : s.tipo === "LineString" ? (t.setLatLngs(s.partes && s.partes.length > 1 ? W(s) : s.coordenadas), t.setStyle(r)) : s.tipo === "Circle" ? (t.setLatLng(s.centro), t.setRadius(s.raioMetros), t.setStyle(r)) : s.tipo === "Point" && t instanceof y.CircleMarker ? (t.setLatLng(s.coordenada), t.setRadius((((c = e.estilo) == null ? void 0 : c.tamanhoIcone) ?? o.estilo.tamanhoMarcador ?? 8) / 2), t.setStyle(r)) : t instanceof y.Marker && (t.setLatLng(s.tipo === "Point" || s.tipo === "Text" ? s.coordenada : t.getLatLng()), t.setIcon(s.tipo === "Text" ? this.iconeTexto(e, o, a) : this.iconeSvg(e, o, a)), s.tipo === "Text" && (i && !e.bloqueada ? (l = t.dragging) == null || l.enable() : (d = t.dragging) == null || d.disable())), this.aplicarRotulo(t, e);
|
|
2163
2163
|
}
|
|
2164
2164
|
iconeSvg(t, e, o = !1) {
|
|
2165
2165
|
const i = t.estilo ?? {}, a = i.tamanhoIcone ?? e.estilo.tamanhoMarcador, s = typeof a == "number" && Number.isFinite(a) && a > 0 ? a : 22, r = o ? bt : K(i.corTraco ?? i.corPreenchimento ?? e.estilo.corPrimaria, te), c = Number.isFinite(i.rotacaoIcone) ? i.rotacaoIcone : 0, l = Qt[i.icone ?? ""] ?? "";
|
|
@@ -2223,13 +2223,13 @@ class ji {
|
|
|
2223
2223
|
});
|
|
2224
2224
|
}
|
|
2225
2225
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2226
|
+
F.register("tile", new hi());
|
|
2227
|
+
F.register("wms", new ui());
|
|
2228
|
+
F.register("vetorial-linhas", new pi());
|
|
2229
|
+
F.register("vetorial-pontos", new mi());
|
|
2230
|
+
F.register("vetorial-poligonos", new gi());
|
|
2231
|
+
F.register("grid", new vi());
|
|
2232
|
+
F.register("feicoes", new ji());
|
|
2233
2233
|
const Ue = [
|
|
2234
2234
|
{
|
|
2235
2235
|
id: "satelite",
|
|
@@ -2391,11 +2391,11 @@ class Hi {
|
|
|
2391
2391
|
this.renderPendente = !1, !(!this.map || !this.context) && (this.layers.forEach((e) => {
|
|
2392
2392
|
if (!(t && Gi.has(e.tipo) && e.visivel && this.layerInstances.has(e.id))) {
|
|
2393
2393
|
if (this.layerInstances.has(e.id)) {
|
|
2394
|
-
const o = this.layerInstances.get(e.id), i =
|
|
2394
|
+
const o = this.layerInstances.get(e.id), i = F.get(e.tipo);
|
|
2395
2395
|
i && i.destroy(o, this.map), this.layerInstances.delete(e.id);
|
|
2396
2396
|
}
|
|
2397
2397
|
if (e.visivel) {
|
|
2398
|
-
const o =
|
|
2398
|
+
const o = F.get(e.tipo);
|
|
2399
2399
|
if (o) {
|
|
2400
2400
|
const i = o.render(e, this.map, this.context);
|
|
2401
2401
|
i && (i.addTo(this.map), this.layerInstances.set(e.id, i));
|
|
@@ -2418,14 +2418,14 @@ class Hi {
|
|
|
2418
2418
|
const i = `pane-${o.id}`, a = this.map.getPane(i);
|
|
2419
2419
|
if (a && (a.style.display = e ? "" : "none", a.style.pointerEvents = o.visivel && o.interativo && !o.bloqueada ? "auto" : "none"), e) {
|
|
2420
2420
|
if (!this.layerInstances.has(t)) {
|
|
2421
|
-
const s =
|
|
2421
|
+
const s = F.get(o.tipo);
|
|
2422
2422
|
if (s) {
|
|
2423
2423
|
const r = s.render(o, this.map, this.context);
|
|
2424
2424
|
r && (r.addTo(this.map), this.layerInstances.set(t, r));
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
2427
|
} else if (this.layerInstances.has(t)) {
|
|
2428
|
-
const s = this.layerInstances.get(t), r =
|
|
2428
|
+
const s = this.layerInstances.get(t), r = F.get(o.tipo);
|
|
2429
2429
|
r && r.destroy(s, this.map), this.layerInstances.delete(t);
|
|
2430
2430
|
}
|
|
2431
2431
|
this.notifyChange();
|
|
@@ -2440,7 +2440,7 @@ class Hi {
|
|
|
2440
2440
|
}
|
|
2441
2441
|
const i = this.layerInstances.get(t);
|
|
2442
2442
|
if (i && this.map && this.context) {
|
|
2443
|
-
const a =
|
|
2443
|
+
const a = F.get(o.tipo);
|
|
2444
2444
|
a && a.update(o, i, { opacidade: o.opacidade }, this.context, this.map);
|
|
2445
2445
|
}
|
|
2446
2446
|
this.notifyChange();
|
|
@@ -2472,7 +2472,7 @@ class Hi {
|
|
|
2472
2472
|
o.estilo.scaleMode = e;
|
|
2473
2473
|
const i = this.layerInstances.get(t);
|
|
2474
2474
|
if (i && this.map && this.context) {
|
|
2475
|
-
const a =
|
|
2475
|
+
const a = F.get(o.tipo);
|
|
2476
2476
|
a && a.update(o, i, { estilo: o.estilo }, this.context, this.map);
|
|
2477
2477
|
}
|
|
2478
2478
|
this.notifyChange();
|
|
@@ -2558,10 +2558,10 @@ class Hi {
|
|
|
2558
2558
|
o.dados = e;
|
|
2559
2559
|
const i = this.layerInstances.get(t);
|
|
2560
2560
|
if (i && this.map && this.context) {
|
|
2561
|
-
const a =
|
|
2561
|
+
const a = F.get(o.tipo);
|
|
2562
2562
|
a && a.update(o, i, { dados: e }, this.context, this.map);
|
|
2563
2563
|
} else if (o.visivel && this.map && this.context) {
|
|
2564
|
-
const a =
|
|
2564
|
+
const a = F.get(o.tipo);
|
|
2565
2565
|
if (a) {
|
|
2566
2566
|
const s = a.render(o, this.map, this.context);
|
|
2567
2567
|
s && (s.addTo(this.map), this.layerInstances.set(t, s));
|
|
@@ -2574,7 +2574,7 @@ class Hi {
|
|
|
2574
2574
|
if (this.layerInstances.has(o)) {
|
|
2575
2575
|
const i = this.layerInstances.get(o), a = this.layers.find((s) => s.id === o);
|
|
2576
2576
|
if (a) {
|
|
2577
|
-
const s =
|
|
2577
|
+
const s = F.get(a.tipo);
|
|
2578
2578
|
s && s.destroy(i, this.map);
|
|
2579
2579
|
}
|
|
2580
2580
|
this.layerInstances.delete(o);
|
|
@@ -2585,7 +2585,7 @@ class Hi {
|
|
|
2585
2585
|
this.renderPendente = !1, this.map && (this.layerInstances.forEach((t, e) => {
|
|
2586
2586
|
const o = this.layers.find((i) => i.id === e);
|
|
2587
2587
|
if (o) {
|
|
2588
|
-
const i =
|
|
2588
|
+
const i = F.get(o.tipo);
|
|
2589
2589
|
i && i.destroy(t, this.map);
|
|
2590
2590
|
}
|
|
2591
2591
|
}), this.layerInstances.clear()), this.listeners = [];
|
|
@@ -3710,7 +3710,7 @@ function Ln(n, t) {
|
|
|
3710
3710
|
const o = (Array.isArray(n[0]) && Array.isArray(n[0][0]) ? n : [n]).map((i) => $o(i, t));
|
|
3711
3711
|
return o.some((i) => i === null) ? null : o;
|
|
3712
3712
|
}
|
|
3713
|
-
function
|
|
3713
|
+
function Ua(n, t) {
|
|
3714
3714
|
const e = B(n.lat, n.lon);
|
|
3715
3715
|
return e ? {
|
|
3716
3716
|
id: String(n.id),
|
|
@@ -3719,7 +3719,7 @@ function Ga(n, t) {
|
|
|
3719
3719
|
propriedades: { ...n }
|
|
3720
3720
|
} : null;
|
|
3721
3721
|
}
|
|
3722
|
-
function
|
|
3722
|
+
function Xa(n, t, e) {
|
|
3723
3723
|
const o = t.get(String(n.ponto_inicio_id)), i = t.get(String(n.ponto_fim_id));
|
|
3724
3724
|
if (!o || !i) return null;
|
|
3725
3725
|
const a = B(o.lat, o.lon), s = B(i.lat, i.lon);
|
|
@@ -3733,7 +3733,7 @@ function Ha(n, t, e) {
|
|
|
3733
3733
|
propriedades: { ...n }
|
|
3734
3734
|
};
|
|
3735
3735
|
}
|
|
3736
|
-
function
|
|
3736
|
+
function Za(n, t) {
|
|
3737
3737
|
if (!n.poligono_wkt) return null;
|
|
3738
3738
|
const e = /POLYGON\s*\(\s*\(\s*(.*?)\s*\)\s*\)/i.exec(n.poligono_wkt);
|
|
3739
3739
|
if (!e) return null;
|
|
@@ -3929,13 +3929,13 @@ class kn {
|
|
|
3929
3929
|
}
|
|
3930
3930
|
}
|
|
3931
3931
|
const Bt = 63710088e-1, Je = 111320, Vt = (n) => n * Math.PI / 180;
|
|
3932
|
-
function
|
|
3932
|
+
function mt(n) {
|
|
3933
3933
|
return { lat0: n[0], lon0: n[1], cos0: Math.cos(Vt(n[0])) };
|
|
3934
3934
|
}
|
|
3935
3935
|
function Me(n, t) {
|
|
3936
3936
|
return [Vt(n[1] - t.lon0) * t.cos0 * Bt, Vt(n[0] - t.lat0) * Bt];
|
|
3937
3937
|
}
|
|
3938
|
-
function
|
|
3938
|
+
function gt(n, t) {
|
|
3939
3939
|
return [t.lat0 + n[1] / Bt * (180 / Math.PI), t.lon0 + n[0] / (Bt * t.cos0) * (180 / Math.PI)];
|
|
3940
3940
|
}
|
|
3941
3941
|
function qo(n, t) {
|
|
@@ -3965,8 +3965,8 @@ function jt(n) {
|
|
|
3965
3965
|
}
|
|
3966
3966
|
function zn(n, t) {
|
|
3967
3967
|
if (n.length < 3 || t.length < 2) return null;
|
|
3968
|
-
const e =
|
|
3969
|
-
return a && a.length >= 2 ? a.map((s) => s.map((r) =>
|
|
3968
|
+
const e = mt(n[0]), o = n.map((s) => Me(s, e)), i = t.map((s) => Me(s, e)), a = No(o, i, 0);
|
|
3969
|
+
return a && a.length >= 2 ? a.map((s) => s.map((r) => gt(r, e))) : null;
|
|
3970
3970
|
}
|
|
3971
3971
|
function No(n, t, e) {
|
|
3972
3972
|
if (e > 8) return null;
|
|
@@ -4012,7 +4012,7 @@ function yt(n, t) {
|
|
|
4012
4012
|
const et = (n, t) => Math.hypot(n[0] - t[0], n[1] - t[1]);
|
|
4013
4013
|
function En(n, t = 0) {
|
|
4014
4014
|
if (n.length === 0 || n.some((a) => a.length < 2)) return null;
|
|
4015
|
-
const e =
|
|
4015
|
+
const e = mt(n[0][0]), o = n.slice(1).map((a) => yt(a, e));
|
|
4016
4016
|
let i = yt(n[0], e);
|
|
4017
4017
|
for (; o.length > 0; ) {
|
|
4018
4018
|
let a = null;
|
|
@@ -4029,7 +4029,7 @@ function En(n, t = 0) {
|
|
|
4029
4029
|
let l = o.splice(s, 1)[0];
|
|
4030
4030
|
r && (l = [...l].reverse()), i = c ? [...i, ...et(i[i.length - 1], l[0]) > 0 ? l : l.slice(1)] : [...l, ...et(l[l.length - 1], i[0]) > 0 ? i : i.slice(1)];
|
|
4031
4031
|
}
|
|
4032
|
-
return i.map((a) =>
|
|
4032
|
+
return i.map((a) => gt(a, e));
|
|
4033
4033
|
}
|
|
4034
4034
|
function In(n, t, e, o) {
|
|
4035
4035
|
const i = Do(n, t, e, o);
|
|
@@ -4043,7 +4043,7 @@ function _n(n, t) {
|
|
|
4043
4043
|
}
|
|
4044
4044
|
function Tn(n, t, e = 0) {
|
|
4045
4045
|
if (n.length < 3 || t.length < 3) return null;
|
|
4046
|
-
const o =
|
|
4046
|
+
const o = mt(n[0]), i = yt(n, o), a = yt(t, o);
|
|
4047
4047
|
if (_n(i, a)) return null;
|
|
4048
4048
|
let s = { i: 0, j: 0, d: 1 / 0 };
|
|
4049
4049
|
for (let d = 0; d < i.length; d++)
|
|
@@ -4055,7 +4055,7 @@ function Tn(n, t, e = 0) {
|
|
|
4055
4055
|
const { i: r, j: c } = s, l = [];
|
|
4056
4056
|
for (let d = 0; d <= i.length; d++) l.push(i[(r + d) % i.length]);
|
|
4057
4057
|
for (let d = 0; d <= a.length; d++) l.push(a[(c + d) % a.length]);
|
|
4058
|
-
return l.map((d) =>
|
|
4058
|
+
return l.map((d) => gt(d, o));
|
|
4059
4059
|
}
|
|
4060
4060
|
const Qe = 16;
|
|
4061
4061
|
function to(n, t, e, o) {
|
|
@@ -4099,22 +4099,22 @@ function qn(n, t) {
|
|
|
4099
4099
|
if (n.tipo === "Point" || n.tipo === "Text" || n.tipo === "Circle") {
|
|
4100
4100
|
const e = n.tipo === "Circle" ? n.centro : n.coordenada, o = n.tipo === "Circle" ? n.raioMetros + t : t;
|
|
4101
4101
|
if (o <= 0) return null;
|
|
4102
|
-
const i =
|
|
4103
|
-
return Array.from({ length: a }, (s, r) => [o * Math.cos(2 * Math.PI * r / a), o * Math.sin(2 * Math.PI * r / a)]).map((s) =>
|
|
4102
|
+
const i = mt(e), a = 64;
|
|
4103
|
+
return Array.from({ length: a }, (s, r) => [o * Math.cos(2 * Math.PI * r / a), o * Math.sin(2 * Math.PI * r / a)]).map((s) => gt(s, i));
|
|
4104
4104
|
}
|
|
4105
4105
|
if (n.tipo === "LineString") {
|
|
4106
4106
|
if (t < 0 || n.coordenadas.length < 2 || Nt(n)) return null;
|
|
4107
|
-
const e =
|
|
4108
|
-
return [...i, ...d, ...a, ...h].map((u) =>
|
|
4107
|
+
const e = mt(n.coordenadas[0]), o = yt(n.coordenadas, e), i = ne(o, t, !1), a = ne([...o].reverse(), t, !1), s = o[o.length - 1], r = o[0], c = Math.atan2(s[1] - o[o.length - 2][1], s[0] - o[o.length - 2][0]), l = Math.atan2(r[1] - o[1][1], r[0] - o[1][0]), d = to(s, t, c + Math.PI / 2, c - Math.PI / 2), h = to(r, t, l + Math.PI / 2, l - Math.PI / 2);
|
|
4108
|
+
return [...i, ...d, ...a, ...h].map((u) => gt(u, e));
|
|
4109
4109
|
}
|
|
4110
4110
|
if (n.tipo === "Polygon") {
|
|
4111
4111
|
const e = n.aneis[0];
|
|
4112
4112
|
if (!e || e.length < 3) return null;
|
|
4113
|
-
const o =
|
|
4113
|
+
const o = mt(e[0]);
|
|
4114
4114
|
let i = yt(e, o);
|
|
4115
4115
|
$n(i) && (i = [...i].reverse());
|
|
4116
4116
|
const s = ne(i, -t, !0);
|
|
4117
|
-
return s.length < 3 || t < 0 && jt(s) >= jt(i) ? null : s.map((r) =>
|
|
4117
|
+
return s.length < 3 || t < 0 && jt(s) >= jt(i) ? null : s.map((r) => gt(r, o));
|
|
4118
4118
|
}
|
|
4119
4119
|
return null;
|
|
4120
4120
|
}
|
|
@@ -4131,7 +4131,7 @@ function Dn(n, t, e) {
|
|
|
4131
4131
|
case "Circle":
|
|
4132
4132
|
return { ...n, centro: o(n.centro) };
|
|
4133
4133
|
case "LineString": {
|
|
4134
|
-
const i = wt(
|
|
4134
|
+
const i = wt(W(n).map((a) => a.map(o)));
|
|
4135
4135
|
return n.curva ? { ...i, curva: Ge(n.curva, o) } : i;
|
|
4136
4136
|
}
|
|
4137
4137
|
case "Polygon": {
|
|
@@ -4141,20 +4141,20 @@ function Dn(n, t, e) {
|
|
|
4141
4141
|
}
|
|
4142
4142
|
}
|
|
4143
4143
|
const eo = { m: 1, km: 1e3, ft: 0.3048, mi: 1609.344 }, oo = { m2: 1, ha: 1e4, km2: 1e6, ac: 4046.8564224, alqueire: 24200 };
|
|
4144
|
-
function
|
|
4144
|
+
function Ya(n, t, e) {
|
|
4145
4145
|
return n * eo[t] / eo[e];
|
|
4146
4146
|
}
|
|
4147
|
-
function
|
|
4147
|
+
function Ka(n, t, e) {
|
|
4148
4148
|
return n * oo[t] / oo[e];
|
|
4149
4149
|
}
|
|
4150
|
-
function
|
|
4150
|
+
function Ja(n, t, e = 2) {
|
|
4151
4151
|
const o = t === "lat" ? n < 0 ? "S" : "N" : n < 0 ? "O" : "L", i = Math.abs(n);
|
|
4152
4152
|
let a = Math.floor(i), s = Math.floor((i - a) * 60), r = Number(((i - a - s / 60) * 3600).toFixed(e));
|
|
4153
4153
|
r >= 60 && (r = 0, s += 1), s >= 60 && (s = 0, a += 1);
|
|
4154
4154
|
const c = r.toFixed(e).padStart(e ? e + 3 : 2, "0");
|
|
4155
4155
|
return `${a}°${String(s).padStart(2, "0")}'${c}"${o}`;
|
|
4156
4156
|
}
|
|
4157
|
-
function
|
|
4157
|
+
function Qa(n) {
|
|
4158
4158
|
var u;
|
|
4159
4159
|
if (typeof n != "string") return null;
|
|
4160
4160
|
const t = n.trim().toUpperCase().replace(",", "."), e = (u = /[NSLEOW]$/.exec(t)) == null ? void 0 : u[0], o = t.replace(/[NSLEOW]$/, "").trim(), i = o.match(/-?\d+(?:\.\d+)?/g);
|
|
@@ -4164,8 +4164,8 @@ function Ya(n) {
|
|
|
4164
4164
|
let h = c + l / 60 + d / 3600;
|
|
4165
4165
|
return (a.startsWith("-") || e === "S" || e === "O" || e === "W") && (h = -h), h;
|
|
4166
4166
|
}
|
|
4167
|
-
function
|
|
4168
|
-
return
|
|
4167
|
+
function ts(n, t) {
|
|
4168
|
+
return ht(n, t);
|
|
4169
4169
|
}
|
|
4170
4170
|
function ae(n, t, e) {
|
|
4171
4171
|
return {
|
|
@@ -4210,11 +4210,11 @@ function ao(n, t, e) {
|
|
|
4210
4210
|
for (let o = 1; o < n.length; o++) if (io(n[o - 1], n[o], t)) return !0;
|
|
4211
4211
|
return e && n.length > 2 && io(n[n.length - 1], n[0], t);
|
|
4212
4212
|
}
|
|
4213
|
-
function
|
|
4213
|
+
function On(n, t, e) {
|
|
4214
4214
|
const o = e(n), i = e([n[0] + t / Nn, n[1]]);
|
|
4215
4215
|
return Math.hypot(i.x - o.x, i.y - o.y);
|
|
4216
4216
|
}
|
|
4217
|
-
function
|
|
4217
|
+
function Fn(n, t, e, o) {
|
|
4218
4218
|
if (n.oculta) return !1;
|
|
4219
4219
|
const i = n.geometria, a = o === "window";
|
|
4220
4220
|
switch (i.tipo) {
|
|
@@ -4222,7 +4222,7 @@ function On(n, t, e, o) {
|
|
|
4222
4222
|
case "Text":
|
|
4223
4223
|
return Pt(e(i.coordenada), t);
|
|
4224
4224
|
case "LineString": {
|
|
4225
|
-
const s =
|
|
4225
|
+
const s = W(i).map((r) => r.map(e));
|
|
4226
4226
|
return a ? s.every((r) => r.every((c) => Pt(c, t))) : s.some((r) => r.some((c) => Pt(c, t)) || ao(r, t, !1));
|
|
4227
4227
|
}
|
|
4228
4228
|
case "Polygon": {
|
|
@@ -4234,7 +4234,7 @@ function On(n, t, e, o) {
|
|
|
4234
4234
|
return no(c, r) && !s.slice(1).some((l) => no(c, l));
|
|
4235
4235
|
}
|
|
4236
4236
|
case "Circle": {
|
|
4237
|
-
const s = e(i.centro), r =
|
|
4237
|
+
const s = e(i.centro), r = On(i.centro, i.raioMetros, e);
|
|
4238
4238
|
if (a)
|
|
4239
4239
|
return s.x - r >= t.x1 && s.x + r <= t.x2 && s.y - r >= t.y1 && s.y + r <= t.y2;
|
|
4240
4240
|
const c = Math.max(t.x1, Math.min(s.x, t.x2)), l = Math.max(t.y1, Math.min(s.y, t.y2));
|
|
@@ -4252,7 +4252,7 @@ function Rn(n, t) {
|
|
|
4252
4252
|
case "Circle":
|
|
4253
4253
|
return e(o.centro);
|
|
4254
4254
|
case "LineString":
|
|
4255
|
-
return
|
|
4255
|
+
return W(o).some((i) => i.some(e));
|
|
4256
4256
|
case "Polygon": {
|
|
4257
4257
|
const i = o.aneis[0] ?? [];
|
|
4258
4258
|
if (i.some(e)) return !0;
|
|
@@ -4315,13 +4315,13 @@ function Gt(n) {
|
|
|
4315
4315
|
}
|
|
4316
4316
|
}
|
|
4317
4317
|
function Hn(n) {
|
|
4318
|
-
const t = n.geometria, e = [], o =
|
|
4318
|
+
const t = n.geometria, e = [], o = it(t), i = nt(t);
|
|
4319
4319
|
if (t.tipo === "Polygon")
|
|
4320
|
-
e.push(["Área",
|
|
4320
|
+
e.push(["Área", ut(o ?? 0)], ["Perímetro", H(i ?? 0)]), e.push(["Vértices", String(t.aneis.reduce((r, c) => r + c.length, 0))]);
|
|
4321
4321
|
else if (t.tipo === "LineString") {
|
|
4322
|
-
const r =
|
|
4323
|
-
e.push(["Extensão",
|
|
4324
|
-
} else t.tipo === "Circle" && e.push(["Raio",
|
|
4322
|
+
const r = W(t);
|
|
4323
|
+
e.push(["Extensão", H(i ?? 0)], ["Vértices", String(r.reduce((c, l) => c + l.length, 0))]), r.length > 1 && e.push(["Partes", String(r.length)]);
|
|
4324
|
+
} else t.tipo === "Circle" && e.push(["Raio", H(t.raioMetros)], ["Área", ut(o ?? 0)]);
|
|
4325
4325
|
const [a, s] = Gt(n);
|
|
4326
4326
|
return e.push(["Coordenadas", `${a.toFixed(6)}, ${s.toFixed(6)}`]), e;
|
|
4327
4327
|
}
|
|
@@ -4404,7 +4404,7 @@ function Ht(n) {
|
|
|
4404
4404
|
function Xn(n, t = !1) {
|
|
4405
4405
|
if (n.bloqueada || t) return "bloqueada";
|
|
4406
4406
|
const e = n.geometria;
|
|
4407
|
-
return e.tipo !== "Point" && e.tipo !== "LineString" && e.tipo !== "Polygon" ? "tipo-nao-suportado" : e.tipo === "Polygon" && e.aneis.length !== 1 ? "poligono-com-furos" : Nt(e) ? "multiparte" : Q(e).length > Un ? "muitos-vertices" : null;
|
|
4407
|
+
return e.tipo !== "Point" && e.tipo !== "LineString" && e.tipo !== "Polygon" && e.tipo !== "Circle" ? "tipo-nao-suportado" : e.tipo === "Polygon" && e.aneis.length !== 1 ? "poligono-com-furos" : Nt(e) ? "multiparte" : Q(e).length > Un ? "muitos-vertices" : null;
|
|
4408
4408
|
}
|
|
4409
4409
|
function Q(n) {
|
|
4410
4410
|
return n.tipo === "Point" ? [n.coordenada] : n.tipo === "LineString" ? n.coordenadas : n.tipo === "Polygon" ? n.aneis[0] ?? [] : [];
|
|
@@ -4412,7 +4412,7 @@ function Q(n) {
|
|
|
4412
4412
|
function Wt(n, t) {
|
|
4413
4413
|
return n.tipo === "Point" ? { tipo: "Point", coordenada: t[0] } : n.tipo === "LineString" ? { tipo: "LineString", coordenadas: t } : n.tipo === "Polygon" ? { tipo: "Polygon", aneis: [t] } : n;
|
|
4414
4414
|
}
|
|
4415
|
-
function
|
|
4415
|
+
function es(n, t, e) {
|
|
4416
4416
|
const o = Q(n).slice();
|
|
4417
4417
|
return t < 0 || t >= o.length ? n : (o[t] = e, Wt(n, o));
|
|
4418
4418
|
}
|
|
@@ -4426,10 +4426,10 @@ function Yn(n, t) {
|
|
|
4426
4426
|
const e = Q(n);
|
|
4427
4427
|
return t < 0 || t >= e.length || e.length <= Ht(n) ? null : Wt(n, e.filter((o, i) => i !== t));
|
|
4428
4428
|
}
|
|
4429
|
-
function
|
|
4429
|
+
function Oo(n, t) {
|
|
4430
4430
|
return [(n[0] + t[0]) / 2, (n[1] + t[1]) / 2];
|
|
4431
4431
|
}
|
|
4432
|
-
function
|
|
4432
|
+
function Fo(n) {
|
|
4433
4433
|
const t = Q(n).length, e = [];
|
|
4434
4434
|
if (n.tipo !== "LineString" && n.tipo !== "Polygon") return e;
|
|
4435
4435
|
for (let o = 0; o < t - 1; o++) e.push([o, o + 1]);
|
|
@@ -4438,15 +4438,22 @@ function Oo(n) {
|
|
|
4438
4438
|
function X(n) {
|
|
4439
4439
|
return (n.tipo === "LineString" || n.tipo === "Polygon") && n.curva && n.curva.length >= Ht(n) ? n.curva : null;
|
|
4440
4440
|
}
|
|
4441
|
+
const Kn = 63710088e-1 * Math.PI / 180, Jn = 0.5;
|
|
4442
|
+
function Qn(n, t) {
|
|
4443
|
+
const e = Math.max(0.01, Math.cos(n[0] * Math.PI / 180));
|
|
4444
|
+
return [n[0], n[1] + t / (Kn * e)];
|
|
4445
|
+
}
|
|
4441
4446
|
function _t(n) {
|
|
4442
4447
|
var t;
|
|
4443
|
-
return ((t = X(n)) == null ? void 0 : t.map((e) => e.ponto)) ?? Q(n);
|
|
4448
|
+
return n.tipo === "Circle" ? [n.centro, Qn(n.centro, n.raioMetros)] : ((t = X(n)) == null ? void 0 : t.map((e) => e.ponto)) ?? Q(n);
|
|
4444
4449
|
}
|
|
4445
4450
|
function xt(n, t) {
|
|
4446
4451
|
const e = n.tipo === "Polygon", o = vt(t, e);
|
|
4447
4452
|
return e ? { tipo: "Polygon", aneis: [o], curva: t } : { tipo: "LineString", coordenadas: o, curva: t };
|
|
4448
4453
|
}
|
|
4449
|
-
function
|
|
4454
|
+
function ta(n, t) {
|
|
4455
|
+
if (n.tipo === "Circle")
|
|
4456
|
+
return t.length < 2 ? n : { ...n, centro: t[0], raioMetros: Math.max(Jn, ht(t[0], t[1])) };
|
|
4450
4457
|
const e = X(n);
|
|
4451
4458
|
if (!e || e.length !== t.length) return Wt(n, t);
|
|
4452
4459
|
const o = e.map((i, a) => {
|
|
@@ -4455,10 +4462,10 @@ function Kn(n, t) {
|
|
|
4455
4462
|
});
|
|
4456
4463
|
return xt(n, o);
|
|
4457
4464
|
}
|
|
4458
|
-
function
|
|
4465
|
+
function ft(n, t, e) {
|
|
4459
4466
|
return [n[0] + (t[0] - n[0]) * e, n[1] + (t[1] - n[1]) * e];
|
|
4460
4467
|
}
|
|
4461
|
-
function
|
|
4468
|
+
function ea(n, t, e) {
|
|
4462
4469
|
const [o, i] = At(n, t);
|
|
4463
4470
|
let a = 0.5, s = 1 / 0;
|
|
4464
4471
|
for (let r = 1; r < 64; r++) {
|
|
@@ -4471,19 +4478,19 @@ function se(n, t, e) {
|
|
|
4471
4478
|
const o = X(n);
|
|
4472
4479
|
if (!o) {
|
|
4473
4480
|
const s = Q(n);
|
|
4474
|
-
return
|
|
4481
|
+
return Oo(s[t], s[e]);
|
|
4475
4482
|
}
|
|
4476
4483
|
const [i, a] = At(o[t], o[e]);
|
|
4477
4484
|
return ze(o[t].ponto, i, a, o[e].ponto, 0.5);
|
|
4478
4485
|
}
|
|
4479
|
-
function
|
|
4486
|
+
function oa(n) {
|
|
4480
4487
|
const t = X(n);
|
|
4481
|
-
if (!t) return
|
|
4488
|
+
if (!t) return Fo(n);
|
|
4482
4489
|
const e = [];
|
|
4483
4490
|
for (let o = 0; o < t.length - 1; o++) e.push([o, o + 1]);
|
|
4484
4491
|
return n.tipo === "Polygon" && t.length > 2 && e.push([t.length - 1, 0]), e;
|
|
4485
4492
|
}
|
|
4486
|
-
function
|
|
4493
|
+
function ia(n, t, e) {
|
|
4487
4494
|
const o = X(n);
|
|
4488
4495
|
if (!o) return Zn(n, t, e);
|
|
4489
4496
|
if (t < 0 || t >= o.length) return n;
|
|
@@ -4492,20 +4499,20 @@ function ta(n, t, e) {
|
|
|
4492
4499
|
if (r)
|
|
4493
4500
|
c = { ponto: e };
|
|
4494
4501
|
else {
|
|
4495
|
-
const u =
|
|
4496
|
-
c = { ponto:
|
|
4502
|
+
const u = ea(a, s, e), [m, f] = At(a, s), g = ft(a.ponto, m, u), x = ft(m, f, u), M = ft(f, s.ponto, u), C = ft(g, x, u), L = ft(x, M, u);
|
|
4503
|
+
c = { ponto: ft(C, L, u), entrada: C, saida: L }, l = { ...a, saida: g }, d = { ...s, entrada: M };
|
|
4497
4504
|
}
|
|
4498
4505
|
const h = o.slice();
|
|
4499
4506
|
return h[t] = l, h[i] = d, h.splice(t + 1, 0, c), xt(n, h);
|
|
4500
4507
|
}
|
|
4501
|
-
function
|
|
4508
|
+
function na(n, t) {
|
|
4502
4509
|
const e = X(n);
|
|
4503
4510
|
return e ? t < 0 || t >= e.length || e.length <= Ht(n) ? null : xt(n, e.filter((o, i) => i !== t)) : Yn(n, t);
|
|
4504
4511
|
}
|
|
4505
4512
|
function Ro(n) {
|
|
4506
4513
|
return n.tipo !== "LineString" && n.tipo !== "Polygon" ? null : X(n) ?? Q(n).map((t) => ({ ponto: [t[0], t[1]] }));
|
|
4507
4514
|
}
|
|
4508
|
-
function
|
|
4515
|
+
function aa(n, t, e, o, i = !0) {
|
|
4509
4516
|
const a = Ro(n);
|
|
4510
4517
|
if (!a || t < 0 || t >= a.length) return n;
|
|
4511
4518
|
const s = { ...a[t], [e]: o };
|
|
@@ -4513,7 +4520,7 @@ function oa(n, t, e, o, i = !0) {
|
|
|
4513
4520
|
const r = a.slice();
|
|
4514
4521
|
return r[t] = s, xt(n, r);
|
|
4515
4522
|
}
|
|
4516
|
-
function
|
|
4523
|
+
function sa(n, t) {
|
|
4517
4524
|
const e = Ro(n);
|
|
4518
4525
|
if (!e || t < 0 || t >= e.length) return n;
|
|
4519
4526
|
const o = e[t], i = e.slice();
|
|
@@ -4531,29 +4538,29 @@ function ia(n, t) {
|
|
|
4531
4538
|
}
|
|
4532
4539
|
return i[t] = { ponto: l, saida: [l[0] + d, l[1] + h], entrada: [l[0] - d, l[1] - h] }, xt(n, i);
|
|
4533
4540
|
}
|
|
4534
|
-
const
|
|
4541
|
+
const ra = { topo: 0, base: 16, esquerda: 0, direita: 0 }, ca = 16, la = 0.92, re = {
|
|
4535
4542
|
topo: "--cad-hud-topo",
|
|
4536
4543
|
base: "--cad-hud-base",
|
|
4537
4544
|
esquerda: "--cad-hud-esquerda",
|
|
4538
4545
|
direita: "--cad-hud-direita"
|
|
4539
4546
|
}, Bo = "position:absolute;box-sizing:border-box;z-index:10000;left:calc(var(--cad-hud-esquerda,0px) + (100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px)) / 2);bottom:var(--cad-hud-base,16px);transform:translateX(-50%);width:max-content;max-width:min(92%, calc(100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px) - 16px));max-height:calc(100% - var(--cad-hud-topo,0px) - var(--cad-hud-base,16px) - 8px);overflow:hidden;display:flex;flex-wrap:wrap;";
|
|
4540
|
-
function
|
|
4541
|
-
const o = { ...
|
|
4547
|
+
function os(n, t, e = {}) {
|
|
4548
|
+
const o = { ...ra, ...e }, i = Math.max(0, n - o.esquerda - o.direita);
|
|
4542
4549
|
return {
|
|
4543
4550
|
centroX: o.esquerda + i / 2,
|
|
4544
4551
|
base: o.base,
|
|
4545
|
-
larguraMax: Math.max(0, Math.min(n *
|
|
4552
|
+
larguraMax: Math.max(0, Math.min(n * la, i - ca)),
|
|
4546
4553
|
alturaMax: Math.max(0, t - o.topo - o.base - 8)
|
|
4547
4554
|
};
|
|
4548
4555
|
}
|
|
4549
|
-
function
|
|
4556
|
+
function da(n, t) {
|
|
4550
4557
|
for (const e of Object.keys(re)) {
|
|
4551
4558
|
const o = t[e];
|
|
4552
4559
|
typeof o == "number" && Number.isFinite(o) && o >= 0 ? n.style.setProperty(re[e], `${o}px`) : n.style.removeProperty(re[e]);
|
|
4553
4560
|
}
|
|
4554
4561
|
}
|
|
4555
|
-
const
|
|
4556
|
-
class
|
|
4562
|
+
const ha = "cm-vertex-edit-hud", rt = "cad-edicao-vertices", ro = "#facc15", co = "#f472b6";
|
|
4563
|
+
class ua {
|
|
4557
4564
|
constructor(t) {
|
|
4558
4565
|
p(this, "feicaoAtual", null);
|
|
4559
4566
|
p(this, "pts", []);
|
|
@@ -4569,14 +4576,18 @@ class la {
|
|
|
4569
4576
|
get ativo() {
|
|
4570
4577
|
return this.feicaoAtual !== null;
|
|
4571
4578
|
}
|
|
4579
|
+
get ehCirculo() {
|
|
4580
|
+
var t;
|
|
4581
|
+
return ((t = this.feicaoAtual) == null ? void 0 : t.geometria.tipo) === "Circle";
|
|
4582
|
+
}
|
|
4572
4583
|
get feicao() {
|
|
4573
4584
|
return this.feicaoAtual;
|
|
4574
4585
|
}
|
|
4575
4586
|
iniciar(t) {
|
|
4576
4587
|
this.parar(), this.feicaoAtual = t, this.pts = _t(t.geometria).map((o) => [o[0], o[1]]);
|
|
4577
4588
|
const e = this.dep.map;
|
|
4578
|
-
if (!e.getPane(
|
|
4579
|
-
const o = e.createPane(
|
|
4589
|
+
if (!e.getPane(rt)) {
|
|
4590
|
+
const o = e.createPane(rt);
|
|
4580
4591
|
o.style.zIndex = "9000";
|
|
4581
4592
|
}
|
|
4582
4593
|
this.grupo = y.layerGroup().addTo(e), this.montarHud(), this.reconstruir();
|
|
@@ -4599,7 +4610,7 @@ class la {
|
|
|
4599
4610
|
}
|
|
4600
4611
|
// ---- construção ----
|
|
4601
4612
|
geometriaAtual() {
|
|
4602
|
-
return
|
|
4613
|
+
return ta(this.feicaoAtual.geometria, this.pts);
|
|
4603
4614
|
}
|
|
4604
4615
|
feicaoComPontos() {
|
|
4605
4616
|
return { ...this.feicaoAtual, geometria: this.geometriaAtual() };
|
|
@@ -4612,7 +4623,7 @@ class la {
|
|
|
4612
4623
|
const a = this.criarAlca(o, i);
|
|
4613
4624
|
this.alcas.push(a), this.grupo.addLayer(a);
|
|
4614
4625
|
}), this.criarAlcasBezier(), t.tipo !== "Point")
|
|
4615
|
-
for (const [o, i] of
|
|
4626
|
+
for (const [o, i] of oa(this.geometriaAtual())) {
|
|
4616
4627
|
const a = this.criarFantasma(o, i);
|
|
4617
4628
|
this.fantasmas.push(a), this.grupo.addLayer(a.marker);
|
|
4618
4629
|
}
|
|
@@ -4627,9 +4638,9 @@ class la {
|
|
|
4627
4638
|
}
|
|
4628
4639
|
criarAlca(t, e) {
|
|
4629
4640
|
const o = y.marker(t, {
|
|
4630
|
-
icon: this.icone("cad-vertex-handle", 12, `background:${ro};border:2px solid #111;border-radius:2px;cursor:move`),
|
|
4641
|
+
icon: this.icone("cad-vertex-handle", 12, `background:${ro};border:2px solid #111;border-radius:${this.ehCirculo && e === 1 ? "50%" : "2px"};cursor:${this.ehCirculo && e === 1 ? "ew-resize" : "move"}`),
|
|
4631
4642
|
draggable: !0,
|
|
4632
|
-
pane:
|
|
4643
|
+
pane: rt,
|
|
4633
4644
|
keyboard: !1
|
|
4634
4645
|
});
|
|
4635
4646
|
return o.on("drag", () => this.aoArrastar(o, e)), o.on("dragend", () => {
|
|
@@ -4653,10 +4664,10 @@ class la {
|
|
|
4653
4664
|
for (const i of ["entrada", "saida"]) {
|
|
4654
4665
|
const a = e[i];
|
|
4655
4666
|
if (!a || this.alcasBezier.some((l) => l.i === t && l.qual === i)) continue;
|
|
4656
|
-
const s = y.polyline([e.ponto, a], { pane:
|
|
4667
|
+
const s = y.polyline([e.ponto, a], { pane: rt, color: co, weight: 1, opacity: 0.8, interactive: !1 }), r = y.marker(a, {
|
|
4657
4668
|
icon: this.icone("cad-bezier-handle", 10, `background:#fff;border:2px solid ${co};border-radius:50%;cursor:move`),
|
|
4658
4669
|
draggable: !0,
|
|
4659
|
-
pane:
|
|
4670
|
+
pane: rt,
|
|
4660
4671
|
keyboard: !1
|
|
4661
4672
|
}), c = { marker: r, haste: s, i: t, qual: i };
|
|
4662
4673
|
r.on("drag", (l) => {
|
|
@@ -4678,19 +4689,19 @@ class la {
|
|
|
4678
4689
|
aoArrastarAlca(t, e) {
|
|
4679
4690
|
const o = this.feicaoAtual;
|
|
4680
4691
|
if (!o) return;
|
|
4681
|
-
const { lat: i, lng: a } = t.marker.getLatLng(), s =
|
|
4692
|
+
const { lat: i, lng: a } = t.marker.getLatLng(), s = aa(o.geometria, t.i, t.qual, [i, a], e);
|
|
4682
4693
|
this.feicaoAtual = { ...o, geometria: s }, this.completarAlcasDoNo(t.i), this.sincronizarAlcasBezier(), this.dep.previsualizar(this.feicaoAtual), this.atualizarHud();
|
|
4683
4694
|
}
|
|
4684
4695
|
alternarSuave(t) {
|
|
4685
4696
|
const e = this.feicaoAtual;
|
|
4686
4697
|
if (!e) return;
|
|
4687
|
-
const o =
|
|
4698
|
+
const o = sa(e.geometria, t);
|
|
4688
4699
|
o !== e.geometria && (this.feicaoAtual = { ...e, geometria: o }, this.reconstruir(), this.dep.previsualizar(this.feicaoAtual), this.confirmar(this.feicaoAtual));
|
|
4689
4700
|
}
|
|
4690
4701
|
criarFantasma(t, e) {
|
|
4691
4702
|
const o = y.marker(se(this.geometriaAtual(), t, e), {
|
|
4692
4703
|
icon: this.icone("cad-vertex-ghost", 9, `background:${ro};opacity:.45;border:1px solid #111;border-radius:50%;cursor:copy`),
|
|
4693
|
-
pane:
|
|
4704
|
+
pane: rt,
|
|
4694
4705
|
keyboard: !1
|
|
4695
4706
|
});
|
|
4696
4707
|
return o.on("click", (i) => {
|
|
@@ -4699,13 +4710,18 @@ class la {
|
|
|
4699
4710
|
}
|
|
4700
4711
|
// ---- gestos ----
|
|
4701
4712
|
aoArrastar(t, e) {
|
|
4713
|
+
var s;
|
|
4702
4714
|
const o = this.feicaoAtual;
|
|
4703
4715
|
if (!o) return;
|
|
4704
4716
|
let i = [t.getLatLng().lat, t.getLatLng().lng];
|
|
4705
4717
|
const a = this.dep.snapLigado() ? this.dep.buscarSnap(i, { feicaoId: o.id, camadaId: o.camadaId, vertice: e }) : null;
|
|
4706
|
-
a ? (i = a.coordenada, t.setLatLng(i), this.mostrarSnap(i)) : this.esconderSnap(),
|
|
4707
|
-
|
|
4708
|
-
|
|
4718
|
+
if (a ? (i = a.coordenada, t.setLatLng(i), this.mostrarSnap(i)) : this.esconderSnap(), o.geometria.tipo === "Circle" && e === 0) {
|
|
4719
|
+
const r = i[0] - this.pts[0][0], c = i[1] - this.pts[0][1];
|
|
4720
|
+
this.pts[1] = [this.pts[1][0] + r, this.pts[1][1] + c], (s = this.alcas[1]) == null || s.setLatLng(this.pts[1]);
|
|
4721
|
+
}
|
|
4722
|
+
this.pts[e] = i;
|
|
4723
|
+
for (const r of this.fantasmas)
|
|
4724
|
+
(r.i === e || r.j === e) && r.marker.setLatLng(se(this.geometriaAtual(), r.i, r.j));
|
|
4709
4725
|
this.dep.previsualizar(this.feicaoComPontos()), this.atualizarAlcasDoNo(e), this.atualizarHud();
|
|
4710
4726
|
}
|
|
4711
4727
|
/** Durante o arrasto de um nó, as alças dele acompanham (a geometria só é gravada no fim do gesto). */
|
|
@@ -4720,7 +4736,7 @@ class la {
|
|
|
4720
4736
|
}
|
|
4721
4737
|
inserir(t, e) {
|
|
4722
4738
|
if (!this.feicaoAtual) return;
|
|
4723
|
-
const i =
|
|
4739
|
+
const i = ia(this.geometriaAtual(), t, [e.lat, e.lng]);
|
|
4724
4740
|
this.pts = _t(i).map((s) => [s[0], s[1]]), this.reconstruir();
|
|
4725
4741
|
const a = this.feicaoComPontos();
|
|
4726
4742
|
this.dep.previsualizar(a), this.confirmar(a);
|
|
@@ -4730,7 +4746,7 @@ class la {
|
|
|
4730
4746
|
}
|
|
4731
4747
|
excluir(t) {
|
|
4732
4748
|
if (!this.feicaoAtual) return;
|
|
4733
|
-
const o =
|
|
4749
|
+
const o = na(this.geometriaAtual(), t);
|
|
4734
4750
|
if (!o) return;
|
|
4735
4751
|
this.pts = _t(o).map((a) => [a[0], a[1]]), this.reconstruir();
|
|
4736
4752
|
const i = this.feicaoComPontos();
|
|
@@ -4755,7 +4771,7 @@ class la {
|
|
|
4755
4771
|
html: '<div style="width:18px;height:18px;box-sizing:border-box;border:2px solid #22d3ee;transform:rotate(45deg);border-radius:2px"></div>'
|
|
4756
4772
|
}),
|
|
4757
4773
|
interactive: !1,
|
|
4758
|
-
pane:
|
|
4774
|
+
pane: rt,
|
|
4759
4775
|
keyboard: !1
|
|
4760
4776
|
}).addTo(this.grupo));
|
|
4761
4777
|
}
|
|
@@ -4766,12 +4782,12 @@ class la {
|
|
|
4766
4782
|
// ---- HUD ----
|
|
4767
4783
|
montarHud() {
|
|
4768
4784
|
const t = this.dep.map.getContainer(), e = document.createElement("div");
|
|
4769
|
-
e.id =
|
|
4785
|
+
e.id = ha, e.style.cssText = Bo + "gap:12px;align-items:center;padding:6px 12px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:12px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
|
|
4770
4786
|
const o = (c) => {
|
|
4771
4787
|
const l = document.createElement("span");
|
|
4772
4788
|
return l.dataset.campo = c, l;
|
|
4773
4789
|
}, i = document.createElement("strong");
|
|
4774
|
-
i.textContent = "Editando vértices";
|
|
4790
|
+
i.textContent = this.ehCirculo ? "Editando círculo" : "Editando vértices";
|
|
4775
4791
|
const a = o("snap");
|
|
4776
4792
|
a.style.cursor = "pointer", a.title = "Alternar snap (S). Alt desliga temporariamente.", a.addEventListener("click", () => this.dep.alternarSnap());
|
|
4777
4793
|
const s = document.createElement("button");
|
|
@@ -4782,7 +4798,7 @@ class la {
|
|
|
4782
4798
|
atualizarHud() {
|
|
4783
4799
|
if (!this.hud || !this.feicaoAtual) return;
|
|
4784
4800
|
const t = this.geometriaAtual(), e = this.hud.querySelector('[data-campo="nos"]'), o = this.hud.querySelector('[data-campo="medida"]');
|
|
4785
|
-
e && (e.textContent = `Nós: ${this.pts.length} (mín. ${Ht(t)})`), o && (t.tipo === "Polygon" ? o.textContent = `Área: ${
|
|
4801
|
+
e && (e.textContent = t.tipo === "Circle" ? "Centro move · borda muda o raio" : `Nós: ${this.pts.length} (mín. ${Ht(t)})`), o && (t.tipo === "Polygon" ? o.textContent = `Área: ${ut(it(t) ?? 0)} · Perímetro: ${H(nt(t) ?? 0)}` : t.tipo === "LineString" ? o.textContent = `Extensão: ${H(nt(t) ?? 0)}` : t.tipo === "Point" ? o.textContent = `${t.coordenada[0].toFixed(6)}, ${t.coordenada[1].toFixed(6)}` : t.tipo === "Circle" && (o.textContent = `Raio: ${H(t.raioMetros)} · Área: ${ut(it(t) ?? 0)}`));
|
|
4786
4802
|
}
|
|
4787
4803
|
/** Para os testes: posição atual dos vértices. */
|
|
4788
4804
|
vertices() {
|
|
@@ -4808,11 +4824,11 @@ class la {
|
|
|
4808
4824
|
}
|
|
4809
4825
|
}
|
|
4810
4826
|
const Vo = 10, ce = (n, t) => Math.hypot(n.x - t.x, n.y - t.y);
|
|
4811
|
-
function
|
|
4827
|
+
function pa(n, t, e) {
|
|
4812
4828
|
const o = e.x - t.x, i = e.y - t.y, a = o * o + i * i, s = a === 0 ? 0 : Math.max(0, Math.min(1, ((n.x - t.x) * o + (n.y - t.y) * i) / a));
|
|
4813
4829
|
return { t: s, d: Math.hypot(n.x - (t.x + s * o), n.y - (t.y + s * i)) };
|
|
4814
4830
|
}
|
|
4815
|
-
function
|
|
4831
|
+
function fa(n, t, e, o = {}, i) {
|
|
4816
4832
|
const a = o.toleranciaPx ?? Vo, s = o.vertice !== !1, r = o.meio !== !1, c = o.aresta !== !1;
|
|
4817
4833
|
let l = null, d = null, h = null;
|
|
4818
4834
|
const u = (m, f) => !m || f.distanciaPx < m.distanciaPx ? f : m;
|
|
@@ -4826,7 +4842,7 @@ function ha(n, t, e, o = {}, i) {
|
|
|
4826
4842
|
continue;
|
|
4827
4843
|
}
|
|
4828
4844
|
if (f && (g.tipo === "LineString" || g.tipo === "Polygon") && g.curva) continue;
|
|
4829
|
-
const M = g.tipo === "LineString" ?
|
|
4845
|
+
const M = g.tipo === "LineString" ? W(g).map((L) => ({ pts: L, fechado: !1 })) : [{ pts: Q(g), fechado: g.tipo === "Polygon" }], C = f ? i.vertice : void 0;
|
|
4830
4846
|
for (const { pts: L, fechado: k } of M) {
|
|
4831
4847
|
const P = L.map(e);
|
|
4832
4848
|
if (s)
|
|
@@ -4842,11 +4858,11 @@ function ha(n, t, e, o = {}, i) {
|
|
|
4842
4858
|
for (const [b, A] of v)
|
|
4843
4859
|
if (!(C !== void 0 && (b === C || A === C)) && !(f && C === void 0)) {
|
|
4844
4860
|
if (r) {
|
|
4845
|
-
const z =
|
|
4861
|
+
const z = Oo(L[b], L[A]), S = ce(n, e(z));
|
|
4846
4862
|
S <= a && (d = u(d, { tipo: "meio", coordenada: z, distanciaPx: S, ...x }));
|
|
4847
4863
|
}
|
|
4848
4864
|
if (c) {
|
|
4849
|
-
const { t: z, d: S } =
|
|
4865
|
+
const { t: z, d: S } = pa(n, P[b], P[A]);
|
|
4850
4866
|
if (S <= a) {
|
|
4851
4867
|
const w = [L[b][0] + z * (L[A][0] - L[b][0]), L[b][1] + z * (L[A][1] - L[b][1])];
|
|
4852
4868
|
h = u(h, { tipo: "aresta", coordenada: w, distanciaPx: S, ...x });
|
|
@@ -4857,7 +4873,7 @@ function ha(n, t, e, o = {}, i) {
|
|
|
4857
4873
|
}
|
|
4858
4874
|
return l ?? d ?? h;
|
|
4859
4875
|
}
|
|
4860
|
-
class
|
|
4876
|
+
class ma {
|
|
4861
4877
|
constructor(t) {
|
|
4862
4878
|
p(this, "_ligado", !0);
|
|
4863
4879
|
p(this, "_altSegurado", !1);
|
|
@@ -4912,8 +4928,8 @@ class ua {
|
|
|
4912
4928
|
this.contexto.aoMudar({ ativo: this.ativo, ligado: this._ligado, temporario: this._altSegurado });
|
|
4913
4929
|
}
|
|
4914
4930
|
}
|
|
4915
|
-
const lo = 36,
|
|
4916
|
-
function
|
|
4931
|
+
const lo = 36, ga = 0.45;
|
|
4932
|
+
function va(n, t) {
|
|
4917
4933
|
const e = Math.abs(t[0] - n[0]), o = Math.abs(t[1] - n[1]);
|
|
4918
4934
|
if (e === 0 && o === 0) return null;
|
|
4919
4935
|
const i = [];
|
|
@@ -4927,7 +4943,7 @@ function jo(n, t) {
|
|
|
4927
4943
|
const e = Math.cos(n[0] * Math.PI / 180) || 1, o = t[0] - n[0], i = (t[1] - n[1]) * e, a = Math.hypot(o, i);
|
|
4928
4944
|
return a === 0 ? null : { raio: a, inicio: Math.atan2(o, i), cosLat: e };
|
|
4929
4945
|
}
|
|
4930
|
-
function
|
|
4946
|
+
function ya(n, t, e = 6) {
|
|
4931
4947
|
const o = jo(n, t);
|
|
4932
4948
|
if (!o || e < 3) return null;
|
|
4933
4949
|
const i = [];
|
|
@@ -4937,12 +4953,12 @@ function ma(n, t, e = 6) {
|
|
|
4937
4953
|
}
|
|
4938
4954
|
return i;
|
|
4939
4955
|
}
|
|
4940
|
-
function
|
|
4956
|
+
function xa(n, t, e = 5) {
|
|
4941
4957
|
const o = jo(n, t);
|
|
4942
4958
|
if (!o || e < 3) return null;
|
|
4943
4959
|
const i = e * 2, a = [];
|
|
4944
4960
|
for (let s = 0; s < i; s++) {
|
|
4945
|
-
const r = s % 2 === 0 ? o.raio : o.raio *
|
|
4961
|
+
const r = s % 2 === 0 ? o.raio : o.raio * ga, c = o.inicio + s * 2 * Math.PI / i;
|
|
4946
4962
|
a.push([n[0] + r * Math.sin(c), n[1] + r * Math.cos(c) / o.cosLat]);
|
|
4947
4963
|
}
|
|
4948
4964
|
return a;
|
|
@@ -4973,7 +4989,7 @@ function Tt(n) {
|
|
|
4973
4989
|
return t.alca && (e.saida = t.alca, e.entrada = ke(t.ponto, t.alca)), e;
|
|
4974
4990
|
});
|
|
4975
4991
|
}
|
|
4976
|
-
function
|
|
4992
|
+
function ba(n) {
|
|
4977
4993
|
return vt(Tt(n), !1);
|
|
4978
4994
|
}
|
|
4979
4995
|
function le(n, t) {
|
|
@@ -4985,10 +5001,10 @@ function le(n, t) {
|
|
|
4985
5001
|
const o = e ? vt(n, !1) : n.map((i) => i.ponto);
|
|
4986
5002
|
return e ? { tipo: "LineString", coordenadas: o, curva: n } : { tipo: "LineString", coordenadas: o };
|
|
4987
5003
|
}
|
|
4988
|
-
const
|
|
4989
|
-
elipse:
|
|
4990
|
-
"poligono-regular": (n, t) =>
|
|
4991
|
-
estrela: (n, t) =>
|
|
5004
|
+
const Pa = (n, t) => n[0] === t[0] && n[1] === t[1], uo = {
|
|
5005
|
+
elipse: va,
|
|
5006
|
+
"poligono-regular": (n, t) => ya(n, t, 6),
|
|
5007
|
+
estrela: (n, t) => xa(n, t, 5)
|
|
4992
5008
|
};
|
|
4993
5009
|
class de {
|
|
4994
5010
|
constructor(t, e = !1) {
|
|
@@ -5038,7 +5054,7 @@ class de {
|
|
|
5038
5054
|
if (this.pontos.length === 0)
|
|
5039
5055
|
return this.pontos.push(t), {};
|
|
5040
5056
|
{
|
|
5041
|
-
const e =
|
|
5057
|
+
const e = ht(this.pontos[0], t);
|
|
5042
5058
|
return e >= ho ? { concluida: { tipo: "Circle", centro: this.pontos[0], raioMetros: e } } : {};
|
|
5043
5059
|
}
|
|
5044
5060
|
case "elipse":
|
|
@@ -5054,7 +5070,7 @@ class de {
|
|
|
5054
5070
|
case "conta-gotas":
|
|
5055
5071
|
return {};
|
|
5056
5072
|
default:
|
|
5057
|
-
return this.pontos.length > 0 &&
|
|
5073
|
+
return this.pontos.length > 0 && Pa(this.pontos[this.pontos.length - 1], t) ? {} : (this.pontos.push(t), {});
|
|
5058
5074
|
}
|
|
5059
5075
|
}
|
|
5060
5076
|
/** Caneta: arrastar logo após colocar a âncora define a alça de saída (a de entrada é o espelho). */
|
|
@@ -5069,7 +5085,7 @@ class de {
|
|
|
5069
5085
|
}
|
|
5070
5086
|
/** Vértices da linha/anel em construção, incluindo a curva da caneta. */
|
|
5071
5087
|
vertices() {
|
|
5072
|
-
return this.ferramenta === "caneta" ?
|
|
5088
|
+
return this.ferramenta === "caneta" ? ba(this.ancoras) : this.pontos;
|
|
5073
5089
|
}
|
|
5074
5090
|
retangulo(t, e) {
|
|
5075
5091
|
return t[0] === e[0] || t[1] === e[1] ? null : { tipo: "Polygon", aneis: [[[t[0], t[1]], [t[0], e[1]], [e[0], e[1]], [e[0], t[1]]]] };
|
|
@@ -5082,7 +5098,7 @@ class de {
|
|
|
5082
5098
|
return this.pontos.length === 1 && t ? this.retangulo(this.pontos[0], t) : null;
|
|
5083
5099
|
case "circulo": {
|
|
5084
5100
|
if (this.pontos.length !== 1 || !t) return null;
|
|
5085
|
-
const e =
|
|
5101
|
+
const e = ht(this.pontos[0], t);
|
|
5086
5102
|
return e >= ho ? { tipo: "Circle", centro: this.pontos[0], raioMetros: e } : null;
|
|
5087
5103
|
}
|
|
5088
5104
|
case "caneta": {
|
|
@@ -5121,10 +5137,10 @@ class de {
|
|
|
5121
5137
|
/** Medida em andamento: comprimento (linha) ou comprimento do contorno (área), em metros. */
|
|
5122
5138
|
comprimentoMetros() {
|
|
5123
5139
|
const t = this.cursor && this.nos > 0 ? [...this.vertices(), this.cursor] : this.vertices();
|
|
5124
|
-
return
|
|
5140
|
+
return Ot(t, !1);
|
|
5125
5141
|
}
|
|
5126
5142
|
}
|
|
5127
|
-
const
|
|
5143
|
+
const La = "cm-draw-hud", po = "cad-ferramenta-ativa", tt = "cad-desenho", ct = "#22d3ee", Sa = 4, Ca = 450, Ma = 10, wa = {
|
|
5128
5144
|
ponto: "Ponto",
|
|
5129
5145
|
linha: "Linha",
|
|
5130
5146
|
poligono: "Polígono",
|
|
@@ -5140,7 +5156,7 @@ const xa = "cm-draw-hud", po = "cad-ferramenta-ativa", tt = "cad-desenho", rt =
|
|
|
5140
5156
|
dividir: "Dividir polígono",
|
|
5141
5157
|
"selecao-laco": "Seleção por laço",
|
|
5142
5158
|
"conta-gotas": "Conta-gotas"
|
|
5143
|
-
},
|
|
5159
|
+
}, Aa = {
|
|
5144
5160
|
ponto: "Clique para colocar",
|
|
5145
5161
|
linha: "Clique nos vértices · Enter ou duplo clique conclui",
|
|
5146
5162
|
poligono: "Clique nos vértices · Enter ou duplo clique conclui",
|
|
@@ -5157,7 +5173,7 @@ const xa = "cm-draw-hud", po = "cad-ferramenta-ativa", tt = "cad-desenho", rt =
|
|
|
5157
5173
|
"selecao-laco": "Desenhe o laço · Enter ou 1º ponto fecha e seleciona",
|
|
5158
5174
|
"conta-gotas": "Clique numa feição para copiar o estilo"
|
|
5159
5175
|
};
|
|
5160
|
-
class
|
|
5176
|
+
class ka {
|
|
5161
5177
|
constructor(t) {
|
|
5162
5178
|
p(this, "sessao", null);
|
|
5163
5179
|
p(this, "fechar", !1);
|
|
@@ -5270,7 +5286,7 @@ class Ma {
|
|
|
5270
5286
|
return o ? (this.mostrarSnap(o.coordenada), o.coordenada) : (this.esconderSnap(), e);
|
|
5271
5287
|
}
|
|
5272
5288
|
repetido(t) {
|
|
5273
|
-
const e = this.ultimoClique, o = Date.now(), i = t.containerPoint, a = !!e && Math.hypot(e.x - i.x, e.y - i.y) <=
|
|
5289
|
+
const e = this.ultimoClique, o = Date.now(), i = t.containerPoint, a = !!e && Math.hypot(e.x - i.x, e.y - i.y) <= Sa && o - e.t <= Ca;
|
|
5274
5290
|
return this.ultimoClique = { x: i.x, y: i.y, t: o }, a;
|
|
5275
5291
|
}
|
|
5276
5292
|
/** Com 3+ vértices, um clique perto do primeiro fecha a figura em polígono. */
|
|
@@ -5278,7 +5294,7 @@ class Ma {
|
|
|
5278
5294
|
const e = this.sessao, o = e == null ? void 0 : e.primeiro;
|
|
5279
5295
|
if (!e || !o || !e.fechaNoPrimeiro) return !1;
|
|
5280
5296
|
const i = this.dep.map.latLngToContainerPoint(o);
|
|
5281
|
-
if (Math.hypot(i.x - t.containerPoint.x, i.y - t.containerPoint.y) >
|
|
5297
|
+
if (Math.hypot(i.x - t.containerPoint.x, i.y - t.containerPoint.y) > Ma) return !1;
|
|
5282
5298
|
const a = e.concluirFechando();
|
|
5283
5299
|
return a && this.finalizar(a), !!a;
|
|
5284
5300
|
}
|
|
@@ -5341,21 +5357,21 @@ class Ma {
|
|
|
5341
5357
|
for (const i of t.ancoras) {
|
|
5342
5358
|
if (!i.alca) continue;
|
|
5343
5359
|
const a = ke(i.ponto, i.alca);
|
|
5344
|
-
this.marcas.addLayer(y.polyline([a, i.alca], { pane: tt, color:
|
|
5360
|
+
this.marcas.addLayer(y.polyline([a, i.alca], { pane: tt, color: ct, weight: 1, opacity: 0.8, interactive: !1 }));
|
|
5345
5361
|
for (const s of [a, i.alca])
|
|
5346
|
-
this.marcas.addLayer(y.circleMarker(s, { pane: tt, radius: 3, color:
|
|
5362
|
+
this.marcas.addLayer(y.circleMarker(s, { pane: tt, radius: 3, color: ct, weight: 1, fillColor: "#fff", fillOpacity: 1, interactive: !1 }));
|
|
5347
5363
|
}
|
|
5348
5364
|
for (const i of o)
|
|
5349
|
-
this.marcas.addLayer(y.circleMarker(i, { pane: tt, radius: 4, color: "#111", weight: 1, fillColor:
|
|
5365
|
+
this.marcas.addLayer(y.circleMarker(i, { pane: tt, radius: 4, color: "#111", weight: 1, fillColor: ct, fillOpacity: 1, interactive: !1 }));
|
|
5350
5366
|
this.atualizarHud(e);
|
|
5351
5367
|
}
|
|
5352
5368
|
desenharGeometria(t, e) {
|
|
5353
5369
|
const o = {
|
|
5354
5370
|
pane: tt,
|
|
5355
|
-
color:
|
|
5371
|
+
color: ct,
|
|
5356
5372
|
weight: 2,
|
|
5357
5373
|
dashArray: e ? "6 4" : void 0,
|
|
5358
|
-
fillColor:
|
|
5374
|
+
fillColor: ct,
|
|
5359
5375
|
fillOpacity: 0.15,
|
|
5360
5376
|
interactive: !1
|
|
5361
5377
|
}, i = _o(t, o);
|
|
@@ -5383,18 +5399,18 @@ class Ma {
|
|
|
5383
5399
|
}, r = a ? i.length : i.length - 1;
|
|
5384
5400
|
for (let l = 0; l < r; l++) {
|
|
5385
5401
|
const d = i[l], h = i[(l + 1) % i.length];
|
|
5386
|
-
s([(d[0] + h[0]) / 2, (d[1] + h[1]) / 2],
|
|
5402
|
+
s([(d[0] + h[0]) / 2, (d[1] + h[1]) / 2], H(ht(d, h)));
|
|
5387
5403
|
}
|
|
5388
5404
|
const c = {
|
|
5389
5405
|
tipo: e === "medir-area" ? "area" : "distancia",
|
|
5390
5406
|
pontos: i,
|
|
5391
|
-
comprimentoM:
|
|
5407
|
+
comprimentoM: Ot(i, !1)
|
|
5392
5408
|
};
|
|
5393
5409
|
if (t.tipo === "Polygon")
|
|
5394
|
-
c.areaM2 =
|
|
5410
|
+
c.areaM2 = it(t) ?? 0, c.perimetroM = nt(t) ?? 0;
|
|
5395
5411
|
else if (e === "medir-distancia" && i.length >= 3) {
|
|
5396
5412
|
const l = { tipo: "Polygon", aneis: [i] };
|
|
5397
|
-
c.areaM2 =
|
|
5413
|
+
c.areaM2 = it(l) ?? 0, c.perimetroM = nt(l) ?? 0;
|
|
5398
5414
|
}
|
|
5399
5415
|
return c;
|
|
5400
5416
|
}
|
|
@@ -5420,17 +5436,17 @@ class Ma {
|
|
|
5420
5436
|
const t = this.sessao;
|
|
5421
5437
|
if (!t) return;
|
|
5422
5438
|
const e = document.createElement("div");
|
|
5423
|
-
e.id =
|
|
5439
|
+
e.id = La, e.style.cssText = Bo + "gap:10px;align-items:center;padding:6px 12px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:12px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
|
|
5424
5440
|
const o = (r) => {
|
|
5425
5441
|
const c = document.createElement("span");
|
|
5426
5442
|
return c.dataset.campo = r, c;
|
|
5427
5443
|
}, i = document.createElement("strong");
|
|
5428
|
-
i.textContent =
|
|
5444
|
+
i.textContent = wa[t.ferramenta];
|
|
5429
5445
|
const a = o("dica");
|
|
5430
|
-
a.style.opacity = ".7", a.textContent =
|
|
5446
|
+
a.style.opacity = ".7", a.textContent = Aa[t.ferramenta];
|
|
5431
5447
|
const s = (r, c, l = !1) => {
|
|
5432
5448
|
const d = document.createElement("button");
|
|
5433
|
-
return d.type = "button", d.textContent = r, d.style.cssText = `padding:3px 10px;border-radius:4px;border:1px solid ${l ?
|
|
5449
|
+
return d.type = "button", d.textContent = r, d.style.cssText = `padding:3px 10px;border-radius:4px;border:1px solid ${l ? ct : "rgba(255,255,255,.3)"};background:${l ? ct : "transparent"};color:${l ? "#111" : "#fff"};cursor:pointer;font-weight:600`, d.addEventListener("click", c), d;
|
|
5434
5450
|
};
|
|
5435
5451
|
e.append(i, o("nos"), o("medida"), a), t.ehSequencial && e.append(s("Concluir", () => this.concluir(), !0)), e.append(s("Sair", () => this.desativar())), y.DomEvent.disableClickPropagation(e), y.DomEvent.disableScrollPropagation(e), this.dep.map.getContainer().appendChild(e), this.hud = e;
|
|
5436
5452
|
}
|
|
@@ -5440,13 +5456,13 @@ class Ma {
|
|
|
5440
5456
|
const o = this.hud.querySelector('[data-campo="nos"]'), i = this.hud.querySelector('[data-campo="medida"]');
|
|
5441
5457
|
if (o && (o.textContent = e.nos > 0 ? `Nós: ${e.nos}` : ""), !i) return;
|
|
5442
5458
|
let a = "";
|
|
5443
|
-
if ((t == null ? void 0 : t.tipo) === "Polygon") a = `Área: ${
|
|
5459
|
+
if ((t == null ? void 0 : t.tipo) === "Polygon") a = `Área: ${ut(it(t) ?? 0)} · Perímetro: ${H(nt(t) ?? 0)}`;
|
|
5444
5460
|
else if ((t == null ? void 0 : t.tipo) === "LineString") {
|
|
5445
|
-
if (a = `Extensão: ${
|
|
5461
|
+
if (a = `Extensão: ${H(e.comprimentoMetros())}`, e.ferramenta === "medir-distancia" && e.nos >= 3 && t.coordenadas.length >= 3) {
|
|
5446
5462
|
const s = { tipo: "Polygon", aneis: [t.coordenadas] };
|
|
5447
|
-
a += ` · Área: ${
|
|
5463
|
+
a += ` · Área: ${ut(it(s) ?? 0)} · Perímetro: ${H(nt(s) ?? 0)}`;
|
|
5448
5464
|
}
|
|
5449
|
-
} else (t == null ? void 0 : t.tipo) === "Circle" && (a = `Raio: ${
|
|
5465
|
+
} else (t == null ? void 0 : t.tipo) === "Circle" && (a = `Raio: ${H(t.raioMetros)}`);
|
|
5450
5466
|
i.textContent = a;
|
|
5451
5467
|
}
|
|
5452
5468
|
/** Para os testes: simula um clique na coordenada, sem passar pelo mapa. */
|
|
@@ -5461,18 +5477,18 @@ class Ma {
|
|
|
5461
5477
|
(e = this.sessao) == null || e.mover(t), this.atualizar();
|
|
5462
5478
|
}
|
|
5463
5479
|
}
|
|
5464
|
-
const
|
|
5480
|
+
const za = 6, he = (n, t) => Math.hypot(n.x - t.x, n.y - t.y);
|
|
5465
5481
|
function fo(n, t, e) {
|
|
5466
5482
|
const o = e.x - t.x, i = e.y - t.y, a = o * o + i * i, s = a === 0 ? 0 : Math.max(0, Math.min(1, ((n.x - t.x) * o + (n.y - t.y) * i) / a));
|
|
5467
5483
|
return Math.hypot(n.x - (t.x + s * o), n.y - (t.y + s * i));
|
|
5468
5484
|
}
|
|
5469
|
-
function
|
|
5485
|
+
function Ea(n, t) {
|
|
5470
5486
|
const e = n.geometria;
|
|
5471
5487
|
if (e.tipo !== "Polygon") return 0;
|
|
5472
5488
|
const o = e.aneis[0].map(t), i = o.map((s) => s.x), a = o.map((s) => s.y);
|
|
5473
5489
|
return (Math.max(...i) - Math.min(...i)) * (Math.max(...a) - Math.min(...a));
|
|
5474
5490
|
}
|
|
5475
|
-
function mo(n, t, e, o =
|
|
5491
|
+
function mo(n, t, e, o = za) {
|
|
5476
5492
|
let i = null, a = null, s = null;
|
|
5477
5493
|
for (const r of t) {
|
|
5478
5494
|
if (r.excluida || r.oculta) continue;
|
|
@@ -5482,7 +5498,7 @@ function mo(n, t, e, o = wa) {
|
|
|
5482
5498
|
l <= o + 2 && (!i || l < i.d) && (i = { f: r, d: l });
|
|
5483
5499
|
} else if (c.tipo === "LineString") {
|
|
5484
5500
|
let l = 1 / 0;
|
|
5485
|
-
for (const d of
|
|
5501
|
+
for (const d of W(c)) {
|
|
5486
5502
|
const h = d.map(e);
|
|
5487
5503
|
for (let u = 1; u < h.length; u++) l = Math.min(l, fo(n, h[u - 1], h[u]));
|
|
5488
5504
|
}
|
|
@@ -5496,17 +5512,17 @@ function mo(n, t, e, o = wa) {
|
|
|
5496
5512
|
} else {
|
|
5497
5513
|
const l = c.aneis[0].map(e);
|
|
5498
5514
|
let d = 1 / 0;
|
|
5499
|
-
for (const [u, m] of
|
|
5515
|
+
for (const [u, m] of Fo(c)) d = Math.min(d, fo(n, l[u], l[m]));
|
|
5500
5516
|
if (qo([n.y, n.x], [l.map((u) => [u.y, u.x]), ...c.aneis.slice(1).map((u) => u.map(e).map((m) => [m.y, m.x]))]) || d <= o) {
|
|
5501
|
-
const u =
|
|
5517
|
+
const u = Ea(r, e);
|
|
5502
5518
|
(!s || u < s.a) && (s = { f: r, a: u });
|
|
5503
5519
|
}
|
|
5504
5520
|
}
|
|
5505
5521
|
}
|
|
5506
5522
|
return (i == null ? void 0 : i.f) ?? (a == null ? void 0 : a.f) ?? (s == null ? void 0 : s.f) ?? null;
|
|
5507
5523
|
}
|
|
5508
|
-
const j = "feicoes",
|
|
5509
|
-
class
|
|
5524
|
+
const j = "feicoes", Ia = /* @__PURE__ */ new Set(["ponto", "linha", "poligono", "retangulo", "elipse", "poligono-regular", "estrela", "circulo", "texto", "caneta"]);
|
|
5525
|
+
class _a {
|
|
5510
5526
|
constructor(t) {
|
|
5511
5527
|
p(this, "selecao");
|
|
5512
5528
|
p(this, "popup");
|
|
@@ -5527,7 +5543,7 @@ class za {
|
|
|
5527
5543
|
/** Aceita a coordenada (0, 0) exata nas feições de entrada (atributo `aceitar-origem`). */
|
|
5528
5544
|
p(this, "aceitarOrigem", !1);
|
|
5529
5545
|
p(this, "opcoesPopup", { copiarParaAreaDeTransferencia: !0 });
|
|
5530
|
-
this.contexto = t, this.regra = t.regra ?? new Pe(), this.cursores = new An(() => this.contexto.obterMapa()), this.snap = new
|
|
5546
|
+
this.contexto = t, this.regra = t.regra ?? new Pe(), this.cursores = new An(() => this.contexto.obterMapa()), this.snap = new ma({
|
|
5531
5547
|
aoMudar: (e) => {
|
|
5532
5548
|
var o, i, a;
|
|
5533
5549
|
this.contexto.emitir("cad-snap", e), (o = this.editor) == null || o.atualizarSnapNoHud(), (a = (i = this.contexto).aoSnapMudar) == null || a.call(i, e.ligado);
|
|
@@ -5539,7 +5555,7 @@ class za {
|
|
|
5539
5555
|
}), this.selecao = new kn({
|
|
5540
5556
|
obterFeicao: (e) => this.buscar(e.camadaId, e.id),
|
|
5541
5557
|
aplicarVisual: (e, o) => {
|
|
5542
|
-
const i = this.contexto.obterLayerManager().getLayerInstance(e), a =
|
|
5558
|
+
const i = this.contexto.obterLayerManager().getLayerInstance(e), a = F.get(j);
|
|
5543
5559
|
i && a && a.aplicarSelecao(i, o);
|
|
5544
5560
|
},
|
|
5545
5561
|
aoSelecionar: (e) => {
|
|
@@ -5659,7 +5675,7 @@ class za {
|
|
|
5659
5675
|
E === void 0 || L[E] === null || (L[E] = null, k.push(w), i.removidas++, v = !0);
|
|
5660
5676
|
}
|
|
5661
5677
|
c.forEach((S, w) => {
|
|
5662
|
-
const E = S && typeof S == "object" && S.id !== void 0 && S.id !== null ? String(S.id) : "", I = C.get(E),
|
|
5678
|
+
const E = S && typeof S == "object" && S.id !== void 0 && S.id !== null ? String(S.id) : "", I = C.get(E), O = I === void 0 ? null : L[I], T = O ? this.mesclar(O, S, t, !!o.substituirPropriedades) : null;
|
|
5663
5679
|
if (!T || I === void 0) {
|
|
5664
5680
|
i.recusadas.push(E || d(S, w));
|
|
5665
5681
|
return;
|
|
@@ -5725,7 +5741,7 @@ class za {
|
|
|
5725
5741
|
for (const r of this.contexto.obterLayerManager().getActiveSelectableLayers())
|
|
5726
5742
|
if (r.tipo === j)
|
|
5727
5743
|
for (const c of this.lista(r.id))
|
|
5728
|
-
this.desenhada(c) &&
|
|
5744
|
+
this.desenhada(c) && Fn(c, t, a, e) && s.push({ camadaId: r.id, id: c.id });
|
|
5729
5745
|
o ? this.selecao.alternarVarias(s) : this.selecao.selecionar(s);
|
|
5730
5746
|
}
|
|
5731
5747
|
// ---- popup e câmera ----
|
|
@@ -5751,7 +5767,7 @@ class za {
|
|
|
5751
5767
|
}
|
|
5752
5768
|
aplicarMargensHud() {
|
|
5753
5769
|
const t = this.contexto.obterMapa();
|
|
5754
|
-
t &&
|
|
5770
|
+
t && da(t.getContainer(), this.margensHud);
|
|
5755
5771
|
}
|
|
5756
5772
|
// ---- versões (oficial × prévia) ----
|
|
5757
5773
|
get regraVersoes() {
|
|
@@ -5764,7 +5780,7 @@ class za {
|
|
|
5764
5780
|
}
|
|
5765
5781
|
/** Aparece segundo a regra de oficial × prévia? */
|
|
5766
5782
|
visivelPorVersao(t) {
|
|
5767
|
-
const e = this.contexto.obterLayerManager().getLayerInstance(t.camadaId), o =
|
|
5783
|
+
const e = this.contexto.obterLayerManager().getLayerInstance(t.camadaId), o = F.get(j);
|
|
5768
5784
|
return e && o ? o.feicaoVisivel(e, t) : this.regra.visivel(t, this.oficiaisDe(t.camadaId));
|
|
5769
5785
|
}
|
|
5770
5786
|
/** Vai para a tela e responde a clique, caixa, laço, snap e hover: não excluída, não oculta e visível pela regra de versões. */
|
|
@@ -5778,7 +5794,7 @@ class za {
|
|
|
5778
5794
|
return e && e.id === t.id && e.camadaId === t.camadaId ? !0 : !t.oculta && this.visivelPorVersao(t);
|
|
5779
5795
|
}
|
|
5780
5796
|
aplicarVersoes() {
|
|
5781
|
-
const t = this.contexto.obterLayerManager(), e =
|
|
5797
|
+
const t = this.contexto.obterLayerManager(), e = F.get(j);
|
|
5782
5798
|
for (const o of t.getLayers()) {
|
|
5783
5799
|
if (o.tipo !== j) continue;
|
|
5784
5800
|
const i = t.getLayerInstance(o.id);
|
|
@@ -5939,7 +5955,7 @@ class za {
|
|
|
5939
5955
|
}
|
|
5940
5956
|
/** Feições visíveis das camadas de feições cujo envelope toca um quadrado de `tolPx` px em volta de `coord`. */
|
|
5941
5957
|
candidatasEm(t, e) {
|
|
5942
|
-
const o = this.contexto.obterMapa(), i = this.contexto.obterLayerManager(), a =
|
|
5958
|
+
const o = this.contexto.obterMapa(), i = this.contexto.obterLayerManager(), a = F.get(j);
|
|
5943
5959
|
if (!o || !a) return [];
|
|
5944
5960
|
const s = o.latLngToContainerPoint(t), r = o.containerPointToLatLng([s.x - e, s.y + e]), c = o.containerPointToLatLng([s.x + e, s.y - e]), l = {
|
|
5945
5961
|
minLon: Math.min(r.lng, c.lng),
|
|
@@ -5959,7 +5975,7 @@ class za {
|
|
|
5959
5975
|
const o = this.contexto.obterMapa();
|
|
5960
5976
|
if (!o) return null;
|
|
5961
5977
|
const i = o.latLngToContainerPoint(t), a = this.candidatasEm(t, Vo);
|
|
5962
|
-
return
|
|
5978
|
+
return fa({ x: i.x, y: i.y }, a, (s) => o.latLngToContainerPoint(s), {}, e);
|
|
5963
5979
|
}
|
|
5964
5980
|
// ---- edição de vértices ----
|
|
5965
5981
|
get editando() {
|
|
@@ -5976,7 +5992,7 @@ class za {
|
|
|
5976
5992
|
const s = this.contexto.obterMapa();
|
|
5977
5993
|
if (!s) return { ok: !1, motivo: "sem-mapa" };
|
|
5978
5994
|
(d = this.desenho) == null || d.desativar(), (h = this.editor) == null || h.parar(), this.aplicarMargensHud(), this.selecao.selecionar([{ camadaId: t, id: e }]), this.popup.fechar();
|
|
5979
|
-
const r = this.contexto.obterLayerManager(), c =
|
|
5995
|
+
const r = this.contexto.obterLayerManager(), c = F.get(j), l = new ua({
|
|
5980
5996
|
map: s,
|
|
5981
5997
|
snapLigado: () => this.snap.ativo,
|
|
5982
5998
|
alternarSnap: () => this.snap.alternar(),
|
|
@@ -6030,12 +6046,12 @@ class za {
|
|
|
6030
6046
|
if (!Go(t)) return { ok: !1, motivo: "ferramenta-invalida" };
|
|
6031
6047
|
const o = this.contexto.obterMapa();
|
|
6032
6048
|
if (!o) return { ok: !1, motivo: "sem-mapa" };
|
|
6033
|
-
if (
|
|
6049
|
+
if (Ia.has(t)) {
|
|
6034
6050
|
const c = this.motivoCamadaDesenhoInvalida();
|
|
6035
6051
|
if (c)
|
|
6036
6052
|
return this.contexto.emitir("cad-desenho-recusado", { ferramenta: t, motivo: c }), { ok: !1, motivo: c };
|
|
6037
6053
|
}
|
|
6038
|
-
(a = this.editor) == null || a.parar(), this.popup.fechar(), this.aplicarMargensHud(), this.desenho || (this.desenho = new
|
|
6054
|
+
(a = this.editor) == null || a.parar(), this.popup.fechar(), this.aplicarMargensHud(), this.desenho || (this.desenho = new ka({
|
|
6039
6055
|
map: o,
|
|
6040
6056
|
buscarSnap: (c) => this.buscarSnapEm(c),
|
|
6041
6057
|
snapAtivo: () => this.snap.ativo,
|
|
@@ -6257,7 +6273,7 @@ function ue(n) {
|
|
|
6257
6273
|
const e = new Set(t.filter(Go));
|
|
6258
6274
|
return we.filter((o) => e.has(o));
|
|
6259
6275
|
}
|
|
6260
|
-
class
|
|
6276
|
+
class Ta {
|
|
6261
6277
|
constructor(t) {
|
|
6262
6278
|
p(this, "barra", null);
|
|
6263
6279
|
this.ctx = t;
|
|
@@ -6285,8 +6301,8 @@ class Ea {
|
|
|
6285
6301
|
(t = this.barra) == null || t.remove(), this.barra = null;
|
|
6286
6302
|
}
|
|
6287
6303
|
}
|
|
6288
|
-
const
|
|
6289
|
-
function
|
|
6304
|
+
const $a = "data-cad-estilos-externos";
|
|
6305
|
+
function qa(n) {
|
|
6290
6306
|
try {
|
|
6291
6307
|
return Array.from(n.cssRules, (t) => t.cssText).join(`
|
|
6292
6308
|
`);
|
|
@@ -6294,10 +6310,10 @@ function _a(n) {
|
|
|
6294
6310
|
return "";
|
|
6295
6311
|
}
|
|
6296
6312
|
}
|
|
6297
|
-
function
|
|
6298
|
-
return typeof n == "string" ? n.trim() ? [n] : [] : Array.isArray(n) ? n.map((t) => typeof t == "string" ? t :
|
|
6313
|
+
function Da(n) {
|
|
6314
|
+
return typeof n == "string" ? n.trim() ? [n] : [] : Array.isArray(n) ? n.map((t) => typeof t == "string" ? t : qa(t)).filter((t) => t.trim() !== "") : [];
|
|
6299
6315
|
}
|
|
6300
|
-
class
|
|
6316
|
+
class Na {
|
|
6301
6317
|
constructor(t) {
|
|
6302
6318
|
p(this, "textos", []);
|
|
6303
6319
|
p(this, "adotadas", []);
|
|
@@ -6309,7 +6325,7 @@ class $a {
|
|
|
6309
6325
|
return this.textos;
|
|
6310
6326
|
}
|
|
6311
6327
|
definir(t) {
|
|
6312
|
-
this.textos =
|
|
6328
|
+
this.textos = Da(t), this.aplicar();
|
|
6313
6329
|
}
|
|
6314
6330
|
/** Tira as folhas do shadow root, mantendo o pedido para `aplicar()` depois. */
|
|
6315
6331
|
limpar() {
|
|
@@ -6329,7 +6345,7 @@ class $a {
|
|
|
6329
6345
|
this.adotadas = [];
|
|
6330
6346
|
}
|
|
6331
6347
|
const e = document.createElement("style");
|
|
6332
|
-
e.setAttribute(
|
|
6348
|
+
e.setAttribute($a, ""), e.textContent = this.textos.join(`
|
|
6333
6349
|
`), this.shadow.appendChild(e), this.fallback = e;
|
|
6334
6350
|
}
|
|
6335
6351
|
remover() {
|
|
@@ -6338,7 +6354,7 @@ class $a {
|
|
|
6338
6354
|
this.adotadas.length > 0 && Array.isArray(t.adoptedStyleSheets) && (t.adoptedStyleSheets = t.adoptedStyleSheets.filter((o) => !this.adotadas.includes(o))), this.adotadas = [], (e = this.fallback) == null || e.remove(), this.fallback = null;
|
|
6339
6355
|
}
|
|
6340
6356
|
}
|
|
6341
|
-
class
|
|
6357
|
+
class Oa extends Zo {
|
|
6342
6358
|
constructor() {
|
|
6343
6359
|
var a;
|
|
6344
6360
|
super();
|
|
@@ -6360,7 +6376,7 @@ class qa extends Zo {
|
|
|
6360
6376
|
p(this, "lastCanvasClickTime", 0);
|
|
6361
6377
|
p(this, "_chaveGrupo");
|
|
6362
6378
|
p(this, "_zonaProjecao", 22);
|
|
6363
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.controller = new rn(), this.controladorTamanho = pn(this, this.controller), this.shadow.innerHTML = yn(), this.estilosExternos = new
|
|
6379
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.controller = new rn(), this.controladorTamanho = pn(this, this.controller), this.shadow.innerHTML = yn(), this.estilosExternos = new Na(this.shadow), this.mapContainer = this.shadow.getElementById("cad-map-container"), this.layersPanel = this.shadow.getElementById("qgis-layer-panel"), this.toolbarPainel = new mn({
|
|
6364
6380
|
shadow: this.shadow,
|
|
6365
6381
|
mapContainer: this.mapContainer,
|
|
6366
6382
|
layersPanel: this.layersPanel,
|
|
@@ -6382,7 +6398,7 @@ class qa extends Zo {
|
|
|
6382
6398
|
setLayerVisibility: (s, r) => this.setLayerVisibility(s, r)
|
|
6383
6399
|
});
|
|
6384
6400
|
const e = new Pe(), o = this.controller.context, i = this.controller.canvasInteracao.ctx;
|
|
6385
|
-
Object.assign(o, { regraVersoes: e }), this.feicoes = new
|
|
6401
|
+
Object.assign(o, { regraVersoes: e }), this.feicoes = new _a({
|
|
6386
6402
|
obterLayerManager: () => this.controller.layerManager,
|
|
6387
6403
|
obterMapa: () => this.controller.getMap(),
|
|
6388
6404
|
regra: e,
|
|
@@ -6402,7 +6418,7 @@ class qa extends Zo {
|
|
|
6402
6418
|
const c = this.feicoes.tratarAcaoCamada(s, r);
|
|
6403
6419
|
c && this.dispatchEvent(new CustomEvent(c, { detail: r, bubbles: !0, composed: !0 }));
|
|
6404
6420
|
}
|
|
6405
|
-
}), this.barraFerramentas = new
|
|
6421
|
+
}), this.barraFerramentas = new Ta({
|
|
6406
6422
|
raiz: this.shadow.getElementById("cad-root"),
|
|
6407
6423
|
aoEscolher: (s) => {
|
|
6408
6424
|
this.feicoes.alternarFerramenta(s);
|
|
@@ -6915,8 +6931,8 @@ class qa extends Zo {
|
|
|
6915
6931
|
return this.controller.layerManager;
|
|
6916
6932
|
}
|
|
6917
6933
|
}
|
|
6918
|
-
Xo("ui-canvas-cad",
|
|
6919
|
-
class
|
|
6934
|
+
Xo("ui-canvas-cad", Oa);
|
|
6935
|
+
class is {
|
|
6920
6936
|
constructor(t, e) {
|
|
6921
6937
|
p(this, "polylines", []);
|
|
6922
6938
|
p(this, "bancoPontosAtivo", !1);
|
|
@@ -7059,7 +7075,7 @@ class ts {
|
|
|
7059
7075
|
this.core.map && this.polylines.forEach((t) => this.core.map.removeLayer(t)), this.core.bancoPontosGroup && this.core.bancoPontosGroup.clearLayers(), this.polylines = [];
|
|
7060
7076
|
}
|
|
7061
7077
|
}
|
|
7062
|
-
class
|
|
7078
|
+
class ns {
|
|
7063
7079
|
constructor(t, e) {
|
|
7064
7080
|
p(this, "markers", []);
|
|
7065
7081
|
p(this, "vizinhosMarkers", []);
|
|
@@ -7198,7 +7214,7 @@ class es {
|
|
|
7198
7214
|
}
|
|
7199
7215
|
}
|
|
7200
7216
|
export {
|
|
7201
|
-
|
|
7217
|
+
Oi as AgrupadorCluster,
|
|
7202
7218
|
rn as CADMapaController,
|
|
7203
7219
|
Qo as CAD_INTERACTIVE_PANES,
|
|
7204
7220
|
Rt as CELULA_CLUSTER_PX,
|
|
@@ -7208,109 +7224,110 @@ export {
|
|
|
7208
7224
|
rn as CanvasCADController,
|
|
7209
7225
|
di as CanvasInteracao,
|
|
7210
7226
|
Hi as CanvasLayerManager,
|
|
7211
|
-
|
|
7227
|
+
ka as ControleDesenho,
|
|
7212
7228
|
An as CursoresRemotos,
|
|
7213
7229
|
Ie as DEFAULT_CONFIG,
|
|
7214
7230
|
Ue as DEFAULT_LAYERS,
|
|
7215
|
-
|
|
7231
|
+
ua as EditorVertices,
|
|
7216
7232
|
we as FERRAMENTAS,
|
|
7217
|
-
|
|
7218
|
-
|
|
7233
|
+
ca as FOLGA_HUD,
|
|
7234
|
+
la as FRACAO_LARGURA_HUD,
|
|
7219
7235
|
Wn as FeicaoPopup,
|
|
7220
7236
|
ji as FeicoesLayerRenderer,
|
|
7221
7237
|
rn as GerenciGeoMapaController,
|
|
7222
7238
|
vi as GridLayerRenderer,
|
|
7223
7239
|
Qt as ICONES_FEICAO,
|
|
7224
|
-
|
|
7225
|
-
|
|
7240
|
+
La as ID_HUD_DESENHO,
|
|
7241
|
+
ha as ID_HUD_EDICAO,
|
|
7226
7242
|
Si as IndiceEspacial,
|
|
7227
7243
|
ve as LIMIAR_DENSIDADE_ALTA,
|
|
7228
7244
|
He as LIMITE_CULLING,
|
|
7229
|
-
|
|
7230
|
-
|
|
7245
|
+
F as LayerRendererFactory,
|
|
7246
|
+
ra as MARGEM_HUD_PADRAO,
|
|
7231
7247
|
Di as MAX_PONTOS_SEM_CLUSTER,
|
|
7232
7248
|
Un as MAX_VERTICES_EDICAO,
|
|
7233
7249
|
So as MIN_VERTICES_SIMPLIFICAR,
|
|
7234
7250
|
fe as MapaConfigManager,
|
|
7235
7251
|
Jo as MapaCore,
|
|
7236
|
-
|
|
7237
|
-
|
|
7252
|
+
is as MapaLinhas,
|
|
7253
|
+
ns as MapaMarcadores,
|
|
7238
7254
|
re as PROPRIEDADES_HUD,
|
|
7239
7255
|
ho as RAIO_MINIMO_CIRCULO_M,
|
|
7256
|
+
Jn as RAIO_MINIMO_EDICAO_CIRCULO_M,
|
|
7240
7257
|
Pe as RegraVersoes,
|
|
7241
7258
|
kn as SelecaoFeicoes,
|
|
7242
7259
|
de as SessaoDesenho,
|
|
7243
|
-
|
|
7260
|
+
za as TOLERANCIA_AMOSTRA_PX,
|
|
7244
7261
|
Ut as TOLERANCIA_LINHA_PX,
|
|
7245
7262
|
ei as TOLERANCIA_PONTO_PX,
|
|
7246
7263
|
Vo as TOLERANCIA_SNAP_PX,
|
|
7247
7264
|
hi as TileLayerRenderer,
|
|
7248
|
-
|
|
7265
|
+
Oa as UICanvasCAD,
|
|
7249
7266
|
pi as VectorLinesLayerRenderer,
|
|
7250
7267
|
mi as VectorPointsLayerRenderer,
|
|
7251
7268
|
gi as VectorPolygonsLayerRenderer,
|
|
7252
7269
|
ui as WmsLayerRenderer,
|
|
7253
7270
|
qi as ZOOM_DESMEMBRAR,
|
|
7254
7271
|
be as ZOOM_SEM_SIMPLIFICACAO,
|
|
7255
|
-
|
|
7272
|
+
Wa as agruparPontos,
|
|
7256
7273
|
$t as agruparPontosPorChave,
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7274
|
+
sa as alternarSuavidade,
|
|
7275
|
+
ba as amostrarBezier,
|
|
7276
|
+
da as aplicarMargensHud,
|
|
7277
|
+
it as areaDaGeometria,
|
|
7261
7278
|
yi as areaMetros2,
|
|
7262
7279
|
Mt as bindPopupAcoesEvents,
|
|
7263
|
-
|
|
7280
|
+
fa as buscarSnap,
|
|
7264
7281
|
Re as caixaDaFeicao,
|
|
7265
7282
|
St as caixasSeTocam,
|
|
7266
7283
|
Ni as centroDe,
|
|
7267
7284
|
ae as clonarFeicao,
|
|
7268
|
-
|
|
7285
|
+
ta as comPontos,
|
|
7269
7286
|
Wt as comVertices,
|
|
7270
|
-
|
|
7271
|
-
|
|
7287
|
+
Ot as comprimentoMetros,
|
|
7288
|
+
Za as confrontanteParaFeicao,
|
|
7272
7289
|
xo as consultarFeicoesNoPonto,
|
|
7273
|
-
|
|
7274
|
-
|
|
7290
|
+
Ka as converterArea,
|
|
7291
|
+
Ya as converterComprimento,
|
|
7275
7292
|
Gt as coordenadaDeReferencia,
|
|
7276
7293
|
Ce as corHexSegura,
|
|
7277
7294
|
K as corSegura,
|
|
7278
7295
|
pn as criarControladorTamanho,
|
|
7279
7296
|
wt as criarLinha,
|
|
7280
|
-
|
|
7297
|
+
Ja as ddParaDms,
|
|
7281
7298
|
Dn as deslocarGeometria,
|
|
7282
7299
|
Le as deveAgrupar,
|
|
7283
|
-
|
|
7284
|
-
|
|
7300
|
+
ts as distanciaEntre,
|
|
7301
|
+
ht as distanciaMetros,
|
|
7285
7302
|
zn as dividirPoligonoComLinha,
|
|
7286
|
-
|
|
7303
|
+
Qa as dmsParaDd,
|
|
7287
7304
|
Go as ehFerramenta,
|
|
7288
7305
|
Nt as ehMultilinha,
|
|
7289
7306
|
dt as entidadeDe,
|
|
7290
7307
|
_ as escapeHtml,
|
|
7291
|
-
|
|
7308
|
+
nt as extensaoDaGeometria,
|
|
7292
7309
|
Ee as extrairCentroDeWkt,
|
|
7293
7310
|
fi as extrairCorPonto,
|
|
7294
7311
|
Po as fatorDensidade,
|
|
7295
|
-
|
|
7312
|
+
Fn as feicaoNaCaixa,
|
|
7296
7313
|
Rn as feicaoNoLaco,
|
|
7297
7314
|
mo as feicaoNoPonto,
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7315
|
+
Ha as feicaoNoTopo,
|
|
7316
|
+
rs as formatUTM,
|
|
7317
|
+
ut as formatarArea,
|
|
7318
|
+
H as formatarExtensao,
|
|
7302
7319
|
ii as garantirCanvasSemEventos,
|
|
7303
7320
|
qn as gerarBuffer,
|
|
7304
7321
|
Dt as getPointShapeHtml,
|
|
7305
|
-
|
|
7322
|
+
ia as inserirPonto,
|
|
7306
7323
|
Zn as inserirVertice,
|
|
7307
7324
|
En as juntarLinhas,
|
|
7308
7325
|
Tn as juntarPoligonos,
|
|
7309
7326
|
Lo as limitesDaGeometria,
|
|
7310
7327
|
Ht as minimoVertices,
|
|
7311
7328
|
ye as modoDensidade,
|
|
7312
|
-
|
|
7313
|
-
|
|
7329
|
+
aa as moverAlca,
|
|
7330
|
+
es as moverVertice,
|
|
7314
7331
|
$o as normalizarAnel,
|
|
7315
7332
|
Z as normalizarCoordenada,
|
|
7316
7333
|
oe as normalizarFeicaoEntrada,
|
|
@@ -7320,23 +7337,24 @@ export {
|
|
|
7320
7337
|
Tt as nosDeAncoras,
|
|
7321
7338
|
qt as ordenarPontosPorSequencia,
|
|
7322
7339
|
B as parseCoordenada,
|
|
7323
|
-
|
|
7324
|
-
|
|
7340
|
+
W as partesDaLinha,
|
|
7341
|
+
Qn as pontoDaBordaDoCirculo,
|
|
7342
|
+
Oo as pontoMedio,
|
|
7325
7343
|
se as pontoMedioDoSegmento,
|
|
7326
7344
|
qo as pontoNoPoligono,
|
|
7327
|
-
|
|
7345
|
+
Ua as pontoParaFeicao,
|
|
7328
7346
|
_t as pontosDe,
|
|
7329
|
-
|
|
7347
|
+
os as posicaoHud,
|
|
7330
7348
|
dn as processarAcaoPopup,
|
|
7331
7349
|
ln as processarCliqueLivreCanvas,
|
|
7332
|
-
|
|
7350
|
+
na as removerPonto,
|
|
7333
7351
|
Yn as removerVertice,
|
|
7334
7352
|
Ct as renderPopupAcoesHtml,
|
|
7335
7353
|
cn as renderizarPainelCamadas,
|
|
7336
7354
|
li as resolverCliqueCentral,
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7355
|
+
Xa as segmentoParaFeicao,
|
|
7356
|
+
Fo as segmentosDe,
|
|
7357
|
+
oa as segmentosDoEditor,
|
|
7340
7358
|
Ai as simplificarAnel,
|
|
7341
7359
|
ki as simplificarGeometria,
|
|
7342
7360
|
Co as simplificarLinha,
|