@carto/ps-react-maps 2.1.0 → 3.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +29 -0
- package/README.md +16 -13
- package/dist/index.js +2317 -1433
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/common/common.d.ts +3 -0
- package/dist/types/common/index.d.ts +25 -0
- package/dist/types/common/lasso-tools.d.ts +33 -0
- package/dist/types/common/measurement-tools.d.ts +66 -0
- package/dist/types/const.d.ts +31 -0
- package/dist/types/deckgl.d.ts +2 -0
- package/dist/types/editable/const.d.ts +8 -0
- package/dist/types/editable/lasso-tools/const.d.ts +31 -0
- package/dist/types/editable/lasso-tools/lasso-tools-control.d.ts +2 -0
- package/dist/types/editable/lasso-tools/lasso-tools.d.ts +28 -0
- package/dist/types/editable/lasso-tools/layer.d.ts +3 -0
- package/dist/types/editable/lasso-tools/modes/custom-edit-mode.class.d.ts +5 -0
- package/dist/types/editable/lasso-tools/provider/provider.d.ts +4 -0
- package/dist/types/editable/lasso-tools/provider/store.d.ts +2 -0
- package/dist/types/editable/lasso-tools/provider/types.d.ts +14 -0
- package/dist/types/editable/lasso-tools/types.d.ts +77 -0
- package/dist/types/editable/measurement-tools/const.d.ts +67 -0
- package/dist/types/editable/measurement-tools/layer.d.ts +3 -0
- package/dist/types/editable/measurement-tools/measurement-tools-control.d.ts +2 -0
- package/dist/types/editable/measurement-tools/measurement-tools.d.ts +8 -0
- package/dist/types/editable/measurement-tools/modes/custom-measurement-area.class.d.ts +30 -0
- package/dist/types/editable/measurement-tools/modes/custom-measurement-buffer.class.d.ts +28 -0
- package/dist/types/editable/measurement-tools/modes/custom-measurement-distance.class.d.ts +16 -0
- package/dist/types/editable/measurement-tools/provider/provider.d.ts +4 -0
- package/dist/types/editable/measurement-tools/provider/store.d.ts +2 -0
- package/dist/types/editable/measurement-tools/provider/types.d.ts +18 -0
- package/dist/types/editable/measurement-tools/types.d.ts +97 -0
- package/dist/types/editable/measurement-tools/use-measurement-tools.d.ts +36 -0
- package/dist/types/editable/measurement-tools/utils.d.ts +17 -0
- package/dist/types/helpers.d.ts +12 -0
- package/dist/types/index.d.ts +41 -4
- package/dist/types/map.d.ts +2 -0
- package/dist/types/providers/layers/store.d.ts +2 -0
- package/dist/types/providers/layers/types.d.ts +9 -0
- package/dist/types/providers/map/const.d.ts +2 -0
- package/dist/types/providers/map/provider.d.ts +4 -0
- package/dist/types/providers/map/store.d.ts +2 -0
- package/dist/types/providers/map/types.d.ts +59 -0
- package/dist/types/providers/sources/const.d.ts +2 -0
- package/dist/types/providers/sources/store.d.ts +2 -0
- package/dist/types/providers/sources/types.d.ts +17 -0
- package/dist/types/types.d.ts +56 -0
- package/dist/types/use-get-layers.d.ts +4 -0
- package/dist/types/use-map-screenshot.d.ts +8 -0
- package/dist/types/utils/object-to-html/const.d.ts +5 -0
- package/dist/types/utils/object-to-html/object-to-html.test.d.ts +1 -0
- package/dist/types/utils/object-to-html/types.d.ts +3 -6
- package/dist/types/zoom-controls.d.ts +2 -0
- package/package.json +78 -42
- package/dist/index.cjs +0 -30
- package/dist/types/assets/icons/ruler.d.ts +0 -2
- package/dist/types/common-stories/maps/deckgl-maps.component.d.ts +0 -2
- package/dist/types/common-stories/maps/google-maps.component.d.ts +0 -3
- package/dist/types/common-stories/maps/map-container.component.d.ts +0 -4
- package/dist/types/common-stories/maps/map.component.d.ts +0 -2
- package/dist/types/event-manager/index.d.ts +0 -1
- package/dist/types/event-manager/use-event-manager.hook.d.ts +0 -14
- package/dist/types/map-measurement-tool/custom-editable-geojson-layer.class.d.ts +0 -10
- package/dist/types/map-measurement-tool/custom-measurement-distance-mode.class.d.ts +0 -6
- package/dist/types/map-measurement-tool/index.d.ts +0 -9
- package/dist/types/map-measurement-tool/map-measurement-tool.component.d.ts +0 -6
- package/dist/types/map-measurement-tool/map-measurement-tool.const.d.ts +0 -34
- package/dist/types/map-measurement-tool/map-measurement-tool.context.d.ts +0 -5
- package/dist/types/map-measurement-tool/map-measurement-tool.hook.d.ts +0 -10
- package/dist/types/map-measurement-tool/map-measurement-tool.layer.d.ts +0 -10
- package/dist/types/map-measurement-tool/map-measurement-tool.provider.d.ts +0 -8
- package/dist/types/map-measurement-tool/map-measurement-tool.reducer.d.ts +0 -15
- package/dist/types/map-measurement-tool/map-measurement-tool.styles.d.ts +0 -28
- package/dist/types/map-measurement-tool/map-measurement-tool.types.d.ts +0 -91
- package/dist/types/map-measurement-tool/map-measurement-tool.util.d.ts +0 -12
- package/dist/types/map-provider/index.d.ts +0 -6
- package/dist/types/map-provider/map-provider.const.d.ts +0 -33
- package/dist/types/map-provider/map-provider.context.d.ts +0 -6
- package/dist/types/map-provider/map-provider.hook.d.ts +0 -87
- package/dist/types/map-provider/map-provider.provider.d.ts +0 -13
- package/dist/types/map-provider/map-provider.reducer.d.ts +0 -24
- package/dist/types/map-provider/map-provider.types.d.ts +0 -122
- package/dist/types/utils/get-map-type/get-map-type.d.ts +0 -1
- package/dist/types/utils/get-map-type/index.d.ts +0 -2
- package/dist/types/utils/get-map-type/is-gmaps.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -2
- package/dist/types/utils/object-to-html/index.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,1019 +1,1601 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var Pt = Object.defineProperty;
|
|
2
|
+
var Ct = (n, e, t) => e in n ? Pt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Q = (n, e, t) => Ct(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { jsx as Z, jsxs as Tt } from "react/jsx-runtime";
|
|
5
|
+
import { c as ee } from "react/compiler-runtime";
|
|
6
|
+
import { useState as pe, useEffect as ce, useImperativeHandle as kt, createContext as Ne, useContext as $e, useMemo as Me, useCallback as q, useRef as Ft } from "react";
|
|
7
|
+
import { DeckGL as At } from "@deck.gl/react";
|
|
8
|
+
import { Map as Ot, MapProvider as Rt, useMap as Dt } from "react-map-gl/maplibre";
|
|
9
|
+
import { Map as Ut, APIProvider as xt, limitTiltRange as Vt, useMap as Nt } from "@vis.gl/react-google-maps";
|
|
10
|
+
import { CompositeMode as $t, TranslateMode as qt, ModifyMode as Gt, DrawPolygonMode as Bt, DrawRectangleMode as Ht, DrawCircleFromCenterMode as at, DrawPolygonByDraggingMode as jt, EditableGeoJsonLayer as lt, MeasureAreaMode as zt, getPickedEditHandle as It, MeasureDistanceMode as Wt } from "@deck.gl-community/editable-layers";
|
|
11
|
+
import { create as ct, createStore as qe, useStore as Ge } from "zustand";
|
|
12
|
+
import { FlyToInterpolator as Zt } from "@deck.gl/core";
|
|
13
|
+
import { GeoJsonLayer as Kt } from "@deck.gl/layers";
|
|
14
|
+
import { DataFilterExtension as Yt } from "@deck.gl/extensions";
|
|
15
|
+
import { formatNumber as ut, formatCurrency as Xt } from "@carto/ps-utils";
|
|
16
|
+
import Jt from "convert-units";
|
|
17
|
+
import Qt from "convert-units/definitions/length";
|
|
18
|
+
import en from "html2canvas";
|
|
19
|
+
const Ae = {
|
|
20
|
+
roadmap: "roadmap",
|
|
21
|
+
satellite: "satellite",
|
|
22
|
+
hybrid: "hybrid"
|
|
23
|
+
}, K = {
|
|
24
|
+
darkMatter: "darkMatter",
|
|
25
|
+
positron: "positron",
|
|
26
|
+
voyager: "voyager"
|
|
27
|
+
}, Oe = {
|
|
28
|
+
[K.positron]: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
|
|
29
|
+
[K.voyager]: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
|
|
30
|
+
[K.darkMatter]: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
31
|
+
}, le = {
|
|
32
|
+
maplibre: "maplibre",
|
|
33
|
+
googleMaps: "google-maps"
|
|
34
|
+
}, dt = {
|
|
35
|
+
[K.positron]: {
|
|
36
|
+
url: Oe[K.positron],
|
|
37
|
+
type: le.maplibre
|
|
17
38
|
},
|
|
18
|
-
voyager: {
|
|
19
|
-
url:
|
|
20
|
-
type:
|
|
21
|
-
/* Maplibre */
|
|
39
|
+
[K.voyager]: {
|
|
40
|
+
url: Oe[K.voyager],
|
|
41
|
+
type: le.maplibre
|
|
22
42
|
},
|
|
23
|
-
|
|
24
|
-
url:
|
|
25
|
-
|
|
26
|
-
/* DarkMatter */
|
|
27
|
-
],
|
|
28
|
-
type: "maplibre",
|
|
43
|
+
[K.darkMatter]: {
|
|
44
|
+
url: Oe[K.darkMatter],
|
|
45
|
+
type: le.maplibre,
|
|
29
46
|
dark: !0
|
|
30
47
|
},
|
|
31
|
-
roadmap: {
|
|
32
|
-
type:
|
|
33
|
-
/* GoogleMaps */
|
|
48
|
+
[Ae.roadmap]: {
|
|
49
|
+
type: le.googleMaps
|
|
34
50
|
},
|
|
35
|
-
satellite: {
|
|
36
|
-
type:
|
|
37
|
-
/* GoogleMaps */
|
|
51
|
+
[Ae.satellite]: {
|
|
52
|
+
type: le.googleMaps
|
|
38
53
|
},
|
|
39
|
-
hybrid: {
|
|
40
|
-
type:
|
|
41
|
-
/* GoogleMaps */
|
|
54
|
+
[Ae.hybrid]: {
|
|
55
|
+
type: le.googleMaps
|
|
42
56
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
};
|
|
58
|
+
function tn({
|
|
59
|
+
isDragging: n,
|
|
60
|
+
isHovering: e
|
|
61
|
+
}) {
|
|
62
|
+
return n ? "grabbing" : e ? "pointer" : "grab";
|
|
63
|
+
}
|
|
64
|
+
function nn(n) {
|
|
65
|
+
return n.html ? {
|
|
66
|
+
html: `<div class='map-tooltip__content'>${n.html}</div>`,
|
|
67
|
+
style: {
|
|
68
|
+
padding: "0",
|
|
69
|
+
background: "none"
|
|
70
|
+
}
|
|
71
|
+
} : null;
|
|
72
|
+
}
|
|
73
|
+
function sn(n) {
|
|
74
|
+
var de, M, He;
|
|
75
|
+
const e = ee(66);
|
|
76
|
+
let t, s, i, r, o, a, l, u, d, p, y, c, m, h;
|
|
77
|
+
e[0] !== n ? ({
|
|
78
|
+
instanceRef: t,
|
|
79
|
+
overlayRef: r,
|
|
80
|
+
basemap: l,
|
|
81
|
+
controller: u,
|
|
82
|
+
id: d,
|
|
83
|
+
layers: p,
|
|
84
|
+
parameters: o,
|
|
85
|
+
gmapsProps: y,
|
|
86
|
+
getCursor: c,
|
|
87
|
+
getTooltip: m,
|
|
88
|
+
onLoad: s,
|
|
89
|
+
onResize: i,
|
|
90
|
+
onViewStateChange: h,
|
|
91
|
+
...a
|
|
92
|
+
} = n, e[0] = n, e[1] = t, e[2] = s, e[3] = i, e[4] = r, e[5] = o, e[6] = a, e[7] = l, e[8] = u, e[9] = d, e[10] = p, e[11] = y, e[12] = c, e[13] = m, e[14] = h) : (t = e[1], s = e[2], i = e[3], r = e[4], o = e[5], a = e[6], l = e[7], u = e[8], d = e[9], p = e[10], y = e[11], c = e[12], m = e[13], h = e[14]);
|
|
93
|
+
const f = l === void 0 ? K.positron : l, S = u === void 0 ? !0 : u, v = d === void 0 ? "deck-gl-map" : d;
|
|
94
|
+
let E;
|
|
95
|
+
e[15] !== p ? (E = p === void 0 ? [] : p, e[15] = p, e[16] = E) : E = e[16];
|
|
96
|
+
const b = E;
|
|
97
|
+
let _;
|
|
98
|
+
e[17] !== y ? (_ = y === void 0 ? {
|
|
99
|
+
apiKey: ""
|
|
100
|
+
} : y, e[17] = y, e[18] = _) : _ = e[18];
|
|
101
|
+
let P, g, L;
|
|
102
|
+
e[19] !== _ ? ({
|
|
103
|
+
apiKey: L,
|
|
104
|
+
APIProviderProps: P,
|
|
105
|
+
...g
|
|
106
|
+
} = _, e[19] = _, e[20] = P, e[21] = g, e[22] = L) : (P = e[20], g = e[21], L = e[22]);
|
|
107
|
+
const w = c === void 0 ? tn : c, F = m === void 0 ? nn : m, A = h === void 0 ? cn : h;
|
|
108
|
+
let D;
|
|
109
|
+
e[23] === Symbol.for("react.memo_cache_sentinel") ? (D = [!1, !1], e[23] = D) : D = e[23];
|
|
110
|
+
const [U, Y] = pe(D);
|
|
111
|
+
let V;
|
|
112
|
+
e[24] !== U ? (V = U.every(ln), e[24] = U, e[25] = V) : V = e[25];
|
|
113
|
+
const R = V;
|
|
114
|
+
let x;
|
|
115
|
+
e[26] !== i ? (x = (fe) => {
|
|
116
|
+
i == null || i(fe);
|
|
117
|
+
}, e[26] = i, e[27] = x) : x = e[27];
|
|
118
|
+
const te = x, {
|
|
119
|
+
url: N,
|
|
120
|
+
type: Se
|
|
121
|
+
} = dt[f], B = Se === le.googleMaps;
|
|
122
|
+
let he, X;
|
|
123
|
+
e[28] !== b ? (X = b.filter(an).map(on), e[28] = b, e[29] = X) : X = e[29], he = X;
|
|
124
|
+
const ue = he;
|
|
125
|
+
let ne;
|
|
126
|
+
e[30] !== B || e[31] !== A ? (ne = (fe) => {
|
|
127
|
+
const Fe = B ? {
|
|
128
|
+
...fe,
|
|
129
|
+
viewState: Vt(fe)
|
|
130
|
+
} : fe;
|
|
131
|
+
A(Fe);
|
|
132
|
+
}, e[30] = B, e[31] = A, e[32] = ne) : ne = e[32];
|
|
133
|
+
const se = ne;
|
|
134
|
+
let H;
|
|
135
|
+
e[33] === Symbol.for("react.memo_cache_sentinel") ? (H = (fe) => {
|
|
136
|
+
const Fe = fe.type === "deckgl" ? 0 : 1;
|
|
137
|
+
Y((bt) => bt.map((wt, _t) => _t === Fe ? !0 : wt));
|
|
138
|
+
}, e[33] = H) : H = e[33];
|
|
139
|
+
const ie = H;
|
|
140
|
+
let re, oe;
|
|
141
|
+
e[34] !== R || e[35] !== s ? (re = () => {
|
|
142
|
+
s == null || s(R);
|
|
143
|
+
}, oe = [R, s], e[34] = R, e[35] = s, e[36] = re, e[37] = oe) : (re = e[36], oe = e[37]), ce(re, oe);
|
|
144
|
+
let J;
|
|
145
|
+
e[38] === Symbol.for("react.memo_cache_sentinel") ? (J = () => ie({
|
|
146
|
+
type: "deckgl"
|
|
147
|
+
}), e[38] = J) : J = e[38];
|
|
148
|
+
let I;
|
|
149
|
+
e[39] !== o ? (I = {
|
|
150
|
+
depthTest: !1,
|
|
151
|
+
...o
|
|
152
|
+
}, e[39] = o, e[40] = I) : I = e[40];
|
|
153
|
+
let j;
|
|
154
|
+
e[41] !== r ? (j = /* @__PURE__ */ Z(un, { overlayRef: r }), e[41] = r, e[42] = j) : j = e[42];
|
|
155
|
+
let W;
|
|
156
|
+
e[43] !== g || e[44] !== f || e[45] !== B || e[46] !== N || e[47] !== a ? (W = B ? /* @__PURE__ */ Z(Ut, { mapTypeId: f, reuseMaps: !0, renderingType: "RASTER", ...g, defaultCenter: {
|
|
157
|
+
lat: ((de = a.initialViewState) == null ? void 0 : de.latitude) ?? 0,
|
|
158
|
+
lng: ((M = a.initialViewState) == null ? void 0 : M.longitude) ?? 0
|
|
159
|
+
}, defaultZoom: ((He = a.initialViewState) == null ? void 0 : He.zoom) ?? 0, onTilesLoaded: () => ie({
|
|
160
|
+
type: "load"
|
|
161
|
+
}) }) : /* @__PURE__ */ Z(Ot, { reuseMaps: !0, mapStyle: N, onLoad: () => ie({
|
|
162
|
+
type: "load"
|
|
163
|
+
}), onRender: rn }), e[43] = g, e[44] = f, e[45] = B, e[46] = N, e[47] = a, e[48] = W) : W = e[48];
|
|
164
|
+
let z;
|
|
165
|
+
e[49] !== ue || e[50] !== S || e[51] !== w || e[52] !== F || e[53] !== te || e[54] !== se || e[55] !== v || e[56] !== t || e[57] !== a || e[58] !== I || e[59] !== j || e[60] !== W ? (z = /* @__PURE__ */ Z(Rt, { children: /* @__PURE__ */ Z("div", { className: "deckgl-map", children: /* @__PURE__ */ Tt(At, { controller: S, id: v, ref: t, layers: ue, getCursor: w, getTooltip: F, onLoad: J, onResize: te, onViewStateChange: se, parameters: I, ...a, children: [
|
|
166
|
+
j,
|
|
167
|
+
W
|
|
168
|
+
] }) }) }), e[49] = ue, e[50] = S, e[51] = w, e[52] = F, e[53] = te, e[54] = se, e[55] = v, e[56] = t, e[57] = a, e[58] = I, e[59] = j, e[60] = W, e[61] = z) : z = e[61];
|
|
169
|
+
let ae;
|
|
170
|
+
return e[62] !== P || e[63] !== L || e[64] !== z ? (ae = /* @__PURE__ */ Z(xt, { apiKey: L, ...P, children: z }), e[62] = P, e[63] = L, e[64] = z, e[65] = ae) : ae = e[65], ae;
|
|
171
|
+
}
|
|
172
|
+
function rn() {
|
|
173
|
+
const n = document.querySelector(".maplibregl-compact-show");
|
|
174
|
+
n == null || n.classList.remove("maplibregl-compact-show");
|
|
175
|
+
}
|
|
176
|
+
function on(n) {
|
|
177
|
+
const {
|
|
178
|
+
type: e,
|
|
179
|
+
props: t
|
|
180
|
+
} = n;
|
|
181
|
+
return new e(t);
|
|
182
|
+
}
|
|
183
|
+
function an(n) {
|
|
184
|
+
return !!(n != null && n.type);
|
|
185
|
+
}
|
|
186
|
+
function ln(n) {
|
|
187
|
+
return n;
|
|
188
|
+
}
|
|
189
|
+
function cn() {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
function un(n) {
|
|
193
|
+
const e = ee(4), {
|
|
194
|
+
overlayRef: t
|
|
195
|
+
} = n, {
|
|
196
|
+
default: s
|
|
197
|
+
} = Dt(), i = Nt();
|
|
198
|
+
let r, o;
|
|
199
|
+
return e[0] !== i || e[1] !== s ? (r = () => s ?? i, o = [s, i], e[0] = i, e[1] = s, e[2] = r, e[3] = o) : (r = e[2], o = e[3]), kt(t, r, o), null;
|
|
200
|
+
}
|
|
201
|
+
const G = {
|
|
202
|
+
addFeature: "addFeature",
|
|
203
|
+
addTentativePosition: "addTentativePosition",
|
|
204
|
+
updateTentativeFeature: "updateTentativeFeature",
|
|
205
|
+
cancel: "cancelFeature",
|
|
206
|
+
finish: "finish",
|
|
207
|
+
addPosition: "addPosition"
|
|
208
|
+
};
|
|
209
|
+
class dn extends $t {
|
|
210
|
+
constructor() {
|
|
211
|
+
super([new qt(), new Gt()]);
|
|
212
|
+
}
|
|
213
|
+
handleKeyUp(e, t) {
|
|
214
|
+
super.handleKeyUp(e, t), e.key === "Enter" && (this.resetClickSequence(), t.onEdit({
|
|
215
|
+
updatedData: t.data,
|
|
216
|
+
editType: G.addFeature,
|
|
217
|
+
editContext: {}
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
222
|
+
id: Ce,
|
|
223
|
+
pickable: !1,
|
|
224
|
+
billboard: !1,
|
|
225
|
+
editHandlePointRadiusUnits: "pixels",
|
|
226
|
+
editHandlePointRadiusMinPixels: 1,
|
|
227
|
+
editHandlePointRadiusMaxPixels: 12,
|
|
228
|
+
lineWidthMinPixels: 2,
|
|
229
|
+
editHandlePointStrokeWidth: 3,
|
|
230
|
+
getEditHandlePointRadius: 3,
|
|
231
|
+
_subLayerProps: {
|
|
232
|
+
guides: {
|
|
233
|
+
getLineWidth: 2
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}, je = {
|
|
237
|
+
editing: {
|
|
238
|
+
border: [3, 111, 226, 255],
|
|
239
|
+
fill: [3, 111, 226, 20.4],
|
|
240
|
+
point: [255, 255, 255, 255]
|
|
241
|
+
},
|
|
242
|
+
finished: {
|
|
243
|
+
border: [71, 219, 153, 255],
|
|
244
|
+
fill: [71, 219, 153, 0]
|
|
245
|
+
}
|
|
246
|
+
}, Re = {
|
|
247
|
+
styles: {
|
|
248
|
+
colors: {
|
|
249
|
+
editing: je.editing,
|
|
250
|
+
finished: je.finished
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
labels: {
|
|
254
|
+
mask: "Geometry"
|
|
255
|
+
}
|
|
256
|
+
}, Le = {
|
|
257
|
+
id: fn,
|
|
258
|
+
stroked: !0,
|
|
259
|
+
filled: !0,
|
|
260
|
+
lineWidthUnits: "pixels",
|
|
261
|
+
getLineWidth: 2,
|
|
262
|
+
lineWidthMinPixels: 2
|
|
263
|
+
}, ze = {
|
|
264
|
+
polygon: {
|
|
265
|
+
value: "polygon",
|
|
266
|
+
mode: Bt
|
|
49
267
|
},
|
|
50
|
-
|
|
51
|
-
|
|
268
|
+
rectangle: {
|
|
269
|
+
value: "rectangle",
|
|
270
|
+
mode: Ht
|
|
52
271
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
272
|
+
circle: {
|
|
273
|
+
value: "circle",
|
|
274
|
+
mode: at
|
|
275
|
+
},
|
|
276
|
+
lasso: {
|
|
277
|
+
value: "lasso",
|
|
278
|
+
mode: jt
|
|
279
|
+
},
|
|
280
|
+
edit: {
|
|
281
|
+
value: "edit",
|
|
282
|
+
mode: dn
|
|
60
283
|
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const { id: o, viewState: l } = a, f = { ...t.maps };
|
|
71
|
-
return f[o] = {
|
|
72
|
-
...t.maps[o],
|
|
73
|
-
viewState: l
|
|
74
|
-
}, {
|
|
75
|
-
...t,
|
|
76
|
-
maps: f
|
|
284
|
+
}, Be = ct((n) => ({
|
|
285
|
+
layers: {},
|
|
286
|
+
setLayer: (e, t) => n((s) => {
|
|
287
|
+
const i = {
|
|
288
|
+
...s.layers
|
|
289
|
+
};
|
|
290
|
+
if (!t)
|
|
291
|
+
return delete i[e], {
|
|
292
|
+
layers: i
|
|
77
293
|
};
|
|
294
|
+
const r = i[e] ?? {
|
|
295
|
+
type: null,
|
|
296
|
+
props: {}
|
|
297
|
+
}, o = r.props ?? {}, a = t.props ?? {};
|
|
298
|
+
return i[e] = {
|
|
299
|
+
...r,
|
|
300
|
+
...t,
|
|
301
|
+
props: {
|
|
302
|
+
id: e,
|
|
303
|
+
...o,
|
|
304
|
+
...a
|
|
305
|
+
}
|
|
306
|
+
}, {
|
|
307
|
+
layers: i
|
|
308
|
+
};
|
|
309
|
+
})
|
|
310
|
+
})), pn = {
|
|
311
|
+
transitionDuration: "auto",
|
|
312
|
+
transitionInterpolator: new Zt({
|
|
313
|
+
curve: 2
|
|
314
|
+
})
|
|
315
|
+
}, hn = (n) => {
|
|
316
|
+
const e = n.reduce((t, s) => {
|
|
317
|
+
const {
|
|
318
|
+
id: i,
|
|
319
|
+
basemap: r
|
|
320
|
+
} = s;
|
|
321
|
+
return t[i] = {
|
|
322
|
+
isLoaded: !1,
|
|
323
|
+
areLayersLoaded: !1,
|
|
324
|
+
basemap: r,
|
|
325
|
+
instanceRef: {
|
|
326
|
+
current: {}
|
|
327
|
+
},
|
|
328
|
+
overlayRef: {
|
|
329
|
+
current: null
|
|
330
|
+
},
|
|
331
|
+
layers: s.layers ?? []
|
|
332
|
+
}, t;
|
|
333
|
+
}, {});
|
|
334
|
+
return (t, s) => ({
|
|
335
|
+
maps: e,
|
|
336
|
+
setBasemap: (i, r) => t((o) => ({
|
|
337
|
+
maps: {
|
|
338
|
+
...o.maps,
|
|
339
|
+
[i]: {
|
|
340
|
+
...o.maps[i],
|
|
341
|
+
basemap: r
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
})),
|
|
345
|
+
setLoad: (i, r) => t((o) => ({
|
|
346
|
+
maps: {
|
|
347
|
+
...o.maps,
|
|
348
|
+
[i]: {
|
|
349
|
+
...o.maps[i],
|
|
350
|
+
isLoaded: r
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
})),
|
|
354
|
+
setLayersLoad: (i, r) => t((o) => ({
|
|
355
|
+
maps: {
|
|
356
|
+
...o.maps,
|
|
357
|
+
[i]: {
|
|
358
|
+
...o.maps[i],
|
|
359
|
+
areLayersLoaded: r
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
})),
|
|
363
|
+
getOverlayInstance: (i) => {
|
|
364
|
+
var o, a;
|
|
365
|
+
return (a = (o = s().maps[i]) == null ? void 0 : o.overlayRef) == null ? void 0 : a.current;
|
|
78
366
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return
|
|
82
|
-
...t.maps[o],
|
|
83
|
-
width: l,
|
|
84
|
-
height: f
|
|
85
|
-
}, {
|
|
86
|
-
...t,
|
|
87
|
-
maps: y
|
|
88
|
-
};
|
|
367
|
+
getDeckInstance: (i) => {
|
|
368
|
+
var o, a, l;
|
|
369
|
+
return (l = (a = (o = s().maps[i]) == null ? void 0 : o.instanceRef) == null ? void 0 : a.current) == null ? void 0 : l.deck;
|
|
89
370
|
},
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
...t.maps[o],
|
|
94
|
-
basemap: l,
|
|
95
|
-
isLoaded: E
|
|
96
|
-
}, {
|
|
97
|
-
...t,
|
|
98
|
-
maps: f
|
|
99
|
-
};
|
|
371
|
+
getViewState: (i) => {
|
|
372
|
+
const o = s().getDeckInstance(i);
|
|
373
|
+
return o == null ? void 0 : o.viewState;
|
|
100
374
|
},
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
375
|
+
getViewports: (i, r) => {
|
|
376
|
+
const a = s().getDeckInstance(i);
|
|
377
|
+
return a == null ? void 0 : a.getViewports(r);
|
|
378
|
+
},
|
|
379
|
+
getViewport: (i, r = 0, o) => {
|
|
380
|
+
var u;
|
|
381
|
+
const l = s().getDeckInstance(i);
|
|
382
|
+
return (u = l == null ? void 0 : l.getViewports(o)) == null ? void 0 : u[r];
|
|
383
|
+
},
|
|
384
|
+
addLayers: (i, r) => t((o) => {
|
|
385
|
+
var d;
|
|
386
|
+
const a = {
|
|
387
|
+
...o.maps
|
|
388
|
+
}, l = ((d = a[i]) == null ? void 0 : d.layers) ?? [], u = /* @__PURE__ */ new Set([...l, ...r]);
|
|
389
|
+
return a[i] = {
|
|
390
|
+
...a[i],
|
|
391
|
+
layers: [...u]
|
|
109
392
|
}, {
|
|
110
|
-
|
|
111
|
-
maps: f
|
|
393
|
+
maps: a
|
|
112
394
|
};
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
...
|
|
118
|
-
|
|
395
|
+
}),
|
|
396
|
+
removeLayers: (i, r) => t((o) => {
|
|
397
|
+
var u;
|
|
398
|
+
const a = {
|
|
399
|
+
...o.maps
|
|
400
|
+
}, l = ((u = a[i]) == null ? void 0 : u.layers) ?? [];
|
|
401
|
+
return a[i] = {
|
|
402
|
+
...a[i],
|
|
403
|
+
layers: l.filter((d) => !r.includes(d))
|
|
119
404
|
}, {
|
|
120
|
-
|
|
121
|
-
maps: f
|
|
405
|
+
maps: a
|
|
122
406
|
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
407
|
+
})
|
|
408
|
+
});
|
|
409
|
+
}, yn = (n) => {
|
|
410
|
+
const e = n.reduce((t, s) => (t[s.id] = s.viewState, t), {});
|
|
411
|
+
return (t) => ({
|
|
412
|
+
viewStates: e,
|
|
413
|
+
setViewState: (s, i) => t((r) => ({
|
|
414
|
+
viewStates: {
|
|
415
|
+
...r.viewStates,
|
|
416
|
+
[s]: {
|
|
417
|
+
...r.viewStates[s],
|
|
418
|
+
...i
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
})),
|
|
422
|
+
setZoom: (s, i) => t((r) => ({
|
|
423
|
+
viewStates: {
|
|
424
|
+
...r.viewStates,
|
|
425
|
+
[s]: {
|
|
426
|
+
...r.viewStates[s],
|
|
427
|
+
zoom: i
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
})),
|
|
431
|
+
setMinZoom: (s, i) => t((r) => ({
|
|
432
|
+
viewStates: {
|
|
433
|
+
...r.viewStates,
|
|
434
|
+
[s]: {
|
|
435
|
+
...r.viewStates[s],
|
|
436
|
+
minZoom: i
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
})),
|
|
440
|
+
setMaxZoom: (s, i) => t((r) => ({
|
|
441
|
+
viewStates: {
|
|
442
|
+
...r.viewStates,
|
|
443
|
+
[s]: {
|
|
444
|
+
...r.viewStates[s],
|
|
445
|
+
maxZoom: i
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}))
|
|
449
|
+
});
|
|
450
|
+
}, gn = (n, e) => ({
|
|
451
|
+
fitBounds: (t, s, i) => {
|
|
452
|
+
const r = e(), o = r.getViewport(t);
|
|
453
|
+
if (!o) return;
|
|
454
|
+
const l = {
|
|
455
|
+
...o == null ? void 0 : o.fitBounds(s, i == null ? void 0 : i.boundsOptions),
|
|
456
|
+
...i == null ? void 0 : i.viewStateOptions
|
|
457
|
+
};
|
|
458
|
+
r.setViewState(t, l);
|
|
459
|
+
},
|
|
460
|
+
flyTo: (t, s, i = {}) => {
|
|
461
|
+
const r = e();
|
|
462
|
+
if (!r.getViewport(t)) return;
|
|
463
|
+
const a = {
|
|
464
|
+
...pn,
|
|
465
|
+
...i == null ? void 0 : i.viewStateOptions
|
|
466
|
+
}, l = {
|
|
467
|
+
...s,
|
|
468
|
+
...a
|
|
469
|
+
};
|
|
470
|
+
r.setViewState(t, l);
|
|
471
|
+
}
|
|
472
|
+
}), Sn = (n) => qe()((...e) => ({
|
|
473
|
+
...hn(n)(...e),
|
|
474
|
+
...yn(n)(...e),
|
|
475
|
+
...gn(...e)
|
|
476
|
+
})), ft = Ne({});
|
|
477
|
+
function Ks(n) {
|
|
478
|
+
const e = ee(5), {
|
|
479
|
+
children: t,
|
|
480
|
+
values: s
|
|
481
|
+
} = n;
|
|
482
|
+
let i;
|
|
483
|
+
e[0] !== s ? (i = Sn(s), e[0] = s, e[1] = i) : i = e[1];
|
|
484
|
+
const [r] = pe(i);
|
|
485
|
+
let o;
|
|
486
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(ft.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
149
487
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
488
|
+
function k(n) {
|
|
489
|
+
const e = $e(ft);
|
|
490
|
+
if (!e)
|
|
491
|
+
throw new Error("Missing Map.Provider in the tree");
|
|
492
|
+
return Ge(e, n);
|
|
493
|
+
}
|
|
494
|
+
function vn(n) {
|
|
495
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
496
|
+
}
|
|
497
|
+
var Mn = function(e) {
|
|
498
|
+
return En(e) && !Ln(e);
|
|
499
|
+
};
|
|
500
|
+
function En(n) {
|
|
501
|
+
return !!n && typeof n == "object";
|
|
502
|
+
}
|
|
503
|
+
function Ln(n) {
|
|
504
|
+
var e = Object.prototype.toString.call(n);
|
|
505
|
+
return e === "[object RegExp]" || e === "[object Date]" || _n(n);
|
|
506
|
+
}
|
|
507
|
+
var bn = typeof Symbol == "function" && Symbol.for, wn = bn ? Symbol.for("react.element") : 60103;
|
|
508
|
+
function _n(n) {
|
|
509
|
+
return n.$$typeof === wn;
|
|
510
|
+
}
|
|
511
|
+
function Pn(n) {
|
|
512
|
+
return Array.isArray(n) ? [] : {};
|
|
513
|
+
}
|
|
514
|
+
function Ee(n, e) {
|
|
515
|
+
return e.clone !== !1 && e.isMergeableObject(n) ? ge(Pn(n), n, e) : n;
|
|
516
|
+
}
|
|
517
|
+
function Cn(n, e, t) {
|
|
518
|
+
return n.concat(e).map(function(s) {
|
|
519
|
+
return Ee(s, t);
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
function Tn(n, e) {
|
|
523
|
+
if (!e.customMerge)
|
|
524
|
+
return ge;
|
|
525
|
+
var t = e.customMerge(n);
|
|
526
|
+
return typeof t == "function" ? t : ge;
|
|
527
|
+
}
|
|
528
|
+
function kn(n) {
|
|
529
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(n).filter(function(e) {
|
|
530
|
+
return Object.propertyIsEnumerable.call(n, e);
|
|
531
|
+
}) : [];
|
|
532
|
+
}
|
|
533
|
+
function Ie(n) {
|
|
534
|
+
return Object.keys(n).concat(kn(n));
|
|
535
|
+
}
|
|
536
|
+
function mt(n, e) {
|
|
537
|
+
try {
|
|
538
|
+
return e in n;
|
|
539
|
+
} catch {
|
|
540
|
+
return !1;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function Fn(n, e) {
|
|
544
|
+
return mt(n, e) && !(Object.hasOwnProperty.call(n, e) && Object.propertyIsEnumerable.call(n, e));
|
|
545
|
+
}
|
|
546
|
+
function An(n, e, t) {
|
|
547
|
+
var s = {};
|
|
548
|
+
return t.isMergeableObject(n) && Ie(n).forEach(function(i) {
|
|
549
|
+
s[i] = Ee(n[i], t);
|
|
550
|
+
}), Ie(e).forEach(function(i) {
|
|
551
|
+
Fn(n, i) || (mt(n, i) && t.isMergeableObject(e[i]) ? s[i] = Tn(i, t)(n[i], e[i], t) : s[i] = Ee(e[i], t));
|
|
552
|
+
}), s;
|
|
553
|
+
}
|
|
554
|
+
function ge(n, e, t) {
|
|
555
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || Cn, t.isMergeableObject = t.isMergeableObject || Mn, t.cloneUnlessOtherwiseSpecified = Ee;
|
|
556
|
+
var s = Array.isArray(e), i = Array.isArray(n), r = s === i;
|
|
557
|
+
return r ? s ? t.arrayMerge(n, e, t) : An(n, e, t) : Ee(e, t);
|
|
558
|
+
}
|
|
559
|
+
ge.all = function(e, t) {
|
|
560
|
+
if (!Array.isArray(e))
|
|
561
|
+
throw new Error("first argument should be an array");
|
|
562
|
+
return e.reduce(function(s, i) {
|
|
563
|
+
return ge(s, i, t);
|
|
564
|
+
}, {});
|
|
565
|
+
};
|
|
566
|
+
var On = ge, Rn = On;
|
|
567
|
+
const ye = /* @__PURE__ */ vn(Rn);
|
|
568
|
+
function Dn({
|
|
569
|
+
mode: n,
|
|
570
|
+
...e
|
|
571
|
+
}) {
|
|
572
|
+
const t = Un(e);
|
|
152
573
|
return {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
setLoaded: (c) => l(c, t),
|
|
158
|
-
fitBounds: (c, {
|
|
159
|
-
boundsOptions: m,
|
|
160
|
-
viewStateOptions: E
|
|
161
|
-
} = {}) => {
|
|
162
|
-
const _ = f(), { latitude: b, longitude: v, zoom: h } = _.fitBounds(
|
|
163
|
-
c,
|
|
164
|
-
m
|
|
165
|
-
);
|
|
166
|
-
s({ ...E, latitude: b, longitude: v, zoom: h }, t);
|
|
574
|
+
type: lt,
|
|
575
|
+
props: {
|
|
576
|
+
...t,
|
|
577
|
+
mode: n
|
|
167
578
|
}
|
|
168
579
|
};
|
|
169
580
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
function U(e) {
|
|
225
|
-
if (e === null || typeof e != "object")
|
|
226
|
-
return null;
|
|
227
|
-
var n = h && e[h] || e[A];
|
|
228
|
-
return typeof n == "function" ? n : null;
|
|
229
|
-
}
|
|
230
|
-
var j = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
231
|
-
function P(e) {
|
|
232
|
-
{
|
|
233
|
-
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
|
|
234
|
-
i[u - 1] = arguments[u];
|
|
235
|
-
le("error", e, i);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function le(e, n, i) {
|
|
239
|
-
{
|
|
240
|
-
var u = j.ReactDebugCurrentFrame, g = u.getStackAddendum();
|
|
241
|
-
g !== "" && (n += "%s", i = i.concat([g]));
|
|
242
|
-
var S = i.map(function(p) {
|
|
243
|
-
return String(p);
|
|
244
|
-
});
|
|
245
|
-
S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
var W = !1, re = !1, St = !1, _t = !1, Rt = !1, Me;
|
|
249
|
-
Me = Symbol.for("react.module.reference");
|
|
250
|
-
function Tt(e) {
|
|
251
|
-
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || Rt || e === o || e === m || e === E || _t || e === v || W || re || St || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === _ || e.$$typeof === f || e.$$typeof === y || e.$$typeof === c || // This needs to include all possible module reference object
|
|
252
|
-
// types supported by any Flight configuration anywhere since
|
|
253
|
-
// we don't know which Flight build this will end up being used
|
|
254
|
-
// with.
|
|
255
|
-
e.$$typeof === Me || e.getModuleId !== void 0));
|
|
256
|
-
}
|
|
257
|
-
function Pt(e, n, i) {
|
|
258
|
-
var u = e.displayName;
|
|
259
|
-
if (u)
|
|
260
|
-
return u;
|
|
261
|
-
var g = n.displayName || n.name || "";
|
|
262
|
-
return g !== "" ? i + "(" + g + ")" : i;
|
|
263
|
-
}
|
|
264
|
-
function Ce(e) {
|
|
265
|
-
return e.displayName || "Context";
|
|
266
|
-
}
|
|
267
|
-
function D(e) {
|
|
268
|
-
if (e == null)
|
|
269
|
-
return null;
|
|
270
|
-
if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
271
|
-
return e.displayName || e.name || null;
|
|
272
|
-
if (typeof e == "string")
|
|
273
|
-
return e;
|
|
274
|
-
switch (e) {
|
|
275
|
-
case s:
|
|
276
|
-
return "Fragment";
|
|
277
|
-
case a:
|
|
278
|
-
return "Portal";
|
|
279
|
-
case l:
|
|
280
|
-
return "Profiler";
|
|
281
|
-
case o:
|
|
282
|
-
return "StrictMode";
|
|
283
|
-
case m:
|
|
284
|
-
return "Suspense";
|
|
285
|
-
case E:
|
|
286
|
-
return "SuspenseList";
|
|
581
|
+
function Un({
|
|
582
|
+
layerProps: n,
|
|
583
|
+
onEdit: e,
|
|
584
|
+
guideColor: t,
|
|
585
|
+
fillColor: s,
|
|
586
|
+
pointColor: i
|
|
587
|
+
}) {
|
|
588
|
+
const r = ye(n, {
|
|
589
|
+
modeConfig: {
|
|
590
|
+
// // We force distance due to conversion is addressed at feature getText level
|
|
591
|
+
// formatTooltip: (_distance: number) => {
|
|
592
|
+
// return _distance
|
|
593
|
+
// },
|
|
594
|
+
preventOverlappingLines: !0
|
|
595
|
+
},
|
|
596
|
+
onEdit: e
|
|
597
|
+
}), o = ye(mn, {
|
|
598
|
+
getTentativeLineColor: t,
|
|
599
|
+
getTentativeFillColor: s,
|
|
600
|
+
getLineColor: t,
|
|
601
|
+
getFillColor: s,
|
|
602
|
+
getEditHandlePointColor: i,
|
|
603
|
+
getEditHandlePointOutlineColor: t,
|
|
604
|
+
dataComparator: (l, u) => l.features[0] === u.features[0]
|
|
605
|
+
});
|
|
606
|
+
return ye(o, r);
|
|
607
|
+
}
|
|
608
|
+
const xn = (n) => qe()((e) => ({
|
|
609
|
+
data: n.reduce((s, i) => {
|
|
610
|
+
const {
|
|
611
|
+
enabled: r = !1,
|
|
612
|
+
mapId: o,
|
|
613
|
+
modeInstance: a,
|
|
614
|
+
modes: l = ze,
|
|
615
|
+
modeSelected: u = ze.polygon.value,
|
|
616
|
+
values: d = {}
|
|
617
|
+
} = i;
|
|
618
|
+
return s[o] = {
|
|
619
|
+
enabled: r,
|
|
620
|
+
modeInstance: a,
|
|
621
|
+
modes: l,
|
|
622
|
+
modeSelected: u,
|
|
623
|
+
values: d
|
|
624
|
+
}, s;
|
|
625
|
+
}, {}),
|
|
626
|
+
setEnabled: (s, i) => {
|
|
627
|
+
e((r) => ({
|
|
628
|
+
data: {
|
|
629
|
+
...r.data,
|
|
630
|
+
[s]: {
|
|
631
|
+
...r.data[s],
|
|
632
|
+
enabled: i,
|
|
633
|
+
visible: i
|
|
634
|
+
}
|
|
287
635
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
636
|
+
}));
|
|
637
|
+
},
|
|
638
|
+
setValue: (s, i, r) => {
|
|
639
|
+
e((o) => {
|
|
640
|
+
const a = {
|
|
641
|
+
...o.data[s].values
|
|
642
|
+
}, l = a[i] ?? {
|
|
643
|
+
type: "mask"
|
|
644
|
+
};
|
|
645
|
+
return a[i] = {
|
|
646
|
+
...l,
|
|
647
|
+
...r,
|
|
648
|
+
id: i
|
|
649
|
+
}, r || delete a[i], {
|
|
650
|
+
data: {
|
|
651
|
+
...o.data,
|
|
652
|
+
[s]: {
|
|
653
|
+
...o.data[s],
|
|
654
|
+
values: a
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
});
|
|
659
|
+
},
|
|
660
|
+
setVisibility: (s, i, r) => {
|
|
661
|
+
e((o) => {
|
|
662
|
+
const a = {
|
|
663
|
+
...o.data[s].values
|
|
664
|
+
}, l = a[i] ?? {};
|
|
665
|
+
return l.visible = r, {
|
|
666
|
+
data: {
|
|
667
|
+
...o.data,
|
|
668
|
+
[s]: {
|
|
669
|
+
...o.data[s],
|
|
670
|
+
values: {
|
|
671
|
+
...a,
|
|
672
|
+
[i]: l
|
|
307
673
|
}
|
|
308
674
|
}
|
|
309
675
|
}
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
var e = {
|
|
321
|
-
configurable: !0,
|
|
322
|
-
enumerable: !0,
|
|
323
|
-
value: Le,
|
|
324
|
-
writable: !0
|
|
325
|
-
};
|
|
326
|
-
Object.defineProperties(console, {
|
|
327
|
-
info: e,
|
|
328
|
-
log: e,
|
|
329
|
-
warn: e,
|
|
330
|
-
error: e,
|
|
331
|
-
group: e,
|
|
332
|
-
groupCollapsed: e,
|
|
333
|
-
groupEnd: e
|
|
334
|
-
});
|
|
676
|
+
};
|
|
677
|
+
});
|
|
678
|
+
},
|
|
679
|
+
setModeSelected: (s, i) => {
|
|
680
|
+
e((r) => ({
|
|
681
|
+
data: {
|
|
682
|
+
...r.data,
|
|
683
|
+
[s]: {
|
|
684
|
+
...r.data[s],
|
|
685
|
+
modeSelected: i
|
|
335
686
|
}
|
|
336
|
-
H++;
|
|
337
687
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
Object.defineProperties(console, {
|
|
348
|
-
log: L({}, e, {
|
|
349
|
-
value: we
|
|
350
|
-
}),
|
|
351
|
-
info: L({}, e, {
|
|
352
|
-
value: je
|
|
353
|
-
}),
|
|
354
|
-
warn: L({}, e, {
|
|
355
|
-
value: xe
|
|
356
|
-
}),
|
|
357
|
-
error: L({}, e, {
|
|
358
|
-
value: Ae
|
|
359
|
-
}),
|
|
360
|
-
group: L({}, e, {
|
|
361
|
-
value: De
|
|
362
|
-
}),
|
|
363
|
-
groupCollapsed: L({}, e, {
|
|
364
|
-
value: ke
|
|
365
|
-
}),
|
|
366
|
-
groupEnd: L({}, e, {
|
|
367
|
-
value: Fe
|
|
368
|
-
})
|
|
369
|
-
});
|
|
688
|
+
}));
|
|
689
|
+
},
|
|
690
|
+
setModeInstance: (s, i) => {
|
|
691
|
+
e((r) => ({
|
|
692
|
+
data: {
|
|
693
|
+
...r.data,
|
|
694
|
+
[s]: {
|
|
695
|
+
...r.data[s],
|
|
696
|
+
modeInstance: i
|
|
370
697
|
}
|
|
371
|
-
H < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
372
698
|
}
|
|
699
|
+
}));
|
|
700
|
+
}
|
|
701
|
+
})), pt = Ne({});
|
|
702
|
+
function Ys(n) {
|
|
703
|
+
const e = ee(5), {
|
|
704
|
+
children: t,
|
|
705
|
+
values: s
|
|
706
|
+
} = n;
|
|
707
|
+
let i;
|
|
708
|
+
e[0] !== s ? (i = () => xn(s), e[0] = s, e[1] = i) : i = e[1];
|
|
709
|
+
const [r] = pe(i);
|
|
710
|
+
let o;
|
|
711
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(pt.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
712
|
+
}
|
|
713
|
+
function O(n) {
|
|
714
|
+
const e = $e(pt);
|
|
715
|
+
if (!e)
|
|
716
|
+
throw new Error("Missing Map.Provider in the tree");
|
|
717
|
+
return Ge(e, n);
|
|
718
|
+
}
|
|
719
|
+
function Vn({
|
|
720
|
+
mapId: n,
|
|
721
|
+
children: e
|
|
722
|
+
}) {
|
|
723
|
+
const t = O((c) => {
|
|
724
|
+
var m;
|
|
725
|
+
return (m = c.data[n]) == null ? void 0 : m.enabled;
|
|
726
|
+
}), s = O((c) => c.setEnabled), i = O((c) => {
|
|
727
|
+
var m;
|
|
728
|
+
return (m = c.data[n]) == null ? void 0 : m.values;
|
|
729
|
+
}), r = O((c) => c.setValue), o = O((c) => c.setVisibility), a = O((c) => {
|
|
730
|
+
var m;
|
|
731
|
+
return (m = c.data[n]) == null ? void 0 : m.modeSelected;
|
|
732
|
+
}), l = O((c) => c.setModeSelected), u = O((c) => {
|
|
733
|
+
var m;
|
|
734
|
+
return (m = c.data[n]) == null ? void 0 : m.modes;
|
|
735
|
+
}), d = O((c) => c.setModeInstance);
|
|
736
|
+
ce(() => {
|
|
737
|
+
const c = u[a];
|
|
738
|
+
if (c) {
|
|
739
|
+
const m = c.mode, h = new m();
|
|
740
|
+
d(n, h);
|
|
373
741
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
742
|
+
}, [n, a, u, d]);
|
|
743
|
+
const [
|
|
744
|
+
p
|
|
745
|
+
// , draw
|
|
746
|
+
] = Me(() => {
|
|
747
|
+
const c = (f) => {
|
|
748
|
+
var S;
|
|
749
|
+
return {
|
|
750
|
+
id: f.id,
|
|
751
|
+
visible: f.visible,
|
|
752
|
+
label: (S = f.properties) == null ? void 0 : S.label
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
return [
|
|
756
|
+
Object.values(i).filter((f) => f.type === "mask").map(c)
|
|
757
|
+
// , draw
|
|
758
|
+
];
|
|
759
|
+
}, [i]), y = q((c) => {
|
|
760
|
+
s(n, !!c), l(n, c);
|
|
761
|
+
}, [n, s, l]);
|
|
762
|
+
return e({
|
|
763
|
+
mapId: n,
|
|
764
|
+
enabled: t,
|
|
765
|
+
modes: u,
|
|
766
|
+
modeSelected: a,
|
|
767
|
+
values: {
|
|
768
|
+
mask: p
|
|
769
|
+
// draw,
|
|
770
|
+
},
|
|
771
|
+
setValue: q((c) => r(n, c), [n, r]),
|
|
772
|
+
setEnabled: q((c) => s(n, c), [n, s]),
|
|
773
|
+
setVisibility: q((c, m) => o(n, c, m), [n, o]),
|
|
774
|
+
setModeSelected: y
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
const Nn = [new Yt({
|
|
778
|
+
filterSize: 1
|
|
779
|
+
})];
|
|
780
|
+
function $n({
|
|
781
|
+
children: n,
|
|
782
|
+
mapId: e,
|
|
783
|
+
defaultProps: {
|
|
784
|
+
styles: t = Re.styles,
|
|
785
|
+
labels: s
|
|
786
|
+
} = {
|
|
787
|
+
styles: Re.styles,
|
|
788
|
+
labels: Re.labels
|
|
789
|
+
},
|
|
790
|
+
layerProps: i = {},
|
|
791
|
+
defaultType: r = "mask"
|
|
792
|
+
}) {
|
|
793
|
+
const o = O((g) => {
|
|
794
|
+
var L;
|
|
795
|
+
return (L = g.data[e]) == null ? void 0 : L.enabled;
|
|
796
|
+
}), a = O((g) => g.setEnabled), l = O((g) => {
|
|
797
|
+
var L;
|
|
798
|
+
return (L = g.data[e]) == null ? void 0 : L.values;
|
|
799
|
+
}), u = O((g) => g.setValue), d = O((g) => {
|
|
800
|
+
var L;
|
|
801
|
+
return (L = g.data[e]) == null ? void 0 : L.modeInstance;
|
|
802
|
+
}), p = O((g) => {
|
|
803
|
+
var L;
|
|
804
|
+
return (L = g.data[e]) == null ? void 0 : L.modeSelected;
|
|
805
|
+
}), y = Be((g) => g.setLayer), c = k((g) => g.addLayers), m = k((g) => g.removeLayers), [h, f] = pe(() => be()), S = Me(() => Object.values(l ?? {}).filter((g) => g.type === "mask"), [l]), v = Ft(S.length);
|
|
806
|
+
ce(() => (o && c(e, [Ce]), () => {
|
|
807
|
+
f(be()), m(e, [Ce]);
|
|
808
|
+
}), [c, o, e, m]);
|
|
809
|
+
const E = q(() => {
|
|
810
|
+
f(be()), a(e, !1);
|
|
811
|
+
}, [e, a]), b = q(({
|
|
812
|
+
editType: g,
|
|
813
|
+
updatedData: L
|
|
814
|
+
}) => {
|
|
815
|
+
var w;
|
|
816
|
+
if (g === G.cancel) {
|
|
817
|
+
E();
|
|
818
|
+
return;
|
|
387
819
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
820
|
+
if (f(L), g !== G.updateTentativeFeature && g === G.addFeature) {
|
|
821
|
+
const F = L.features[0];
|
|
822
|
+
(w = F.properties).label ?? (w.label = `${s == null ? void 0 : s.mask} ${v.current + 1}`), v.current += 1;
|
|
823
|
+
const A = F.id ?? crypto.randomUUID();
|
|
824
|
+
u(e, A, {
|
|
825
|
+
geometry: F.geometry,
|
|
826
|
+
properties: F.properties,
|
|
827
|
+
visible: !0,
|
|
828
|
+
type: r
|
|
829
|
+
}), E();
|
|
392
830
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
831
|
+
}, [E, s == null ? void 0 : s.mask, u, e, r]);
|
|
832
|
+
ce(() => {
|
|
833
|
+
const g = h.features.length > 0, {
|
|
834
|
+
border: L,
|
|
835
|
+
point: w,
|
|
836
|
+
fill: F
|
|
837
|
+
} = t.colors.editing, A = Dn({
|
|
838
|
+
layerProps: {
|
|
839
|
+
...i.mask,
|
|
840
|
+
pickable: !0,
|
|
841
|
+
data: h,
|
|
842
|
+
selectedFeatureIndexes: g ? [0] : []
|
|
843
|
+
},
|
|
844
|
+
guideColor: L,
|
|
845
|
+
fillColor: F,
|
|
846
|
+
pointColor: w,
|
|
847
|
+
onEdit: b,
|
|
848
|
+
mode: d
|
|
849
|
+
});
|
|
850
|
+
y(Ce, A);
|
|
851
|
+
}, [h, i.mask, d, b, y, t.colors.editing]);
|
|
852
|
+
const _ = Me(() => ({
|
|
853
|
+
type: "FeatureCollection",
|
|
854
|
+
features: S.map((g) => ({
|
|
855
|
+
type: "Feature",
|
|
856
|
+
geometry: g.geometry,
|
|
857
|
+
properties: g.properties,
|
|
858
|
+
id: g.id
|
|
859
|
+
}))
|
|
860
|
+
}), [S]), P = Me(() => {
|
|
861
|
+
const g = S.filter((w) => w.visible).map((w) => w.id), L = h.features.map((w) => w.id);
|
|
862
|
+
return L.length ? g.filter((w) => !L.includes(w)) : g;
|
|
863
|
+
}, [h.features, S]);
|
|
864
|
+
return ce(() => {
|
|
865
|
+
const g = {
|
|
866
|
+
...Le,
|
|
867
|
+
pickable: o && p === "edit",
|
|
868
|
+
visible: !0,
|
|
869
|
+
data: _,
|
|
870
|
+
getLineColor: t.colors.finished.border,
|
|
871
|
+
getFillColor: t.colors.finished.fill,
|
|
872
|
+
extensions: Nn,
|
|
873
|
+
getFilterValue: (L) => Number(P.includes(L.id)),
|
|
874
|
+
filterRange: [1, 1],
|
|
875
|
+
updateTriggers: {
|
|
876
|
+
getFilterValue: P
|
|
877
|
+
},
|
|
878
|
+
onClick: ({
|
|
879
|
+
object: L
|
|
880
|
+
}) => {
|
|
881
|
+
const w = be();
|
|
882
|
+
w.features.push(L), f(w), a(e, !0);
|
|
400
883
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
884
|
+
};
|
|
885
|
+
return y(Le.id, {
|
|
886
|
+
type: Kt,
|
|
887
|
+
props: g
|
|
888
|
+
}), c(e, [Le.id]), () => {
|
|
889
|
+
m(e, [Le.id]);
|
|
890
|
+
};
|
|
891
|
+
}, [c, o, e, _, P, p, m, a, y, t.colors.finished.border, t.colors.finished.fill]), n;
|
|
892
|
+
}
|
|
893
|
+
function be() {
|
|
894
|
+
return {
|
|
895
|
+
type: "FeatureCollection",
|
|
896
|
+
features: []
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
$n.Controls = Vn;
|
|
900
|
+
var We = 63710088e-1;
|
|
901
|
+
function xe(n, e, t = {}) {
|
|
902
|
+
const s = { type: "Feature" };
|
|
903
|
+
return (t.id === 0 || t.id) && (s.id = t.id), t.bbox && (s.bbox = t.bbox), s.properties = e || {}, s.geometry = n, s;
|
|
904
|
+
}
|
|
905
|
+
function ht(n, e, t = {}) {
|
|
906
|
+
if (!n)
|
|
907
|
+
throw new Error("coordinates is required");
|
|
908
|
+
if (!Array.isArray(n))
|
|
909
|
+
throw new Error("coordinates must be an Array");
|
|
910
|
+
if (n.length < 2)
|
|
911
|
+
throw new Error("coordinates must be at least 2 numbers long");
|
|
912
|
+
if (!Ke(n[0]) || !Ke(n[1]))
|
|
913
|
+
throw new Error("coordinates must contain numbers");
|
|
914
|
+
return xe({
|
|
915
|
+
type: "Point",
|
|
916
|
+
coordinates: n
|
|
917
|
+
}, e, t);
|
|
918
|
+
}
|
|
919
|
+
function Ze(n, e = {}) {
|
|
920
|
+
const t = { type: "FeatureCollection" };
|
|
921
|
+
return e.id && (t.id = e.id), e.bbox && (t.bbox = e.bbox), t.features = n, t;
|
|
922
|
+
}
|
|
923
|
+
function Ke(n) {
|
|
924
|
+
return !isNaN(n) && n !== null && !Array.isArray(n);
|
|
925
|
+
}
|
|
926
|
+
function yt(n, e, t) {
|
|
927
|
+
if (n !== null)
|
|
928
|
+
for (var s, i, r, o, a, l, u, d = 0, p = 0, y, c = n.type, m = c === "FeatureCollection", h = c === "Feature", f = m ? n.features.length : 1, S = 0; S < f; S++) {
|
|
929
|
+
u = m ? n.features[S].geometry : h ? n.geometry : n, y = u ? u.type === "GeometryCollection" : !1, a = y ? u.geometries.length : 1;
|
|
930
|
+
for (var v = 0; v < a; v++) {
|
|
931
|
+
var E = 0, b = 0;
|
|
932
|
+
if (o = y ? u.geometries[v] : u, o !== null) {
|
|
933
|
+
l = o.coordinates;
|
|
934
|
+
var _ = o.type;
|
|
935
|
+
switch (d = _ === "Polygon" || _ === "MultiPolygon" ? 1 : 0, _) {
|
|
936
|
+
case null:
|
|
937
|
+
break;
|
|
938
|
+
case "Point":
|
|
939
|
+
if (e(
|
|
940
|
+
l,
|
|
941
|
+
p,
|
|
942
|
+
S,
|
|
943
|
+
E,
|
|
944
|
+
b
|
|
945
|
+
) === !1)
|
|
946
|
+
return !1;
|
|
947
|
+
p++, E++;
|
|
948
|
+
break;
|
|
949
|
+
case "LineString":
|
|
950
|
+
case "MultiPoint":
|
|
951
|
+
for (s = 0; s < l.length; s++) {
|
|
952
|
+
if (e(
|
|
953
|
+
l[s],
|
|
954
|
+
p,
|
|
955
|
+
S,
|
|
956
|
+
E,
|
|
957
|
+
b
|
|
958
|
+
) === !1)
|
|
959
|
+
return !1;
|
|
960
|
+
p++, _ === "MultiPoint" && E++;
|
|
961
|
+
}
|
|
962
|
+
_ === "LineString" && E++;
|
|
963
|
+
break;
|
|
964
|
+
case "Polygon":
|
|
965
|
+
case "MultiLineString":
|
|
966
|
+
for (s = 0; s < l.length; s++) {
|
|
967
|
+
for (i = 0; i < l[s].length - d; i++) {
|
|
968
|
+
if (e(
|
|
969
|
+
l[s][i],
|
|
970
|
+
p,
|
|
971
|
+
S,
|
|
972
|
+
E,
|
|
973
|
+
b
|
|
974
|
+
) === !1)
|
|
975
|
+
return !1;
|
|
976
|
+
p++;
|
|
977
|
+
}
|
|
978
|
+
_ === "MultiLineString" && E++, _ === "Polygon" && b++;
|
|
979
|
+
}
|
|
980
|
+
_ === "Polygon" && E++;
|
|
981
|
+
break;
|
|
982
|
+
case "MultiPolygon":
|
|
983
|
+
for (s = 0; s < l.length; s++) {
|
|
984
|
+
for (b = 0, i = 0; i < l[s].length; i++) {
|
|
985
|
+
for (r = 0; r < l[s][i].length - d; r++) {
|
|
986
|
+
if (e(
|
|
987
|
+
l[s][i][r],
|
|
988
|
+
p,
|
|
989
|
+
S,
|
|
990
|
+
E,
|
|
991
|
+
b
|
|
992
|
+
) === !1)
|
|
993
|
+
return !1;
|
|
994
|
+
p++;
|
|
453
995
|
}
|
|
454
|
-
|
|
996
|
+
b++;
|
|
997
|
+
}
|
|
998
|
+
E++;
|
|
999
|
+
}
|
|
455
1000
|
break;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
function wt(e, n, i) {
|
|
465
|
-
return Ie(e, !1);
|
|
466
|
-
}
|
|
467
|
-
function jt(e) {
|
|
468
|
-
var n = e.prototype;
|
|
469
|
-
return !!(n && n.isReactComponent);
|
|
470
|
-
}
|
|
471
|
-
function oe(e, n, i) {
|
|
472
|
-
if (e == null)
|
|
473
|
-
return "";
|
|
474
|
-
if (typeof e == "function")
|
|
475
|
-
return Ie(e, jt(e));
|
|
476
|
-
if (typeof e == "string")
|
|
477
|
-
return ne(e);
|
|
478
|
-
switch (e) {
|
|
479
|
-
case m:
|
|
480
|
-
return ne("Suspense");
|
|
481
|
-
case E:
|
|
482
|
-
return ne("SuspenseList");
|
|
483
|
-
}
|
|
484
|
-
if (typeof e == "object")
|
|
485
|
-
switch (e.$$typeof) {
|
|
486
|
-
case c:
|
|
487
|
-
return wt(e.render);
|
|
488
|
-
case _:
|
|
489
|
-
return oe(e.type, n, i);
|
|
490
|
-
case b: {
|
|
491
|
-
var u = e, g = u._payload, S = u._init;
|
|
492
|
-
try {
|
|
493
|
-
return oe(S(g), n, i);
|
|
494
|
-
} catch {
|
|
495
|
-
}
|
|
1001
|
+
case "GeometryCollection":
|
|
1002
|
+
for (s = 0; s < o.geometries.length; s++)
|
|
1003
|
+
if (yt(o.geometries[s], e) === !1)
|
|
1004
|
+
return !1;
|
|
1005
|
+
break;
|
|
1006
|
+
default:
|
|
1007
|
+
throw new Error("Unknown Geometry Type");
|
|
496
1008
|
}
|
|
497
1009
|
}
|
|
498
|
-
return "";
|
|
499
|
-
}
|
|
500
|
-
var z = Object.prototype.hasOwnProperty, Ne = {}, Ue = j.ReactDebugCurrentFrame;
|
|
501
|
-
function ie(e) {
|
|
502
|
-
if (e) {
|
|
503
|
-
var n = e._owner, i = oe(e.type, e._source, n ? n.type : null);
|
|
504
|
-
Ue.setExtraStackFrame(i);
|
|
505
|
-
} else
|
|
506
|
-
Ue.setExtraStackFrame(null);
|
|
507
|
-
}
|
|
508
|
-
function xt(e, n, i, u, g) {
|
|
509
|
-
{
|
|
510
|
-
var S = Function.call.bind(z);
|
|
511
|
-
for (var p in e)
|
|
512
|
-
if (S(e, p)) {
|
|
513
|
-
var d = void 0;
|
|
514
|
-
try {
|
|
515
|
-
if (typeof e[p] != "function") {
|
|
516
|
-
var M = Error((u || "React class") + ": " + i + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
517
|
-
throw M.name = "Invariant Violation", M;
|
|
518
|
-
}
|
|
519
|
-
d = e[p](n, p, u, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
520
|
-
} catch (R) {
|
|
521
|
-
d = R;
|
|
522
|
-
}
|
|
523
|
-
d && !(d instanceof Error) && (ie(g), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", i, p, typeof d), ie(null)), d instanceof Error && !(d.message in Ne) && (Ne[d.message] = !0, ie(g), P("Failed %s type: %s", i, d.message), ie(null));
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
var At = Array.isArray;
|
|
528
|
-
function me(e) {
|
|
529
|
-
return At(e);
|
|
530
|
-
}
|
|
531
|
-
function Dt(e) {
|
|
532
|
-
{
|
|
533
|
-
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
534
|
-
return i;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
function kt(e) {
|
|
538
|
-
try {
|
|
539
|
-
return Ve(e), !1;
|
|
540
|
-
} catch {
|
|
541
|
-
return !0;
|
|
542
1010
|
}
|
|
543
1011
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
ve = {};
|
|
558
|
-
function Lt(e) {
|
|
559
|
-
if (z.call(e, "ref")) {
|
|
560
|
-
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
561
|
-
if (n && n.isReactWarning)
|
|
562
|
-
return !1;
|
|
563
|
-
}
|
|
564
|
-
return e.ref !== void 0;
|
|
565
|
-
}
|
|
566
|
-
function It(e) {
|
|
567
|
-
if (z.call(e, "key")) {
|
|
568
|
-
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
569
|
-
if (n && n.isReactWarning)
|
|
1012
|
+
}
|
|
1013
|
+
function qn(n, e) {
|
|
1014
|
+
var t, s, i, r, o, a, l, u, d, p, y = 0, c = n.type === "FeatureCollection", m = n.type === "Feature", h = c ? n.features.length : 1;
|
|
1015
|
+
for (t = 0; t < h; t++) {
|
|
1016
|
+
for (a = c ? n.features[t].geometry : m ? n.geometry : n, u = c ? n.features[t].properties : m ? n.properties : {}, d = c ? n.features[t].bbox : m ? n.bbox : void 0, p = c ? n.features[t].id : m ? n.id : void 0, l = a ? a.type === "GeometryCollection" : !1, o = l ? a.geometries.length : 1, i = 0; i < o; i++) {
|
|
1017
|
+
if (r = l ? a.geometries[i] : a, r === null) {
|
|
1018
|
+
if (e(
|
|
1019
|
+
null,
|
|
1020
|
+
y,
|
|
1021
|
+
u,
|
|
1022
|
+
d,
|
|
1023
|
+
p
|
|
1024
|
+
) === !1)
|
|
570
1025
|
return !1;
|
|
1026
|
+
continue;
|
|
571
1027
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
function Vt(e, n) {
|
|
592
|
-
{
|
|
593
|
-
var i = function() {
|
|
594
|
-
Be || (Be = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
595
|
-
};
|
|
596
|
-
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
597
|
-
get: i,
|
|
598
|
-
configurable: !0
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
var $t = function(e, n, i, u, g, S, p) {
|
|
603
|
-
var d = {
|
|
604
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
605
|
-
$$typeof: r,
|
|
606
|
-
// Built-in properties that belong on the element
|
|
607
|
-
type: e,
|
|
608
|
-
key: n,
|
|
609
|
-
ref: i,
|
|
610
|
-
props: p,
|
|
611
|
-
// Record the component responsible for creating this element.
|
|
612
|
-
_owner: S
|
|
613
|
-
};
|
|
614
|
-
return d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
615
|
-
configurable: !1,
|
|
616
|
-
enumerable: !1,
|
|
617
|
-
writable: !0,
|
|
618
|
-
value: !1
|
|
619
|
-
}), Object.defineProperty(d, "_self", {
|
|
620
|
-
configurable: !1,
|
|
621
|
-
enumerable: !1,
|
|
622
|
-
writable: !1,
|
|
623
|
-
value: u
|
|
624
|
-
}), Object.defineProperty(d, "_source", {
|
|
625
|
-
configurable: !1,
|
|
626
|
-
enumerable: !1,
|
|
627
|
-
writable: !1,
|
|
628
|
-
value: g
|
|
629
|
-
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
630
|
-
};
|
|
631
|
-
function Yt(e, n, i, u, g) {
|
|
632
|
-
{
|
|
633
|
-
var S, p = {}, d = null, M = null;
|
|
634
|
-
i !== void 0 && ($e(i), d = "" + i), It(n) && ($e(n.key), d = "" + n.key), Lt(n) && (M = n.ref, Nt(n, g));
|
|
635
|
-
for (S in n)
|
|
636
|
-
z.call(n, S) && !Ft.hasOwnProperty(S) && (p[S] = n[S]);
|
|
637
|
-
if (e && e.defaultProps) {
|
|
638
|
-
var R = e.defaultProps;
|
|
639
|
-
for (S in R)
|
|
640
|
-
p[S] === void 0 && (p[S] = R[S]);
|
|
1028
|
+
switch (r.type) {
|
|
1029
|
+
case "Point":
|
|
1030
|
+
case "LineString":
|
|
1031
|
+
case "MultiPoint":
|
|
1032
|
+
case "Polygon":
|
|
1033
|
+
case "MultiLineString":
|
|
1034
|
+
case "MultiPolygon": {
|
|
1035
|
+
if (e(
|
|
1036
|
+
r,
|
|
1037
|
+
y,
|
|
1038
|
+
u,
|
|
1039
|
+
d,
|
|
1040
|
+
p
|
|
1041
|
+
) === !1)
|
|
1042
|
+
return !1;
|
|
1043
|
+
break;
|
|
641
1044
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
1045
|
+
case "GeometryCollection": {
|
|
1046
|
+
for (s = 0; s < r.geometries.length; s++)
|
|
1047
|
+
if (e(
|
|
1048
|
+
r.geometries[s],
|
|
1049
|
+
y,
|
|
1050
|
+
u,
|
|
1051
|
+
d,
|
|
1052
|
+
p
|
|
1053
|
+
) === !1)
|
|
1054
|
+
return !1;
|
|
1055
|
+
break;
|
|
645
1056
|
}
|
|
646
|
-
|
|
1057
|
+
default:
|
|
1058
|
+
throw new Error("Unknown Geometry Type");
|
|
647
1059
|
}
|
|
648
1060
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
var e = D(ge.current.type);
|
|
666
|
-
if (e)
|
|
667
|
-
return `
|
|
668
|
-
|
|
669
|
-
Check the render method of \`` + e + "`.";
|
|
670
|
-
}
|
|
671
|
-
return "";
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
function Bt(e) {
|
|
675
|
-
return "";
|
|
1061
|
+
y++;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
function Gn(n, e, t) {
|
|
1065
|
+
var s = t;
|
|
1066
|
+
return qn(
|
|
1067
|
+
n,
|
|
1068
|
+
function(i, r, o, a, l) {
|
|
1069
|
+
r === 0 && t === void 0 ? s = i : s = e(
|
|
1070
|
+
s,
|
|
1071
|
+
i,
|
|
1072
|
+
r,
|
|
1073
|
+
o,
|
|
1074
|
+
a,
|
|
1075
|
+
l
|
|
1076
|
+
);
|
|
676
1077
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1078
|
+
), s;
|
|
1079
|
+
}
|
|
1080
|
+
function Ye(n) {
|
|
1081
|
+
return Gn(
|
|
1082
|
+
n,
|
|
1083
|
+
(e, t) => e + Bn(t),
|
|
1084
|
+
0
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
function Bn(n) {
|
|
1088
|
+
let e = 0, t;
|
|
1089
|
+
switch (n.type) {
|
|
1090
|
+
case "Polygon":
|
|
1091
|
+
return Xe(n.coordinates);
|
|
1092
|
+
case "MultiPolygon":
|
|
1093
|
+
for (t = 0; t < n.coordinates.length; t++)
|
|
1094
|
+
e += Xe(n.coordinates[t]);
|
|
1095
|
+
return e;
|
|
1096
|
+
case "Point":
|
|
1097
|
+
case "MultiPoint":
|
|
1098
|
+
case "LineString":
|
|
1099
|
+
case "MultiLineString":
|
|
1100
|
+
return 0;
|
|
1101
|
+
}
|
|
1102
|
+
return 0;
|
|
1103
|
+
}
|
|
1104
|
+
function Xe(n) {
|
|
1105
|
+
let e = 0;
|
|
1106
|
+
if (n && n.length > 0) {
|
|
1107
|
+
e += Math.abs(Je(n[0]));
|
|
1108
|
+
for (let t = 1; t < n.length; t++)
|
|
1109
|
+
e -= Math.abs(Je(n[t]));
|
|
1110
|
+
}
|
|
1111
|
+
return e;
|
|
1112
|
+
}
|
|
1113
|
+
var Hn = We * We / 2, De = Math.PI / 180;
|
|
1114
|
+
function Je(n) {
|
|
1115
|
+
const e = n.length - 1;
|
|
1116
|
+
if (e <= 2)
|
|
1117
|
+
return 0;
|
|
1118
|
+
let t = 0, s = 0;
|
|
1119
|
+
for (; s < e; ) {
|
|
1120
|
+
const i = n[s], r = n[s + 1 === e ? 0 : s + 1], o = n[s + 2 >= e ? (s + 2) % e : s + 2], a = i[0] * De, l = r[1] * De, u = o[0] * De;
|
|
1121
|
+
t += (u - a) * Math.sin(l), s++;
|
|
1122
|
+
}
|
|
1123
|
+
return t * Hn;
|
|
1124
|
+
}
|
|
1125
|
+
class gt {
|
|
1126
|
+
constructor(e = [], t = jn) {
|
|
1127
|
+
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
1128
|
+
for (let s = (this.length >> 1) - 1; s >= 0; s--) this._down(s);
|
|
1129
|
+
}
|
|
1130
|
+
push(e) {
|
|
1131
|
+
this.data.push(e), this.length++, this._up(this.length - 1);
|
|
1132
|
+
}
|
|
1133
|
+
pop() {
|
|
1134
|
+
if (this.length === 0) return;
|
|
1135
|
+
const e = this.data[0], t = this.data.pop();
|
|
1136
|
+
return this.length--, this.length > 0 && (this.data[0] = t, this._down(0)), e;
|
|
1137
|
+
}
|
|
1138
|
+
peek() {
|
|
1139
|
+
return this.data[0];
|
|
1140
|
+
}
|
|
1141
|
+
_up(e) {
|
|
1142
|
+
const { data: t, compare: s } = this, i = t[e];
|
|
1143
|
+
for (; e > 0; ) {
|
|
1144
|
+
const r = e - 1 >> 1, o = t[r];
|
|
1145
|
+
if (s(i, o) >= 0) break;
|
|
1146
|
+
t[e] = o, e = r;
|
|
689
1147
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
var u = "";
|
|
700
|
-
e && e._owner && e._owner !== ge.current && (u = " It was passed a child from " + D(e._owner.type) + "."), V(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, u), V(null);
|
|
701
|
-
}
|
|
1148
|
+
t[e] = i;
|
|
1149
|
+
}
|
|
1150
|
+
_down(e) {
|
|
1151
|
+
const { data: t, compare: s } = this, i = this.length >> 1, r = t[e];
|
|
1152
|
+
for (; e < i; ) {
|
|
1153
|
+
let o = (e << 1) + 1, a = t[o];
|
|
1154
|
+
const l = o + 1;
|
|
1155
|
+
if (l < this.length && s(t[l], a) < 0 && (o = l, a = t[l]), s(a, r) >= 0) break;
|
|
1156
|
+
t[e] = a, e = o;
|
|
702
1157
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
1158
|
+
t[e] = r;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
function jn(n, e) {
|
|
1162
|
+
return n < e ? -1 : n > e ? 1 : 0;
|
|
1163
|
+
}
|
|
1164
|
+
function St(n, e) {
|
|
1165
|
+
return n.p.x > e.p.x ? 1 : n.p.x < e.p.x ? -1 : n.p.y !== e.p.y ? n.p.y > e.p.y ? 1 : -1 : 1;
|
|
1166
|
+
}
|
|
1167
|
+
function zn(n, e) {
|
|
1168
|
+
return n.rightSweepEvent.p.x > e.rightSweepEvent.p.x ? 1 : n.rightSweepEvent.p.x < e.rightSweepEvent.p.x ? -1 : n.rightSweepEvent.p.y !== e.rightSweepEvent.p.y ? n.rightSweepEvent.p.y < e.rightSweepEvent.p.y ? 1 : -1 : 1;
|
|
1169
|
+
}
|
|
1170
|
+
class Qe {
|
|
1171
|
+
constructor(e, t, s, i) {
|
|
1172
|
+
this.p = {
|
|
1173
|
+
x: e[0],
|
|
1174
|
+
y: e[1]
|
|
1175
|
+
}, this.featureId = t, this.ringId = s, this.eventId = i, this.otherEvent = null, this.isLeftEndpoint = null;
|
|
1176
|
+
}
|
|
1177
|
+
isSamePoint(e) {
|
|
1178
|
+
return this.p.x === e.p.x && this.p.y === e.p.y;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
function In(n, e) {
|
|
1182
|
+
if (n.type === "FeatureCollection") {
|
|
1183
|
+
const t = n.features;
|
|
1184
|
+
for (let s = 0; s < t.length; s++)
|
|
1185
|
+
et(t[s], e);
|
|
1186
|
+
} else
|
|
1187
|
+
et(n, e);
|
|
1188
|
+
}
|
|
1189
|
+
let we = 0, _e = 0, Pe = 0;
|
|
1190
|
+
function et(n, e) {
|
|
1191
|
+
const t = n.type === "Feature" ? n.geometry : n;
|
|
1192
|
+
let s = t.coordinates;
|
|
1193
|
+
(t.type === "Polygon" || t.type === "MultiLineString") && (s = [s]), t.type === "LineString" && (s = [[s]]);
|
|
1194
|
+
for (let i = 0; i < s.length; i++)
|
|
1195
|
+
for (let r = 0; r < s[i].length; r++) {
|
|
1196
|
+
let o = s[i][r][0], a = null;
|
|
1197
|
+
_e = _e + 1;
|
|
1198
|
+
for (let l = 0; l < s[i][r].length - 1; l++) {
|
|
1199
|
+
a = s[i][r][l + 1];
|
|
1200
|
+
const u = new Qe(o, we, _e, Pe), d = new Qe(a, we, _e, Pe + 1);
|
|
1201
|
+
u.otherEvent = d, d.otherEvent = u, St(u, d) > 0 ? (d.isLeftEndpoint = !0, u.isLeftEndpoint = !1) : (u.isLeftEndpoint = !0, d.isLeftEndpoint = !1), e.push(u), e.push(d), o = a, Pe = Pe + 1;
|
|
720
1202
|
}
|
|
721
1203
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1204
|
+
we = we + 1;
|
|
1205
|
+
}
|
|
1206
|
+
class Wn {
|
|
1207
|
+
constructor(e) {
|
|
1208
|
+
this.leftSweepEvent = e, this.rightSweepEvent = e.otherEvent;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
function Zn(n, e) {
|
|
1212
|
+
if (n === null || e === null || n.leftSweepEvent.ringId === e.leftSweepEvent.ringId && (n.rightSweepEvent.isSamePoint(e.leftSweepEvent) || n.rightSweepEvent.isSamePoint(e.leftSweepEvent) || n.rightSweepEvent.isSamePoint(e.rightSweepEvent) || n.leftSweepEvent.isSamePoint(e.leftSweepEvent) || n.leftSweepEvent.isSamePoint(e.rightSweepEvent))) return !1;
|
|
1213
|
+
const t = n.leftSweepEvent.p.x, s = n.leftSweepEvent.p.y, i = n.rightSweepEvent.p.x, r = n.rightSweepEvent.p.y, o = e.leftSweepEvent.p.x, a = e.leftSweepEvent.p.y, l = e.rightSweepEvent.p.x, u = e.rightSweepEvent.p.y, d = (u - a) * (i - t) - (l - o) * (r - s), p = (l - o) * (s - a) - (u - a) * (t - o), y = (i - t) * (s - a) - (r - s) * (t - o);
|
|
1214
|
+
if (d === 0)
|
|
1215
|
+
return !1;
|
|
1216
|
+
const c = p / d, m = y / d;
|
|
1217
|
+
if (c >= 0 && c <= 1 && m >= 0 && m <= 1) {
|
|
1218
|
+
const h = t + c * (i - t), f = s + c * (r - s);
|
|
1219
|
+
return [h, f];
|
|
1220
|
+
}
|
|
1221
|
+
return !1;
|
|
1222
|
+
}
|
|
1223
|
+
function Kn(n, e) {
|
|
1224
|
+
e = e || !1;
|
|
1225
|
+
const t = [], s = new gt([], zn);
|
|
1226
|
+
for (; n.length; ) {
|
|
1227
|
+
const i = n.pop();
|
|
1228
|
+
if (i.isLeftEndpoint) {
|
|
1229
|
+
const r = new Wn(i);
|
|
1230
|
+
for (let o = 0; o < s.data.length; o++) {
|
|
1231
|
+
const a = s.data[o];
|
|
1232
|
+
if (e && a.leftSweepEvent.featureId === i.featureId)
|
|
1233
|
+
continue;
|
|
1234
|
+
const l = Zn(r, a);
|
|
1235
|
+
l !== !1 && t.push(l);
|
|
745
1236
|
}
|
|
1237
|
+
s.push(r);
|
|
1238
|
+
} else i.isLeftEndpoint === !1 && s.pop();
|
|
1239
|
+
}
|
|
1240
|
+
return t;
|
|
1241
|
+
}
|
|
1242
|
+
function Yn(n, e) {
|
|
1243
|
+
const t = new gt([], St);
|
|
1244
|
+
return In(n, t), Kn(t, e);
|
|
1245
|
+
}
|
|
1246
|
+
var Xn = Yn;
|
|
1247
|
+
function Jn(n, e, t = {}) {
|
|
1248
|
+
const { removeDuplicates: s = !0, ignoreSelfIntersections: i = !1 } = t;
|
|
1249
|
+
let r = [];
|
|
1250
|
+
n.type === "FeatureCollection" ? r = r.concat(n.features) : n.type === "Feature" ? r.push(n) : (n.type === "LineString" || n.type === "Polygon" || n.type === "MultiLineString" || n.type === "MultiPolygon") && r.push(xe(n)), e.type === "FeatureCollection" ? r = r.concat(e.features) : e.type === "Feature" ? r.push(e) : (e.type === "LineString" || e.type === "Polygon" || e.type === "MultiLineString" || e.type === "MultiPolygon") && r.push(xe(e));
|
|
1251
|
+
const o = Xn(
|
|
1252
|
+
Ze(r),
|
|
1253
|
+
i
|
|
1254
|
+
);
|
|
1255
|
+
let a = [];
|
|
1256
|
+
if (s) {
|
|
1257
|
+
const l = {};
|
|
1258
|
+
o.forEach((u) => {
|
|
1259
|
+
const d = u.join(",");
|
|
1260
|
+
l[d] || (l[d] = !0, a.push(u));
|
|
1261
|
+
});
|
|
1262
|
+
} else
|
|
1263
|
+
a = o;
|
|
1264
|
+
return Ze(a.map((l) => ht(l)));
|
|
1265
|
+
}
|
|
1266
|
+
function Qn(n, e = {}) {
|
|
1267
|
+
let t = 0, s = 0, i = 0;
|
|
1268
|
+
return yt(
|
|
1269
|
+
n,
|
|
1270
|
+
function(r) {
|
|
1271
|
+
t += r[0], s += r[1], i++;
|
|
746
1272
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
1273
|
+
), ht([t / i, s / i], e.properties);
|
|
1274
|
+
}
|
|
1275
|
+
const es = Jt({
|
|
1276
|
+
length: Qt
|
|
1277
|
+
});
|
|
1278
|
+
function tt(n, e) {
|
|
1279
|
+
return es(n).from(it[C.meter]).to(it[e]);
|
|
1280
|
+
}
|
|
1281
|
+
const nt = 1e4;
|
|
1282
|
+
function ke({
|
|
1283
|
+
meters: n,
|
|
1284
|
+
unit: e,
|
|
1285
|
+
locale: t,
|
|
1286
|
+
options: {
|
|
1287
|
+
autoSplitNumber: s,
|
|
1288
|
+
...i
|
|
1289
|
+
} = {
|
|
1290
|
+
autoSplitNumber: nt
|
|
1291
|
+
}
|
|
1292
|
+
}) {
|
|
1293
|
+
const r = e === Ve["m-km"], o = e === Ve["ft-mi"], a = r || o;
|
|
1294
|
+
let l, u;
|
|
1295
|
+
if (a) {
|
|
1296
|
+
const d = n < (s ?? nt);
|
|
1297
|
+
let p = d ? C.meter : C.kilometer;
|
|
1298
|
+
l = d ? ve.meter : ve.kilometer, o && (l = d ? ve.feet : ve.mile, p = d ? C.feet : C.mile), u = tt(n, p);
|
|
1299
|
+
} else
|
|
1300
|
+
l = ve[e], u = tt(n, e);
|
|
1301
|
+
return `${ut(u, t, {
|
|
1302
|
+
style: "unit",
|
|
1303
|
+
unit: l,
|
|
1304
|
+
unitDisplay: "short",
|
|
1305
|
+
notation: "standard",
|
|
1306
|
+
minimumFractionDigits: 2,
|
|
1307
|
+
maximumFractionDigits: 2,
|
|
1308
|
+
...i
|
|
1309
|
+
})}`;
|
|
1310
|
+
}
|
|
1311
|
+
function Xs(n, {
|
|
1312
|
+
hasDoubleClickZoom: e
|
|
1313
|
+
}) {
|
|
1314
|
+
return typeof n == "boolean" ? {
|
|
1315
|
+
doubleClickZoom: e
|
|
1316
|
+
} : {
|
|
1317
|
+
...n,
|
|
1318
|
+
doubleClickZoom: e
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
function vt(n, e, t) {
|
|
1322
|
+
if (n > 0) {
|
|
1323
|
+
const {
|
|
1324
|
+
formatTooltip: s,
|
|
1325
|
+
turfOptions: i
|
|
1326
|
+
} = t ?? {
|
|
1327
|
+
turfOptions: {
|
|
1328
|
+
units: "kilometers"
|
|
757
1329
|
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
let props = %s;
|
|
798
|
-
<%s key={someKey} {...props} />`, Ee, I, Zt, I), Ge[I + Ee] = !0;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
return e === s ? zt(T) : Ht(T), T;
|
|
1330
|
+
}, r = i == null ? void 0 : i.units;
|
|
1331
|
+
let o;
|
|
1332
|
+
s ? o = s(n) : o = `${parseFloat(n.toString()).toFixed(2)} ${r}`;
|
|
1333
|
+
const {
|
|
1334
|
+
measurementCallback: a
|
|
1335
|
+
} = t;
|
|
1336
|
+
return a && a(n), [{
|
|
1337
|
+
position: e,
|
|
1338
|
+
text: o
|
|
1339
|
+
}];
|
|
1340
|
+
}
|
|
1341
|
+
return [];
|
|
1342
|
+
}
|
|
1343
|
+
class ts extends zt {
|
|
1344
|
+
constructor() {
|
|
1345
|
+
super(...arguments);
|
|
1346
|
+
Q(this, "_isMeasuringSessionFinished", !1);
|
|
1347
|
+
Q(this, "area", 0);
|
|
1348
|
+
Q(this, "tooltips", []);
|
|
1349
|
+
Q(this, "resultPolygon", {
|
|
1350
|
+
type: "FeatureCollection",
|
|
1351
|
+
features: []
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
handleClick(t, s) {
|
|
1355
|
+
this._isMeasuringSessionFinished && (this._isMeasuringSessionFinished = !1, this.resetClickSequence(), this.area = 0);
|
|
1356
|
+
const {
|
|
1357
|
+
picks: i
|
|
1358
|
+
} = t, r = It(i), o = this.getClickSequence();
|
|
1359
|
+
let a = !1;
|
|
1360
|
+
!r && !this.allowOverlapping(s) && (this.addClickSequence(t), a = !0), this.area = Ye({
|
|
1361
|
+
type: "Polygon",
|
|
1362
|
+
coordinates: [this.getClickSequence()]
|
|
1363
|
+
}), this.isFinalizedEdition(o, r) ? this.finalizeEdition(s) : a && s.onEdit({
|
|
1364
|
+
// data is the same
|
|
1365
|
+
updatedData: s.data,
|
|
1366
|
+
editType: "addTentativePosition",
|
|
1367
|
+
editContext: {
|
|
1368
|
+
position: t.mapCoords
|
|
802
1369
|
}
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
handleKeyUp(t, s) {
|
|
1373
|
+
t.key === "Enter" ? this.getClickSequence().length > 2 ? this.finalizeEdition(s) : this.resetEdition(s) : t.key === "Escape" && this.resetEdition(s);
|
|
1374
|
+
}
|
|
1375
|
+
handlePointerMove(t, s) {
|
|
1376
|
+
if (this._isMeasuringSessionFinished)
|
|
1377
|
+
return;
|
|
1378
|
+
super.handlePointerMove(t, s);
|
|
1379
|
+
const i = this.getTentativeGuide(s);
|
|
1380
|
+
if (i && i.geometry.type === "Polygon") {
|
|
1381
|
+
const r = Qn(i);
|
|
1382
|
+
this.area = Ye(i), this.tooltips = vt(this.area, r.geometry.coordinates, s.modeConfig);
|
|
803
1383
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1384
|
+
}
|
|
1385
|
+
resetClickSequence() {
|
|
1386
|
+
super.resetClickSequence(), this.tooltips = [], this._isMeasuringSessionFinished = !1, this.area = 0;
|
|
1387
|
+
}
|
|
1388
|
+
getGuides(t) {
|
|
1389
|
+
return this._isMeasuringSessionFinished ? this.resultPolygon : super.getGuides(t);
|
|
1390
|
+
}
|
|
1391
|
+
getTooltips() {
|
|
1392
|
+
return this.tooltips;
|
|
1393
|
+
}
|
|
1394
|
+
isFinalizedEdition(t, s) {
|
|
1395
|
+
const {
|
|
1396
|
+
positionIndexes: i
|
|
1397
|
+
} = (s == null ? void 0 : s.properties) ?? {
|
|
1398
|
+
positionIndexes: []
|
|
1399
|
+
};
|
|
1400
|
+
return t.length > 2 && s !== void 0 && (i[0] === 0 || i[0] === t.length - 1);
|
|
1401
|
+
}
|
|
1402
|
+
allowOverlapping(t) {
|
|
1403
|
+
var r;
|
|
1404
|
+
let s = !1;
|
|
1405
|
+
const i = this.getClickSequence();
|
|
1406
|
+
if (i.length > 2 && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1407
|
+
((r = t.modeConfig) != null && r.preventOverlappingLines)) {
|
|
1408
|
+
const o = {
|
|
1409
|
+
type: "LineString",
|
|
1410
|
+
coordinates: [...i, i[0]]
|
|
1411
|
+
}, a = {
|
|
1412
|
+
type: "LineString",
|
|
1413
|
+
coordinates: [...i.slice(0, i.length - 1)]
|
|
1414
|
+
};
|
|
1415
|
+
Jn(o, a).features.length > 0 && (s = !0);
|
|
809
1416
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
current: null
|
|
831
|
-
},
|
|
832
|
-
overlayRef: {
|
|
833
|
-
current: null
|
|
1417
|
+
return s;
|
|
1418
|
+
}
|
|
1419
|
+
finalizeEdition(t) {
|
|
1420
|
+
const s = this.getClickSequence(), i = {
|
|
1421
|
+
type: "Polygon",
|
|
1422
|
+
coordinates: [[...s, s[0]]]
|
|
1423
|
+
};
|
|
1424
|
+
t.selectedIndexes = [], t.data = {
|
|
1425
|
+
type: "FeatureCollection",
|
|
1426
|
+
features: []
|
|
1427
|
+
};
|
|
1428
|
+
const r = this.getAddFeatureOrBooleanPolygonAction(i, t);
|
|
1429
|
+
this._isMeasuringSessionFinished = !0, r && (this.resultPolygon = r.updatedData, t.onEdit({
|
|
1430
|
+
...r,
|
|
1431
|
+
editType: G.addPosition,
|
|
1432
|
+
editContext: {
|
|
1433
|
+
...r.editContext,
|
|
1434
|
+
distance: this.area,
|
|
1435
|
+
positions: this.getClickSequence(),
|
|
1436
|
+
finished: this._isMeasuringSessionFinished
|
|
834
1437
|
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
(
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
)
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
});
|
|
907
|
-
return /* @__PURE__ */ Z.jsx(ut.Provider, { value: b.current, children: /* @__PURE__ */ Z.jsx(ct.Provider, { value: l, children: /* @__PURE__ */ Z.jsx(st.Provider, { value: s, children: t }) }) });
|
|
908
|
-
}
|
|
909
|
-
const lt = {
|
|
910
|
-
NUMBER: {
|
|
911
|
-
style: "decimal",
|
|
912
|
-
maximumFractionDigits: 1,
|
|
913
|
-
minimumFractionDigits: 0,
|
|
914
|
-
notation: "compact",
|
|
915
|
-
compactDisplay: "short"
|
|
916
|
-
},
|
|
917
|
-
CURRENCY: {
|
|
918
|
-
style: "currency",
|
|
919
|
-
currency: "USD",
|
|
920
|
-
maximumFractionDigits: 2,
|
|
921
|
-
minimumFractionDigits: 2,
|
|
922
|
-
notation: "compact",
|
|
923
|
-
compactDisplay: "short"
|
|
924
|
-
},
|
|
925
|
-
DATE: {
|
|
926
|
-
year: "numeric",
|
|
927
|
-
month: "2-digit",
|
|
928
|
-
day: "2-digit"
|
|
1438
|
+
}));
|
|
1439
|
+
}
|
|
1440
|
+
resetEdition(t) {
|
|
1441
|
+
this.resetClickSequence(), t.onEdit({
|
|
1442
|
+
// Because the new drawing feature is dropped, so the data will keep as the same.
|
|
1443
|
+
updatedData: t.data,
|
|
1444
|
+
editType: "cancelFeature",
|
|
1445
|
+
editContext: {}
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
getTooltipText({
|
|
1449
|
+
meters: t,
|
|
1450
|
+
locale: s,
|
|
1451
|
+
unit: i,
|
|
1452
|
+
options: r
|
|
1453
|
+
}) {
|
|
1454
|
+
return ke({
|
|
1455
|
+
meters: t,
|
|
1456
|
+
locale: s,
|
|
1457
|
+
unit: i,
|
|
1458
|
+
options: r
|
|
1459
|
+
}) + "2";
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
class ns extends at {
|
|
1463
|
+
constructor() {
|
|
1464
|
+
super(...arguments);
|
|
1465
|
+
Q(this, "_isMeasuringSessionFinished", !1);
|
|
1466
|
+
Q(this, "_currentArea", 0);
|
|
1467
|
+
Q(this, "resultPolygon", {
|
|
1468
|
+
type: "FeatureCollection",
|
|
1469
|
+
features: []
|
|
1470
|
+
});
|
|
1471
|
+
Q(this, "tooltips", []);
|
|
1472
|
+
}
|
|
1473
|
+
handleClick(t, s) {
|
|
1474
|
+
this._isMeasuringSessionFinished && (this._isMeasuringSessionFinished = !1, this.resetClickSequence(), this._currentArea = 0), super.handleClick(t, s);
|
|
1475
|
+
}
|
|
1476
|
+
handlePointerMove(t, s) {
|
|
1477
|
+
this._isMeasuringSessionFinished || (super.handlePointerMove(t, s), this.tooltips = vt(this.areaCircle, this.position, s.modeConfig));
|
|
1478
|
+
}
|
|
1479
|
+
checkAndFinishPolygon(t) {
|
|
1480
|
+
const s = this.getClickSequence(), i = this.getTentativeGuide(t);
|
|
1481
|
+
this.isFinalizedEdition(s, i) && this.finalizeEdition(t);
|
|
1482
|
+
}
|
|
1483
|
+
handleKeyUp(t, s) {
|
|
1484
|
+
t.key === "Enter" ? this.finalizeEdition(s) : t.key === "Escape" && this.resetEdition(s);
|
|
1485
|
+
}
|
|
1486
|
+
getGuides(t) {
|
|
1487
|
+
return this._isMeasuringSessionFinished ? this.resultPolygon : super.getGuides(t);
|
|
1488
|
+
}
|
|
1489
|
+
isFinalizedEdition(t, s) {
|
|
1490
|
+
return t.length > 1 && s && s.geometry.type === "Polygon";
|
|
1491
|
+
}
|
|
1492
|
+
finalizeEdition(t) {
|
|
1493
|
+
const s = this.getTentativeGuide(t);
|
|
1494
|
+
t.selectedIndexes = [], t.data = {
|
|
1495
|
+
type: "FeatureCollection",
|
|
1496
|
+
features: []
|
|
1497
|
+
};
|
|
1498
|
+
const i = this.getAddFeatureOrBooleanPolygonAction(s, t);
|
|
1499
|
+
this._isMeasuringSessionFinished = !0, t.onUpdateCursor("cell"), i && (this.resultPolygon = i.updatedData, t.onEdit({
|
|
1500
|
+
...i,
|
|
1501
|
+
editType: G.addPosition,
|
|
1502
|
+
editContext: {
|
|
1503
|
+
...i.editContext,
|
|
1504
|
+
distance: this._currentArea,
|
|
1505
|
+
positions: this.getClickSequence(),
|
|
1506
|
+
finished: this._isMeasuringSessionFinished
|
|
1507
|
+
}
|
|
1508
|
+
}));
|
|
929
1509
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1510
|
+
resetEdition(t) {
|
|
1511
|
+
this.resetClickSequence(), t.onEdit({
|
|
1512
|
+
// Because the new drawing feature is dropped, so the data will keep as the same.
|
|
1513
|
+
updatedData: t.data,
|
|
1514
|
+
editType: "cancelFeature",
|
|
1515
|
+
editContext: {}
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
resetClickSequence() {
|
|
1519
|
+
super.resetClickSequence(), this._isMeasuringSessionFinished = !1, this._currentArea = 0, this.radius = 0;
|
|
1520
|
+
}
|
|
1521
|
+
getTooltips() {
|
|
1522
|
+
return this.tooltips;
|
|
1523
|
+
}
|
|
1524
|
+
getTooltipText({
|
|
1525
|
+
meters: t,
|
|
1526
|
+
locale: s,
|
|
1527
|
+
unit: i,
|
|
1528
|
+
options: r
|
|
1529
|
+
}) {
|
|
1530
|
+
return ke({
|
|
1531
|
+
meters: t,
|
|
1532
|
+
locale: s,
|
|
1533
|
+
unit: i,
|
|
1534
|
+
options: r
|
|
1535
|
+
}) + "2";
|
|
953
1536
|
}
|
|
954
|
-
};
|
|
955
|
-
function en({
|
|
956
|
-
properties: t,
|
|
957
|
-
formatters: r = {},
|
|
958
|
-
includeColumns: a = Object.keys(t),
|
|
959
|
-
locale: s = "en-US",
|
|
960
|
-
showColumnName: o = !0,
|
|
961
|
-
title: l,
|
|
962
|
-
getColumnName: f = gr,
|
|
963
|
-
getFieldHtml: y = pr,
|
|
964
|
-
getTitle: c = dr,
|
|
965
|
-
getValue: m = mr
|
|
966
|
-
}) {
|
|
967
|
-
const E = l ? c(l) : "", b = a.reduce((v, h) => {
|
|
968
|
-
const A = r[h], U = t[h], j = m(U, s, A), P = o ? f(h) : "";
|
|
969
|
-
return v + y(P, j);
|
|
970
|
-
}, "");
|
|
971
|
-
return E + b;
|
|
972
|
-
}
|
|
973
|
-
function dr(t) {
|
|
974
|
-
return `<h3 style="margin: 0"><strong>${t}</strong></h3></br>`;
|
|
975
|
-
}
|
|
976
|
-
function pr(t, r) {
|
|
977
|
-
return `${t}${r}</br>`;
|
|
978
1537
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1538
|
+
class Mt extends Wt {
|
|
1539
|
+
handleClick(e, t) {
|
|
1540
|
+
super.handleClick(e, t), t.onEdit({
|
|
1541
|
+
// data is the same
|
|
1542
|
+
updatedData: t.data,
|
|
1543
|
+
editType: G.addPosition,
|
|
1544
|
+
editContext: {
|
|
1545
|
+
distance: this._currentDistance,
|
|
1546
|
+
finished: this._isMeasuringSessionFinished,
|
|
1547
|
+
positions: this.getClickSequence()
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
handleKeyUp(e, t) {
|
|
1552
|
+
if (this._isMeasuringSessionFinished) return;
|
|
1553
|
+
e.stopPropagation();
|
|
1554
|
+
const {
|
|
1555
|
+
key: s
|
|
1556
|
+
} = e, i = this.getClickSequence().length;
|
|
1557
|
+
let r = G.finish;
|
|
1558
|
+
switch (s) {
|
|
1559
|
+
case "Escape":
|
|
1560
|
+
t.onEdit({
|
|
1561
|
+
updatedData: {
|
|
1562
|
+
type: "FeatureCollection",
|
|
1563
|
+
features: []
|
|
1564
|
+
},
|
|
1565
|
+
editType: G.cancel,
|
|
1566
|
+
editContext: {}
|
|
1567
|
+
});
|
|
1568
|
+
break;
|
|
1569
|
+
case "Enter":
|
|
1570
|
+
this._isMeasuringSessionFinished = !0, i === 1 && (this.resetClickSequence(), r = G.cancel), t.onUpdateCursor("cell"), t.onEdit({
|
|
1571
|
+
updatedData: t.data,
|
|
1572
|
+
editType: r,
|
|
1573
|
+
editContext: {
|
|
1574
|
+
finished: this._isMeasuringSessionFinished
|
|
1575
|
+
}
|
|
1576
|
+
});
|
|
1577
|
+
break;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
resetClickSequence() {
|
|
1581
|
+
super.resetClickSequence(), this._isMeasuringSessionFinished = !1, this._currentTooltips = [], this._currentDistance = 0;
|
|
1582
|
+
}
|
|
1583
|
+
getTooltipText({
|
|
1584
|
+
meters: e,
|
|
1585
|
+
locale: t,
|
|
1586
|
+
unit: s,
|
|
1587
|
+
options: i
|
|
1588
|
+
}) {
|
|
1589
|
+
return ke({
|
|
1590
|
+
meters: e,
|
|
1591
|
+
locale: t,
|
|
1592
|
+
unit: s,
|
|
1593
|
+
options: i
|
|
1594
|
+
});
|
|
984
1595
|
}
|
|
985
1596
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
989
|
-
function gr(t) {
|
|
990
|
-
return `<strong>${t}</strong>: `;
|
|
991
|
-
}
|
|
992
|
-
function yr(t) {
|
|
993
|
-
return Se[t]?.type;
|
|
994
|
-
}
|
|
995
|
-
function hr(t) {
|
|
996
|
-
return yr(t) === it.GoogleMaps;
|
|
997
|
-
}
|
|
998
|
-
function Er({ mapId: t }) {
|
|
999
|
-
const { isLoaded: r, basemap: a } = Te(t), { getOverlayInstance: s } = Pe(t);
|
|
1000
|
-
return Qt(() => {
|
|
1001
|
-
if (!r || !hr(a))
|
|
1002
|
-
return null;
|
|
1003
|
-
const l = s()?.getDiv();
|
|
1004
|
-
return new er(l, {});
|
|
1005
|
-
}, [r, s, a]);
|
|
1006
|
-
}
|
|
1007
|
-
var C = /* @__PURE__ */ ((t) => (t.milimeter = "milimeter", t.centimeter = "centimeter", t.meter = "meter", t.kilometer = "kilometer", t.mile = "mile", t.feet = "feet", t))(C || {}), pt = /* @__PURE__ */ ((t) => (t.meters = "meters", t.kilometer = "kilometers", t.mile = "miles", t))(pt || {}), ue = /* @__PURE__ */ ((t) => (t.AddPosition = "addPosition", t.Finish = "finish", t))(ue || {});
|
|
1008
|
-
const et = [
|
|
1009
|
-
"anyclick",
|
|
1010
|
-
"pointermove",
|
|
1011
|
-
"panstart",
|
|
1012
|
-
"panmove",
|
|
1013
|
-
"panend",
|
|
1014
|
-
"keyup"
|
|
1015
|
-
], br = "mapMeasureLayer", Sr = {
|
|
1016
|
-
id: br,
|
|
1597
|
+
const Te = "mapMeasureLayer", ss = {
|
|
1598
|
+
id: Te,
|
|
1017
1599
|
pickable: !1,
|
|
1018
1600
|
billboard: !1,
|
|
1019
1601
|
editHandlePointRadiusUnits: "pixels",
|
|
@@ -1034,542 +1616,844 @@ const et = [
|
|
|
1034
1616
|
updateTriggers: {}
|
|
1035
1617
|
},
|
|
1036
1618
|
guides: {
|
|
1037
|
-
// getLineColor: conditionalRgbColor,
|
|
1038
1619
|
getLineWidth: 2
|
|
1039
1620
|
}
|
|
1040
1621
|
}
|
|
1041
|
-
},
|
|
1042
|
-
editing: [
|
|
1043
|
-
finished: [
|
|
1044
|
-
|
|
1622
|
+
}, Ue = {
|
|
1623
|
+
editing: [23, 102, 214, 255],
|
|
1624
|
+
finished: [71, 219, 153, 255],
|
|
1625
|
+
point: [255, 255, 255, 255]
|
|
1626
|
+
}, st = {
|
|
1045
1627
|
styles: {
|
|
1046
1628
|
colors: {
|
|
1047
|
-
editing:
|
|
1048
|
-
finished:
|
|
1629
|
+
editing: Ue.editing,
|
|
1630
|
+
finished: Ue.finished,
|
|
1631
|
+
point: Ue.point
|
|
1049
1632
|
}
|
|
1050
1633
|
}
|
|
1051
|
-
},
|
|
1634
|
+
}, C = {
|
|
1635
|
+
kilometer: "kilometer",
|
|
1636
|
+
meter: "meter",
|
|
1637
|
+
centimeter: "centimeter",
|
|
1638
|
+
milimeter: "milimeter",
|
|
1639
|
+
mile: "mile",
|
|
1640
|
+
yard: "yard",
|
|
1641
|
+
feet: "feet"
|
|
1642
|
+
}, Ve = {
|
|
1643
|
+
"m-km": "m-km",
|
|
1644
|
+
"ft-mi": "ft-mi",
|
|
1645
|
+
...C
|
|
1646
|
+
}, is = {
|
|
1647
|
+
meters: "meters",
|
|
1648
|
+
kilometer: "kilometers",
|
|
1649
|
+
mile: "miles"
|
|
1650
|
+
}, it = {
|
|
1052
1651
|
[C.kilometer]: "km",
|
|
1652
|
+
[C.meter]: "m",
|
|
1053
1653
|
[C.centimeter]: "cm",
|
|
1054
1654
|
[C.milimeter]: "mm",
|
|
1055
1655
|
[C.mile]: "mi",
|
|
1056
|
-
[C.
|
|
1656
|
+
[C.yard]: "yd",
|
|
1057
1657
|
[C.feet]: "ft"
|
|
1058
|
-
},
|
|
1658
|
+
}, ve = {
|
|
1059
1659
|
[C.kilometer]: "kilometer",
|
|
1660
|
+
[C.meter]: "meter",
|
|
1060
1661
|
[C.centimeter]: "centimeter",
|
|
1061
1662
|
[C.milimeter]: "millimeter",
|
|
1062
1663
|
[C.mile]: "mile",
|
|
1063
|
-
[C.
|
|
1664
|
+
[C.yard]: "yard",
|
|
1064
1665
|
[C.feet]: "foot"
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
super(r), this.eventManager = r.eventManager;
|
|
1070
|
-
}
|
|
1071
|
-
_addEventHandlers() {
|
|
1072
|
-
const r = this._getEventManager(), { eventHandler: a } = this.state._editableLayerState;
|
|
1073
|
-
for (const s of et)
|
|
1074
|
-
r.on(s, a, {
|
|
1075
|
-
// give nebula a higher priority so that it can stop propagation to deck.gl's map panning handlers
|
|
1076
|
-
priority: 100
|
|
1077
|
-
});
|
|
1078
|
-
}
|
|
1079
|
-
_removeEventHandlers(r = void 0) {
|
|
1080
|
-
const a = r || this._getEventManager(), { eventHandler: s } = this.state._editableLayerState;
|
|
1081
|
-
for (const o of et)
|
|
1082
|
-
a.off(o, s);
|
|
1083
|
-
}
|
|
1084
|
-
_getEventManager() {
|
|
1085
|
-
return this.eventManager || // @ts-ignore
|
|
1086
|
-
this.context.deck.eventManager;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
class Pr extends rr {
|
|
1090
|
-
handleClick(r, a) {
|
|
1091
|
-
super.handleClick(r, a), a.onEdit({
|
|
1092
|
-
// data is the same
|
|
1093
|
-
updatedData: a.data,
|
|
1094
|
-
editType: ue.AddPosition,
|
|
1095
|
-
editContext: {
|
|
1096
|
-
distance: this._currentDistance,
|
|
1097
|
-
finished: this._isMeasuringSessionFinished,
|
|
1098
|
-
positions: this._clickSequence
|
|
1099
|
-
}
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
handleKeyUp(r, a) {
|
|
1103
|
-
if (this._isMeasuringSessionFinished)
|
|
1104
|
-
return;
|
|
1105
|
-
r.stopPropagation();
|
|
1106
|
-
const { key: s } = r, o = this.getClickSequence().length;
|
|
1107
|
-
switch (s) {
|
|
1108
|
-
case "Enter":
|
|
1109
|
-
case "Escape":
|
|
1110
|
-
this._isMeasuringSessionFinished = !0, o === 1 && (this.resetClickSequence(), this._currentTooltips = []), a.onUpdateCursor("cell"), a.onEdit({
|
|
1111
|
-
updatedData: a.data,
|
|
1112
|
-
editType: ue.Finish,
|
|
1113
|
-
editContext: {
|
|
1114
|
-
finished: this._isMeasuringSessionFinished
|
|
1115
|
-
}
|
|
1116
|
-
});
|
|
1117
|
-
break;
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
var Or = function(r) {
|
|
1122
|
-
return Mr(r) && !Cr(r);
|
|
1123
|
-
};
|
|
1124
|
-
function Mr(t) {
|
|
1125
|
-
return !!t && typeof t == "object";
|
|
1126
|
-
}
|
|
1127
|
-
function Cr(t) {
|
|
1128
|
-
var r = Object.prototype.toString.call(t);
|
|
1129
|
-
return r === "[object RegExp]" || r === "[object Date]" || xr(t);
|
|
1130
|
-
}
|
|
1131
|
-
var wr = typeof Symbol == "function" && Symbol.for, jr = wr ? Symbol.for("react.element") : 60103;
|
|
1132
|
-
function xr(t) {
|
|
1133
|
-
return t.$$typeof === jr;
|
|
1134
|
-
}
|
|
1135
|
-
function Ar(t) {
|
|
1136
|
-
return Array.isArray(t) ? [] : {};
|
|
1137
|
-
}
|
|
1138
|
-
function Q(t, r) {
|
|
1139
|
-
return r.clone !== !1 && r.isMergeableObject(t) ? B(Ar(t), t, r) : t;
|
|
1140
|
-
}
|
|
1141
|
-
function Dr(t, r, a) {
|
|
1142
|
-
return t.concat(r).map(function(s) {
|
|
1143
|
-
return Q(s, a);
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
function kr(t, r) {
|
|
1147
|
-
if (!r.customMerge)
|
|
1148
|
-
return B;
|
|
1149
|
-
var a = r.customMerge(t);
|
|
1150
|
-
return typeof a == "function" ? a : B;
|
|
1151
|
-
}
|
|
1152
|
-
function Fr(t) {
|
|
1153
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
|
|
1154
|
-
return Object.propertyIsEnumerable.call(t, r);
|
|
1155
|
-
}) : [];
|
|
1156
|
-
}
|
|
1157
|
-
function rt(t) {
|
|
1158
|
-
return Object.keys(t).concat(Fr(t));
|
|
1159
|
-
}
|
|
1160
|
-
function mt(t, r) {
|
|
1161
|
-
try {
|
|
1162
|
-
return r in t;
|
|
1163
|
-
} catch {
|
|
1164
|
-
return !1;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
function Lr(t, r) {
|
|
1168
|
-
return mt(t, r) && !(Object.hasOwnProperty.call(t, r) && Object.propertyIsEnumerable.call(t, r));
|
|
1169
|
-
}
|
|
1170
|
-
function Ir(t, r, a) {
|
|
1171
|
-
var s = {};
|
|
1172
|
-
return a.isMergeableObject(t) && rt(t).forEach(function(o) {
|
|
1173
|
-
s[o] = Q(t[o], a);
|
|
1174
|
-
}), rt(r).forEach(function(o) {
|
|
1175
|
-
Lr(t, o) || (mt(t, o) && a.isMergeableObject(r[o]) ? s[o] = kr(o, a)(t[o], r[o], a) : s[o] = Q(r[o], a));
|
|
1176
|
-
}), s;
|
|
1177
|
-
}
|
|
1178
|
-
function B(t, r, a) {
|
|
1179
|
-
a = a || {}, a.arrayMerge = a.arrayMerge || Dr, a.isMergeableObject = a.isMergeableObject || Or, a.cloneUnlessOtherwiseSpecified = Q;
|
|
1180
|
-
var s = Array.isArray(r), o = Array.isArray(t), l = s === o;
|
|
1181
|
-
return l ? s ? a.arrayMerge(t, r, a) : Ir(t, r, a) : Q(r, a);
|
|
1182
|
-
}
|
|
1183
|
-
B.all = function(r, a) {
|
|
1184
|
-
if (!Array.isArray(r))
|
|
1185
|
-
throw new Error("first argument should be an array");
|
|
1186
|
-
return r.reduce(function(s, o) {
|
|
1187
|
-
return B(s, o, a);
|
|
1188
|
-
}, {});
|
|
1189
|
-
};
|
|
1190
|
-
var Nr = B, Ur = Nr;
|
|
1191
|
-
const se = /* @__PURE__ */ cr(Ur), Y = () => {
|
|
1192
|
-
throw new Error(
|
|
1193
|
-
"You forgot to wrap your component in <MeasurementToolsProvider>."
|
|
1194
|
-
);
|
|
1195
|
-
}, Oe = {
|
|
1196
|
-
state: {
|
|
1197
|
-
enable: !1,
|
|
1198
|
-
finished: !0,
|
|
1199
|
-
distance: 0,
|
|
1200
|
-
locale: "en",
|
|
1201
|
-
unit: C.kilometer,
|
|
1202
|
-
positions: []
|
|
1203
|
-
},
|
|
1204
|
-
actions: {
|
|
1205
|
-
setEnable: Y,
|
|
1206
|
-
setFinished: Y,
|
|
1207
|
-
setUnit: Y,
|
|
1208
|
-
setDistance: Y,
|
|
1209
|
-
setLocale: Y,
|
|
1210
|
-
setPositions: Y
|
|
1211
|
-
}
|
|
1212
|
-
}, vt = ee(Oe.state), gt = ee(Oe.actions);
|
|
1213
|
-
function yt() {
|
|
1214
|
-
return te(
|
|
1215
|
-
vt
|
|
1216
|
-
);
|
|
1217
|
-
}
|
|
1218
|
-
function ht() {
|
|
1219
|
-
return te(
|
|
1220
|
-
gt
|
|
1221
|
-
);
|
|
1222
|
-
}
|
|
1223
|
-
const Vr = {
|
|
1224
|
-
nm: {
|
|
1225
|
-
name: {
|
|
1226
|
-
singular: "Nanometer",
|
|
1227
|
-
plural: "Nanometers"
|
|
1228
|
-
},
|
|
1229
|
-
to_anchor: 1e-9
|
|
1230
|
-
},
|
|
1231
|
-
μm: {
|
|
1232
|
-
name: {
|
|
1233
|
-
singular: "Micrometer",
|
|
1234
|
-
plural: "Micrometers"
|
|
1235
|
-
},
|
|
1236
|
-
to_anchor: 1e-6
|
|
1237
|
-
},
|
|
1238
|
-
mm: {
|
|
1239
|
-
name: {
|
|
1240
|
-
singular: "Millimeter",
|
|
1241
|
-
plural: "Millimeters"
|
|
1242
|
-
},
|
|
1243
|
-
to_anchor: 1e-3
|
|
1666
|
+
}, $ = {
|
|
1667
|
+
"m-km": {
|
|
1668
|
+
value: "m-km",
|
|
1669
|
+
system: "metric"
|
|
1244
1670
|
},
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
plural: "Centimeters"
|
|
1249
|
-
},
|
|
1250
|
-
to_anchor: 0.01
|
|
1251
|
-
},
|
|
1252
|
-
m: {
|
|
1253
|
-
name: {
|
|
1254
|
-
singular: "Meter",
|
|
1255
|
-
plural: "Meters"
|
|
1256
|
-
},
|
|
1257
|
-
to_anchor: 1
|
|
1258
|
-
},
|
|
1259
|
-
km: {
|
|
1260
|
-
name: {
|
|
1261
|
-
singular: "Kilometer",
|
|
1262
|
-
plural: "Kilometers"
|
|
1263
|
-
},
|
|
1264
|
-
to_anchor: 1e3
|
|
1265
|
-
}
|
|
1266
|
-
}, $r = {
|
|
1267
|
-
mil: {
|
|
1268
|
-
name: {
|
|
1269
|
-
singular: "Mil",
|
|
1270
|
-
plural: "Mils"
|
|
1271
|
-
},
|
|
1272
|
-
to_anchor: 1 / 12e3
|
|
1671
|
+
kilometer: {
|
|
1672
|
+
value: "kilometer",
|
|
1673
|
+
system: "metric"
|
|
1273
1674
|
},
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
plural: "Inches"
|
|
1278
|
-
},
|
|
1279
|
-
to_anchor: 1 / 12
|
|
1675
|
+
meter: {
|
|
1676
|
+
value: "meter",
|
|
1677
|
+
system: "metric"
|
|
1280
1678
|
},
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
plural: "Yards"
|
|
1285
|
-
},
|
|
1286
|
-
to_anchor: 3
|
|
1679
|
+
centimeter: {
|
|
1680
|
+
value: "centimeter",
|
|
1681
|
+
system: "metric"
|
|
1287
1682
|
},
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
plural: "US Survey Feet"
|
|
1292
|
-
},
|
|
1293
|
-
to_anchor: 1.000002
|
|
1683
|
+
milimeter: {
|
|
1684
|
+
value: "milimeter",
|
|
1685
|
+
system: "metric"
|
|
1294
1686
|
},
|
|
1295
|
-
ft: {
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
plural: "Feet"
|
|
1299
|
-
},
|
|
1300
|
-
to_anchor: 1
|
|
1687
|
+
"ft-mi": {
|
|
1688
|
+
value: "ft-mi",
|
|
1689
|
+
system: "imperial"
|
|
1301
1690
|
},
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
plural: "Fathoms"
|
|
1306
|
-
},
|
|
1307
|
-
to_anchor: 6
|
|
1691
|
+
mile: {
|
|
1692
|
+
value: "mile",
|
|
1693
|
+
system: "imperial"
|
|
1308
1694
|
},
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
plural: "Miles"
|
|
1313
|
-
},
|
|
1314
|
-
to_anchor: 5280
|
|
1695
|
+
yard: {
|
|
1696
|
+
value: "yard",
|
|
1697
|
+
system: "imperial"
|
|
1315
1698
|
},
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
plural: "Nautical Miles"
|
|
1320
|
-
},
|
|
1321
|
-
to_anchor: 6076.12
|
|
1699
|
+
feet: {
|
|
1700
|
+
value: "feet",
|
|
1701
|
+
system: "imperial"
|
|
1322
1702
|
}
|
|
1323
|
-
},
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1703
|
+
}, rt = [$["m-km"], $.kilometer, $.meter, $["ft-mi"], $.mile, $.feet], rs = [$["m-km"], $.kilometer, $.meter, $["ft-mi"], $.mile, $.feet], os = {
|
|
1704
|
+
distance: {
|
|
1705
|
+
value: "distance",
|
|
1706
|
+
mode: Mt
|
|
1327
1707
|
},
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
metric: {
|
|
1336
|
-
ratio: 1 / 3.28084
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1708
|
+
buffer: {
|
|
1709
|
+
value: "buffer",
|
|
1710
|
+
mode: ns
|
|
1711
|
+
},
|
|
1712
|
+
area: {
|
|
1713
|
+
value: "area",
|
|
1714
|
+
mode: ts
|
|
1339
1715
|
}
|
|
1340
|
-
},
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
unit: r,
|
|
1349
|
-
locale: a
|
|
1350
|
-
}) {
|
|
1351
|
-
return `${dt(Et(t, r), a, {
|
|
1352
|
-
style: "unit",
|
|
1353
|
-
unit: Rr[r],
|
|
1354
|
-
unitDisplay: "short"
|
|
1355
|
-
})}`;
|
|
1356
|
-
}
|
|
1357
|
-
function tn(t, {
|
|
1358
|
-
hasDoubleClickZoom: r
|
|
1359
|
-
}) {
|
|
1360
|
-
return typeof t == "boolean" ? { doubleClickZoom: r } : { ...t, doubleClickZoom: r };
|
|
1361
|
-
}
|
|
1362
|
-
function rn({
|
|
1363
|
-
mapId: t,
|
|
1364
|
-
defaultProps: { styles: r = _r.styles } = {},
|
|
1365
|
-
layerProps: a = {}
|
|
1716
|
+
}, as = {
|
|
1717
|
+
distance: rt,
|
|
1718
|
+
buffer: rt,
|
|
1719
|
+
area: rs
|
|
1720
|
+
};
|
|
1721
|
+
function ls({
|
|
1722
|
+
mode: n,
|
|
1723
|
+
...e
|
|
1366
1724
|
}) {
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
const re = W.positions;
|
|
1371
|
-
re?.length && m(re);
|
|
1372
|
-
},
|
|
1373
|
-
[y, c, m]
|
|
1374
|
-
);
|
|
1375
|
-
if (ot(() => {
|
|
1376
|
-
s || (_.current = void 0);
|
|
1377
|
-
}, [s]), !s || !E)
|
|
1378
|
-
return null;
|
|
1379
|
-
const { pickable: A, onHover: U, ...j } = Wr(
|
|
1380
|
-
a,
|
|
1381
|
-
f,
|
|
1382
|
-
o,
|
|
1383
|
-
h,
|
|
1384
|
-
v || Re.guide
|
|
1385
|
-
);
|
|
1386
|
-
return !_.current && !j.mode && (_.current = new Pr()), new Tr({
|
|
1387
|
-
...j,
|
|
1388
|
-
pickable: A || !l,
|
|
1389
|
-
onHover: l ? U : void 0,
|
|
1390
|
-
mode: j?.mode || _.current,
|
|
1391
|
-
eventManager: b
|
|
1725
|
+
const t = cs({
|
|
1726
|
+
mode: n,
|
|
1727
|
+
...e
|
|
1392
1728
|
});
|
|
1729
|
+
return {
|
|
1730
|
+
type: lt,
|
|
1731
|
+
props: {
|
|
1732
|
+
...t,
|
|
1733
|
+
mode: n,
|
|
1734
|
+
data: []
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1393
1737
|
}
|
|
1394
|
-
function
|
|
1395
|
-
|
|
1738
|
+
function cs({
|
|
1739
|
+
mode: n,
|
|
1740
|
+
layerProps: e,
|
|
1741
|
+
locale: t,
|
|
1742
|
+
enabled: s,
|
|
1743
|
+
unit: i,
|
|
1744
|
+
onEdit: r,
|
|
1745
|
+
guideColor: o,
|
|
1746
|
+
pointColor: a,
|
|
1747
|
+
textOptions: l
|
|
1748
|
+
}) {
|
|
1749
|
+
const u = ye(e, {
|
|
1750
|
+
visible: s,
|
|
1751
|
+
pickable: s,
|
|
1396
1752
|
modeConfig: {
|
|
1397
1753
|
// We force distance due to conversion is addressed at feature getText level
|
|
1398
|
-
formatTooltip: (
|
|
1754
|
+
formatTooltip: (y) => y,
|
|
1399
1755
|
turfOptions: {
|
|
1400
|
-
units:
|
|
1756
|
+
units: is.meters
|
|
1401
1757
|
}
|
|
1402
1758
|
},
|
|
1403
|
-
|
|
1759
|
+
...s && {
|
|
1760
|
+
onEdit: r
|
|
1761
|
+
},
|
|
1404
1762
|
_subLayerProps: {
|
|
1405
1763
|
tooltips: {
|
|
1406
|
-
getText: (
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1764
|
+
getText: (y) => {
|
|
1765
|
+
var c;
|
|
1766
|
+
return (c = n == null ? void 0 : n.getTooltipText) == null ? void 0 : c.call(n, {
|
|
1767
|
+
meters: y.text,
|
|
1768
|
+
locale: t,
|
|
1769
|
+
unit: i,
|
|
1770
|
+
options: l
|
|
1771
|
+
});
|
|
1772
|
+
},
|
|
1412
1773
|
updateTriggers: {
|
|
1413
|
-
getText: [
|
|
1774
|
+
getText: [i, t, l]
|
|
1414
1775
|
}
|
|
1415
1776
|
}
|
|
1416
1777
|
}
|
|
1417
|
-
}),
|
|
1778
|
+
}), d = ye(ss, {
|
|
1418
1779
|
_subLayerProps: {
|
|
1419
1780
|
guides: {
|
|
1420
1781
|
getLineColor: o,
|
|
1421
|
-
getFillColor: o
|
|
1782
|
+
getFillColor: o.with(3, 20)
|
|
1422
1783
|
}
|
|
1423
1784
|
},
|
|
1424
|
-
getEditHandlePointColor:
|
|
1785
|
+
getEditHandlePointColor: a,
|
|
1425
1786
|
getEditHandlePointOutlineColor: o
|
|
1426
1787
|
});
|
|
1427
|
-
return
|
|
1788
|
+
return ye(d, u);
|
|
1789
|
+
}
|
|
1790
|
+
const us = (n) => qe()((e) => ({
|
|
1791
|
+
measurements: n.reduce((s, i) => {
|
|
1792
|
+
const {
|
|
1793
|
+
mapId: r,
|
|
1794
|
+
modeSelected: o,
|
|
1795
|
+
modes: a = os,
|
|
1796
|
+
units: l = as,
|
|
1797
|
+
distance: u = 0,
|
|
1798
|
+
finished: d = !1,
|
|
1799
|
+
locale: p = "en",
|
|
1800
|
+
positions: y = [],
|
|
1801
|
+
clearLayerOnStart: c = !1,
|
|
1802
|
+
unit: m = Ve["m-km"],
|
|
1803
|
+
enabled: h = !1
|
|
1804
|
+
} = i;
|
|
1805
|
+
return s[r] = {
|
|
1806
|
+
modes: a,
|
|
1807
|
+
units: l,
|
|
1808
|
+
modeSelected: o,
|
|
1809
|
+
distance: u,
|
|
1810
|
+
finished: d,
|
|
1811
|
+
locale: p,
|
|
1812
|
+
positions: y,
|
|
1813
|
+
unit: m,
|
|
1814
|
+
clearLayerOnStart: c,
|
|
1815
|
+
enabled: h
|
|
1816
|
+
}, s;
|
|
1817
|
+
}, {}),
|
|
1818
|
+
mode: Mt,
|
|
1819
|
+
setModeInstance: (s, i) => {
|
|
1820
|
+
e((r) => ({
|
|
1821
|
+
measurements: {
|
|
1822
|
+
...r.measurements,
|
|
1823
|
+
[s]: {
|
|
1824
|
+
...r.measurements[s],
|
|
1825
|
+
modeInstance: i
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}));
|
|
1829
|
+
},
|
|
1830
|
+
setModeSelected: (s, i) => {
|
|
1831
|
+
e((r) => ({
|
|
1832
|
+
measurements: {
|
|
1833
|
+
...r.measurements,
|
|
1834
|
+
[s]: {
|
|
1835
|
+
...r.measurements[s],
|
|
1836
|
+
modeSelected: i
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}));
|
|
1840
|
+
},
|
|
1841
|
+
setFinished: (s, i) => {
|
|
1842
|
+
e((r) => ({
|
|
1843
|
+
measurements: {
|
|
1844
|
+
...r.measurements,
|
|
1845
|
+
[s]: {
|
|
1846
|
+
...r.measurements[s],
|
|
1847
|
+
finished: i
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
}));
|
|
1851
|
+
},
|
|
1852
|
+
setDistance: (s, i) => {
|
|
1853
|
+
e((r) => ({
|
|
1854
|
+
measurements: {
|
|
1855
|
+
...r.measurements,
|
|
1856
|
+
[s]: {
|
|
1857
|
+
...r.measurements[s],
|
|
1858
|
+
distance: i
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
}));
|
|
1862
|
+
},
|
|
1863
|
+
setUnit: (s, i) => {
|
|
1864
|
+
e((r) => ({
|
|
1865
|
+
measurements: {
|
|
1866
|
+
...r.measurements,
|
|
1867
|
+
[s]: {
|
|
1868
|
+
...r.measurements[s],
|
|
1869
|
+
unit: i
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
}));
|
|
1873
|
+
},
|
|
1874
|
+
setLocale: (s, i) => {
|
|
1875
|
+
e((r) => ({
|
|
1876
|
+
measurements: {
|
|
1877
|
+
...r.measurements,
|
|
1878
|
+
[s]: {
|
|
1879
|
+
...r.measurements[s],
|
|
1880
|
+
locale: i
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
}));
|
|
1884
|
+
},
|
|
1885
|
+
setPositions: (s, i) => {
|
|
1886
|
+
e((r) => ({
|
|
1887
|
+
measurements: {
|
|
1888
|
+
...r.measurements,
|
|
1889
|
+
[s]: {
|
|
1890
|
+
...r.measurements[s],
|
|
1891
|
+
positions: [...i]
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
}));
|
|
1895
|
+
},
|
|
1896
|
+
setEnable: (s, i) => {
|
|
1897
|
+
e((r) => ({
|
|
1898
|
+
measurements: {
|
|
1899
|
+
...r.measurements,
|
|
1900
|
+
[s]: {
|
|
1901
|
+
...r.measurements[s],
|
|
1902
|
+
enabled: i
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}));
|
|
1906
|
+
}
|
|
1907
|
+
})), Et = Ne({});
|
|
1908
|
+
function Js(n) {
|
|
1909
|
+
const e = ee(5), {
|
|
1910
|
+
children: t,
|
|
1911
|
+
values: s
|
|
1912
|
+
} = n;
|
|
1913
|
+
let i;
|
|
1914
|
+
e[0] !== s ? (i = us(s), e[0] = s, e[1] = i) : i = e[1];
|
|
1915
|
+
const [r] = pe(i);
|
|
1916
|
+
let o;
|
|
1917
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(Et.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
1918
|
+
}
|
|
1919
|
+
function T(n) {
|
|
1920
|
+
const e = $e(Et);
|
|
1921
|
+
if (!e)
|
|
1922
|
+
throw new Error("Missing Map.Provider in the tree");
|
|
1923
|
+
return Ge(e, n);
|
|
1428
1924
|
}
|
|
1429
|
-
function
|
|
1925
|
+
function Lt(n) {
|
|
1926
|
+
const e = ee(73), {
|
|
1927
|
+
mapId: t
|
|
1928
|
+
} = n;
|
|
1929
|
+
let s;
|
|
1930
|
+
e[0] !== t ? (s = (M) => M.measurements[t].modes, e[0] = t, e[1] = s) : s = e[1];
|
|
1931
|
+
const i = T(s);
|
|
1932
|
+
let r;
|
|
1933
|
+
e[2] !== t ? (r = (M) => M.measurements[t].units, e[2] = t, e[3] = r) : r = e[3];
|
|
1934
|
+
const o = T(r);
|
|
1935
|
+
let a;
|
|
1936
|
+
e[4] !== t ? (a = (M) => M.measurements[t].distance, e[4] = t, e[5] = a) : a = e[5];
|
|
1937
|
+
const l = T(a), u = T(Ss);
|
|
1938
|
+
let d;
|
|
1939
|
+
e[6] !== u || e[7] !== t ? (d = (M) => u(t, M), e[6] = u, e[7] = t, e[8] = d) : d = e[8];
|
|
1940
|
+
const p = d;
|
|
1941
|
+
let y;
|
|
1942
|
+
e[9] !== t ? (y = (M) => M.measurements[t].clearLayerOnStart, e[9] = t, e[10] = y) : y = e[10];
|
|
1943
|
+
const c = T(y);
|
|
1944
|
+
let m;
|
|
1945
|
+
e[11] !== t ? (m = (M) => M.measurements[t].modeSelected, e[11] = t, e[12] = m) : m = e[12];
|
|
1946
|
+
const h = T(m), f = T(gs);
|
|
1947
|
+
let S;
|
|
1948
|
+
e[13] !== f || e[14] !== t ? (S = (M) => f(t, M), e[13] = f, e[14] = t, e[15] = S) : S = e[15];
|
|
1949
|
+
const v = S;
|
|
1950
|
+
let E;
|
|
1951
|
+
e[16] !== t ? (E = (M) => M.measurements[t].enabled, e[16] = t, e[17] = E) : E = e[17];
|
|
1952
|
+
const b = T(E), _ = T(ys);
|
|
1953
|
+
let P;
|
|
1954
|
+
e[18] !== _ || e[19] !== t ? (P = (M) => _(t, M), e[18] = _, e[19] = t, e[20] = P) : P = e[20];
|
|
1955
|
+
const g = P;
|
|
1956
|
+
let L;
|
|
1957
|
+
e[21] !== t ? (L = (M) => M.measurements[t].finished, e[21] = t, e[22] = L) : L = e[22];
|
|
1958
|
+
const w = T(L), F = T(hs);
|
|
1959
|
+
let A;
|
|
1960
|
+
e[23] !== F || e[24] !== t ? (A = (M) => F(t, M), e[23] = F, e[24] = t, e[25] = A) : A = e[25];
|
|
1961
|
+
const D = A;
|
|
1962
|
+
let U;
|
|
1963
|
+
e[26] !== t ? (U = (M) => M.measurements[t].locale, e[26] = t, e[27] = U) : U = e[27];
|
|
1964
|
+
const Y = T(U), V = T(ps);
|
|
1965
|
+
let R;
|
|
1966
|
+
e[28] !== V || e[29] !== t ? (R = (M) => V(t, M), e[28] = V, e[29] = t, e[30] = R) : R = e[30];
|
|
1967
|
+
const x = R;
|
|
1968
|
+
let te;
|
|
1969
|
+
e[31] !== t ? (te = (M) => M.measurements[t].modeInstance, e[31] = t, e[32] = te) : te = e[32];
|
|
1970
|
+
const N = T(te), Se = T(ms);
|
|
1971
|
+
let B;
|
|
1972
|
+
e[33] !== Se || e[34] !== t ? (B = (M) => Se(t, M), e[33] = Se, e[34] = t, e[35] = B) : B = e[35];
|
|
1973
|
+
const he = B;
|
|
1974
|
+
let X;
|
|
1975
|
+
e[36] !== t ? (X = (M) => M.measurements[t].positions, e[36] = t, e[37] = X) : X = e[37];
|
|
1976
|
+
const ue = T(X), ne = T(fs);
|
|
1977
|
+
let se;
|
|
1978
|
+
e[38] !== ne || e[39] !== t ? (se = (M) => ne(t, M), e[38] = ne, e[39] = t, e[40] = se) : se = e[40];
|
|
1979
|
+
const H = se;
|
|
1980
|
+
let ie;
|
|
1981
|
+
e[41] !== t ? (ie = (M) => M.measurements[t].unit, e[41] = t, e[42] = ie) : ie = e[42];
|
|
1982
|
+
const re = T(ie), oe = T(ds);
|
|
1983
|
+
let J;
|
|
1984
|
+
e[43] !== oe || e[44] !== t ? (J = (M) => oe(t, M), e[43] = oe, e[44] = t, e[45] = J) : J = e[45];
|
|
1985
|
+
const I = J;
|
|
1986
|
+
let j;
|
|
1987
|
+
e[46] !== N || e[47] !== H ? (j = () => {
|
|
1988
|
+
N == null || N.resetClickSequence(), H([]);
|
|
1989
|
+
}, e[46] = N, e[47] = H, e[48] = j) : j = e[48];
|
|
1990
|
+
const W = j;
|
|
1991
|
+
let z;
|
|
1992
|
+
e[49] !== g ? (z = (M) => {
|
|
1993
|
+
g(M);
|
|
1994
|
+
}, e[49] = g, e[50] = z) : z = e[50];
|
|
1995
|
+
const ae = z;
|
|
1996
|
+
let de;
|
|
1997
|
+
return e[51] !== W || e[52] !== c || e[53] !== l || e[54] !== b || e[55] !== w || e[56] !== Y || e[57] !== N || e[58] !== h || e[59] !== i || e[60] !== ue || e[61] !== p || e[62] !== g || e[63] !== D || e[64] !== x || e[65] !== he || e[66] !== v || e[67] !== H || e[68] !== I || e[69] !== ae || e[70] !== re || e[71] !== o ? (de = {
|
|
1998
|
+
modes: i,
|
|
1999
|
+
units: o,
|
|
2000
|
+
distance: l,
|
|
2001
|
+
clearLayerOnStart: c,
|
|
2002
|
+
modeSelected: h,
|
|
2003
|
+
enabled: b,
|
|
2004
|
+
finished: w,
|
|
2005
|
+
locale: Y,
|
|
2006
|
+
modeInstance: N,
|
|
2007
|
+
positions: ue,
|
|
2008
|
+
unit: re,
|
|
2009
|
+
setDistance: p,
|
|
2010
|
+
setModeSelected: v,
|
|
2011
|
+
setFinished: D,
|
|
2012
|
+
setLocale: x,
|
|
2013
|
+
setPositions: H,
|
|
2014
|
+
setUnit: I,
|
|
2015
|
+
setEnable: g,
|
|
2016
|
+
toggleLayer: ae,
|
|
2017
|
+
clearLayer: W,
|
|
2018
|
+
setModeInstance: he
|
|
2019
|
+
}, e[51] = W, e[52] = c, e[53] = l, e[54] = b, e[55] = w, e[56] = Y, e[57] = N, e[58] = h, e[59] = i, e[60] = ue, e[61] = p, e[62] = g, e[63] = D, e[64] = x, e[65] = he, e[66] = v, e[67] = H, e[68] = I, e[69] = ae, e[70] = re, e[71] = o, e[72] = de) : de = e[72], de;
|
|
2020
|
+
}
|
|
2021
|
+
function ds(n) {
|
|
2022
|
+
return n.setUnit;
|
|
2023
|
+
}
|
|
2024
|
+
function fs(n) {
|
|
2025
|
+
return n.setPositions;
|
|
2026
|
+
}
|
|
2027
|
+
function ms(n) {
|
|
2028
|
+
return n.setModeInstance;
|
|
2029
|
+
}
|
|
2030
|
+
function ps(n) {
|
|
2031
|
+
return n.setLocale;
|
|
2032
|
+
}
|
|
2033
|
+
function hs(n) {
|
|
2034
|
+
return n.setFinished;
|
|
2035
|
+
}
|
|
2036
|
+
function ys(n) {
|
|
2037
|
+
return n.setEnable;
|
|
2038
|
+
}
|
|
2039
|
+
function gs(n) {
|
|
2040
|
+
return n.setModeSelected;
|
|
2041
|
+
}
|
|
2042
|
+
function Ss(n) {
|
|
2043
|
+
return n.setDistance;
|
|
2044
|
+
}
|
|
2045
|
+
function vs(n) {
|
|
2046
|
+
const e = ee(38), {
|
|
2047
|
+
mapId: t,
|
|
2048
|
+
textOptions: s,
|
|
2049
|
+
children: i
|
|
2050
|
+
} = n;
|
|
2051
|
+
let r;
|
|
2052
|
+
e[0] !== t ? (r = {
|
|
2053
|
+
mapId: t
|
|
2054
|
+
}, e[0] = t, e[1] = r) : r = e[1];
|
|
1430
2055
|
const {
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
positions:
|
|
1447
|
-
|
|
2056
|
+
modes: o,
|
|
2057
|
+
units: a,
|
|
2058
|
+
distance: l,
|
|
2059
|
+
setDistance: u,
|
|
2060
|
+
clearLayerOnStart: d,
|
|
2061
|
+
modeSelected: p,
|
|
2062
|
+
setModeSelected: y,
|
|
2063
|
+
enabled: c,
|
|
2064
|
+
setEnable: m,
|
|
2065
|
+
finished: h,
|
|
2066
|
+
setFinished: f,
|
|
2067
|
+
locale: S,
|
|
2068
|
+
setLocale: v,
|
|
2069
|
+
modeInstance: E,
|
|
2070
|
+
setModeInstance: b,
|
|
2071
|
+
positions: _,
|
|
2072
|
+
setPositions: P,
|
|
2073
|
+
unit: g,
|
|
2074
|
+
setUnit: L,
|
|
2075
|
+
clearLayer: w,
|
|
2076
|
+
toggleLayer: F
|
|
2077
|
+
} = Lt(r);
|
|
2078
|
+
let A, D;
|
|
2079
|
+
e[2] !== p || e[3] !== o || e[4] !== m || e[5] !== b || e[6] !== P ? (A = () => {
|
|
2080
|
+
if (p && o[p]) {
|
|
2081
|
+
const x = o[p].mode;
|
|
2082
|
+
b(new x()), m(!0);
|
|
2083
|
+
}
|
|
2084
|
+
return () => {
|
|
2085
|
+
P([]);
|
|
2086
|
+
};
|
|
2087
|
+
}, D = [o, p, P, b, m], e[2] = p, e[3] = o, e[4] = m, e[5] = b, e[6] = P, e[7] = A, e[8] = D) : (A = e[7], D = e[8]), ce(A, D);
|
|
2088
|
+
let U;
|
|
2089
|
+
e[9] !== F || e[10] !== w || e[11] !== d || e[12] !== h ? (U = (x) => {
|
|
2090
|
+
x && (d || !h) && w(), F(x);
|
|
2091
|
+
}, e[9] = F, e[10] = w, e[11] = d, e[12] = h, e[13] = U) : U = e[13];
|
|
2092
|
+
const Y = U, V = !!d;
|
|
2093
|
+
let R;
|
|
2094
|
+
return e[14] !== i || e[15] !== w || e[16] !== l || e[17] !== c || e[18] !== h || e[19] !== S || e[20] !== t || e[21] !== E || e[22] !== p || e[23] !== o || e[24] !== _ || e[25] !== u || e[26] !== m || e[27] !== f || e[28] !== v || e[29] !== y || e[30] !== P || e[31] !== L || e[32] !== V || e[33] !== s || e[34] !== Y || e[35] !== g || e[36] !== a ? (R = i({
|
|
2095
|
+
mapId: t,
|
|
2096
|
+
distance: l,
|
|
2097
|
+
enabled: c,
|
|
2098
|
+
finished: h,
|
|
2099
|
+
locale: S,
|
|
2100
|
+
positions: _,
|
|
2101
|
+
unit: g,
|
|
2102
|
+
clearLayerOnStart: V,
|
|
2103
|
+
modeSelected: p,
|
|
2104
|
+
modes: o,
|
|
2105
|
+
units: a,
|
|
2106
|
+
value: ke({
|
|
2107
|
+
meters: l,
|
|
2108
|
+
unit: g,
|
|
2109
|
+
locale: S,
|
|
2110
|
+
options: s
|
|
2111
|
+
}),
|
|
2112
|
+
modeInstance: E,
|
|
2113
|
+
setModeSelected: y,
|
|
2114
|
+
setDistance: u,
|
|
2115
|
+
setFinished: f,
|
|
2116
|
+
setLocale: v,
|
|
2117
|
+
setPositions: P,
|
|
2118
|
+
setUnit: L,
|
|
2119
|
+
setEnable: m,
|
|
2120
|
+
toggleLayer: Y,
|
|
2121
|
+
clearLayer: w
|
|
2122
|
+
}), e[14] = i, e[15] = w, e[16] = l, e[17] = c, e[18] = h, e[19] = S, e[20] = t, e[21] = E, e[22] = p, e[23] = o, e[24] = _, e[25] = u, e[26] = m, e[27] = f, e[28] = v, e[29] = y, e[30] = P, e[31] = L, e[32] = V, e[33] = s, e[34] = Y, e[35] = g, e[36] = a, e[37] = R) : R = e[37], R;
|
|
1448
2123
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
2124
|
+
function Ms({
|
|
2125
|
+
children: n,
|
|
2126
|
+
mapId: e,
|
|
2127
|
+
defaultProps: {
|
|
2128
|
+
styles: t = st.styles
|
|
2129
|
+
} = {
|
|
2130
|
+
styles: st.styles
|
|
2131
|
+
},
|
|
2132
|
+
layerProps: s = {},
|
|
2133
|
+
textOptions: i
|
|
2134
|
+
}) {
|
|
2135
|
+
const {
|
|
2136
|
+
setDistance: r,
|
|
2137
|
+
clearLayerOnStart: o,
|
|
2138
|
+
enabled: a,
|
|
2139
|
+
finished: l,
|
|
2140
|
+
setFinished: u,
|
|
2141
|
+
locale: d,
|
|
2142
|
+
setPositions: p,
|
|
2143
|
+
unit: y,
|
|
2144
|
+
modeInstance: c
|
|
2145
|
+
} = Lt({
|
|
2146
|
+
mapId: e
|
|
2147
|
+
}), m = Be((v) => v.setLayer), h = k((v) => v.addLayers), f = k((v) => v.removeLayers);
|
|
2148
|
+
ce(() => (a && h(e, [Te]), () => {
|
|
2149
|
+
f(e, [Te]);
|
|
2150
|
+
}), [h, o, e, f, a]);
|
|
2151
|
+
const S = q(({
|
|
2152
|
+
editType: v,
|
|
2153
|
+
editContext: E
|
|
2154
|
+
}) => {
|
|
2155
|
+
if (v === G.cancel) {
|
|
2156
|
+
c.resetClickSequence();
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
2159
|
+
v === G.addPosition && r(E.distance), u(!!E.finished);
|
|
2160
|
+
const b = E.positions;
|
|
2161
|
+
b != null && b.length && p(b);
|
|
2162
|
+
}, [c, r, u, p]);
|
|
2163
|
+
return ce(() => {
|
|
2164
|
+
const v = l ? t.colors.finished : t.colors.editing, E = l ? t.colors.finished : t.colors.point, b = ls({
|
|
2165
|
+
layerProps: {
|
|
2166
|
+
...s,
|
|
2167
|
+
pickable: s.pickable ?? !l
|
|
2168
|
+
},
|
|
2169
|
+
enabled: a,
|
|
2170
|
+
guideColor: v,
|
|
2171
|
+
pointColor: E,
|
|
2172
|
+
locale: d,
|
|
2173
|
+
onEdit: S,
|
|
2174
|
+
unit: y,
|
|
2175
|
+
mode: c,
|
|
2176
|
+
textOptions: i
|
|
2177
|
+
});
|
|
2178
|
+
m(Te, b);
|
|
2179
|
+
}, [l, c, s, d, S, m, t.colors.editing, t.colors.finished, t.colors.point, i, y, a]), n;
|
|
2180
|
+
}
|
|
2181
|
+
Ms.Controls = vs;
|
|
2182
|
+
function Es(n) {
|
|
2183
|
+
const e = ee(7), {
|
|
2184
|
+
id: t
|
|
2185
|
+
} = n;
|
|
2186
|
+
let s;
|
|
2187
|
+
e[0] !== t ? (s = (u) => u.maps[t], e[0] = t, e[1] = s) : s = e[1];
|
|
2188
|
+
const {
|
|
2189
|
+
layers: i
|
|
2190
|
+
} = k(s), r = Be(bs);
|
|
2191
|
+
let o, a;
|
|
2192
|
+
if (e[2] !== r || e[3] !== i) {
|
|
2193
|
+
let u;
|
|
2194
|
+
e[5] !== r ? (u = (d) => r[d], e[5] = r, e[6] = u) : u = e[6], a = i.map(u).filter(Ls), e[2] = r, e[3] = i, e[4] = a;
|
|
2195
|
+
} else
|
|
2196
|
+
a = e[4];
|
|
2197
|
+
return o = a, o;
|
|
2198
|
+
}
|
|
2199
|
+
function Ls(n) {
|
|
2200
|
+
return !!n;
|
|
2201
|
+
}
|
|
2202
|
+
function bs(n) {
|
|
2203
|
+
return n.layers;
|
|
2204
|
+
}
|
|
2205
|
+
function Qs({
|
|
2206
|
+
id: n,
|
|
2207
|
+
onLoad: e,
|
|
2208
|
+
onViewStateChange: t,
|
|
2209
|
+
...s
|
|
2210
|
+
}) {
|
|
2211
|
+
const {
|
|
2212
|
+
basemap: i,
|
|
2213
|
+
instanceRef: r,
|
|
2214
|
+
overlayRef: o
|
|
2215
|
+
} = k((f) => f.maps[n]), a = k((f) => f.viewStates[n]), l = k((f) => f.setViewState), u = k((f) => f.setLoad), d = k((f) => f.setLayersLoad), p = Es({
|
|
2216
|
+
id: n
|
|
2217
|
+
}), y = Me(() => p.sort((f, S) => (f.order ?? 1 / 0) - (S.order ?? 1 / 0)), [p]), c = q((f) => {
|
|
2218
|
+
const S = l;
|
|
2219
|
+
if (t) {
|
|
2220
|
+
t(f, S);
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
S(n, f.viewState);
|
|
2224
|
+
}, [n, t, l]), m = q((f) => {
|
|
2225
|
+
u(n, f), e == null || e(f);
|
|
2226
|
+
}, [n, e, u]), h = q((f) => {
|
|
2227
|
+
var E, b, _;
|
|
2228
|
+
const S = (b = (E = r == null ? void 0 : r.current) == null ? void 0 : E.deck) == null ? void 0 : b.props.layers, v = !!(S != null && S.every((P) => P == null ? void 0 : P.isLoaded));
|
|
2229
|
+
d(n, v), (_ = s.onAfterRender) == null || _.call(s, f);
|
|
2230
|
+
}, [n, r, s, d]);
|
|
2231
|
+
return /* @__PURE__ */ Z(sn, { ...s, layers: y, instanceRef: r, overlayRef: o, basemap: i, initialViewState: a, onLoad: m, onViewStateChange: c, onAfterRender: h });
|
|
2232
|
+
}
|
|
2233
|
+
const ws = "https://gcp-us-east1.api.carto.com", _s = "ps", ei = ct((n) => ({
|
|
2234
|
+
sources: {},
|
|
2235
|
+
setSource: (e, t) => n((s) => {
|
|
2236
|
+
const i = {
|
|
2237
|
+
...s.sources
|
|
2238
|
+
};
|
|
2239
|
+
if (!t)
|
|
2240
|
+
return delete i[e], {
|
|
2241
|
+
sources: i
|
|
2242
|
+
};
|
|
2243
|
+
const {
|
|
2244
|
+
apiBaseUrl: r = ws,
|
|
2245
|
+
clientId: o = _s,
|
|
2246
|
+
...a
|
|
2247
|
+
} = t, l = i[e] ?? {
|
|
2248
|
+
apiBaseUrl: r,
|
|
2249
|
+
clientId: o
|
|
2250
|
+
};
|
|
2251
|
+
return i[e] = {
|
|
2252
|
+
...l,
|
|
2253
|
+
...a
|
|
2254
|
+
}, {
|
|
2255
|
+
sources: i
|
|
2256
|
+
};
|
|
2257
|
+
})
|
|
2258
|
+
}));
|
|
2259
|
+
function ti({
|
|
2260
|
+
mapId: n
|
|
2261
|
+
}) {
|
|
2262
|
+
const [e, t] = pe(void 0), [s, i] = pe(!1), r = k((h) => {
|
|
2263
|
+
var f;
|
|
2264
|
+
return (f = h.maps[n]) == null ? void 0 : f.basemap;
|
|
2265
|
+
}), o = k((h) => h.getDeckInstance(n)), a = k((h) => h.getOverlayInstance(n)), l = k((h) => {
|
|
2266
|
+
var f;
|
|
2267
|
+
return (f = h.maps[n]) == null ? void 0 : f.areLayersLoaded;
|
|
2268
|
+
}), d = k((h) => {
|
|
2269
|
+
var f;
|
|
2270
|
+
return (f = h.maps[n]) == null ? void 0 : f.isLoaded;
|
|
2271
|
+
}) && l, {
|
|
2272
|
+
type: p
|
|
2273
|
+
} = dt[r], y = p === le.googleMaps, c = q(async () => {
|
|
2274
|
+
try {
|
|
2275
|
+
const h = document.createElement("canvas");
|
|
2276
|
+
h.width = o.width ?? 0, h.height = o.height ?? 0;
|
|
2277
|
+
const f = h.getContext("2d");
|
|
2278
|
+
if (y) {
|
|
2279
|
+
const v = a;
|
|
2280
|
+
if (v.getRenderingType() !== "RASTER")
|
|
2281
|
+
throw new Error("Only raster type is supported for Google Maps");
|
|
2282
|
+
const E = await en(v.getDiv(), {
|
|
2283
|
+
useCORS: !0
|
|
2284
|
+
});
|
|
2285
|
+
f == null || f.drawImage(E, 0, 0, o.width, o.height);
|
|
2286
|
+
} else {
|
|
2287
|
+
const v = a;
|
|
2288
|
+
v.redraw(), f == null || f.drawImage(v.getMap().getCanvas(), 0, 0, o.width, o.height);
|
|
2289
|
+
}
|
|
2290
|
+
o == null || o.redraw("screenshot"), f == null || f.drawImage(o.getCanvas(), 0, 0, o.width, o.height);
|
|
2291
|
+
const S = h.toDataURL();
|
|
2292
|
+
t(S);
|
|
2293
|
+
} catch (h) {
|
|
2294
|
+
console.error(h);
|
|
2295
|
+
} finally {
|
|
2296
|
+
i(!1);
|
|
2297
|
+
}
|
|
2298
|
+
}, [o, y, a]);
|
|
1451
2299
|
return {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
...t,
|
|
1459
|
-
finished: a
|
|
1460
|
-
}),
|
|
1461
|
-
SET_DISTANCE: () => ({
|
|
1462
|
-
...t,
|
|
1463
|
-
distance: a
|
|
1464
|
-
}),
|
|
1465
|
-
SET_UNIT: () => ({
|
|
1466
|
-
...t,
|
|
1467
|
-
unit: a
|
|
1468
|
-
}),
|
|
1469
|
-
SET_LOCALE: () => ({
|
|
1470
|
-
...t,
|
|
1471
|
-
locale: a
|
|
1472
|
-
}),
|
|
1473
|
-
SET_POSITIONS: () => ({
|
|
1474
|
-
...t,
|
|
1475
|
-
positions: a
|
|
1476
|
-
})
|
|
1477
|
-
}[r]?.() ?? t;
|
|
2300
|
+
takeScreenshot: q(() => {
|
|
2301
|
+
i(!0), d && c();
|
|
2302
|
+
}, [c, d]),
|
|
2303
|
+
isLoading: s,
|
|
2304
|
+
screenshot: e
|
|
2305
|
+
};
|
|
1478
2306
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2307
|
+
const me = {
|
|
2308
|
+
currency: "CURRENCY",
|
|
2309
|
+
default: "DEFAULT",
|
|
2310
|
+
number: "NUMBER"
|
|
2311
|
+
}, ot = {
|
|
2312
|
+
[me.currency]: {
|
|
2313
|
+
type: me.currency,
|
|
2314
|
+
format: (n, e) => Xt(n, e)
|
|
2315
|
+
},
|
|
2316
|
+
[me.number]: {
|
|
2317
|
+
type: me.number,
|
|
2318
|
+
format: (n, e) => ut(n, e)
|
|
2319
|
+
},
|
|
2320
|
+
[me.default]: {
|
|
2321
|
+
type: me.default,
|
|
2322
|
+
format: (n) => n.toLocaleString()
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
function ni({
|
|
2326
|
+
properties: n,
|
|
2327
|
+
formatters: e = {},
|
|
2328
|
+
includeColumns: t = Object.keys(n),
|
|
2329
|
+
locale: s = "en-US",
|
|
2330
|
+
showColumnName: i = !0,
|
|
2331
|
+
title: r,
|
|
2332
|
+
getColumnName: o = Fs,
|
|
2333
|
+
getFieldHtml: a = Cs,
|
|
2334
|
+
getTitle: l = Ps,
|
|
2335
|
+
getValue: u = Ts
|
|
1483
2336
|
}) {
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
2337
|
+
const d = r ? l(r) : "", y = t.reduce((c, m) => {
|
|
2338
|
+
const h = e[m], f = n[m], S = u(f, s, h), v = i ? o(m) : "";
|
|
2339
|
+
return c + a(v, S);
|
|
2340
|
+
}, "");
|
|
2341
|
+
return d + y;
|
|
2342
|
+
}
|
|
2343
|
+
function Ps(n) {
|
|
2344
|
+
return `<h3 style="margin: 0"><strong>${n}</strong></h3></br>`;
|
|
2345
|
+
}
|
|
2346
|
+
function Cs(n, e) {
|
|
2347
|
+
return `${n}${e}</br>`;
|
|
2348
|
+
}
|
|
2349
|
+
function Ts(n, e, t) {
|
|
2350
|
+
try {
|
|
2351
|
+
return ks(t)(n, e);
|
|
2352
|
+
} catch {
|
|
2353
|
+
return n;
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
function ks(n) {
|
|
2357
|
+
return typeof n == "function" ? n : ((n && ot[n]) ?? ot[me.default]).format;
|
|
2358
|
+
}
|
|
2359
|
+
function Fs(n) {
|
|
2360
|
+
return `<strong>${n}</strong>: `;
|
|
2361
|
+
}
|
|
2362
|
+
function si(n) {
|
|
2363
|
+
const e = ee(18), {
|
|
2364
|
+
children: t,
|
|
2365
|
+
id: s
|
|
2366
|
+
} = n;
|
|
2367
|
+
let i;
|
|
2368
|
+
e[0] !== s ? (i = (v) => v.viewStates[s], e[0] = s, e[1] = i) : i = e[1];
|
|
2369
|
+
const {
|
|
2370
|
+
zoom: r,
|
|
2371
|
+
maxZoom: o,
|
|
2372
|
+
minZoom: a
|
|
2373
|
+
} = k(i);
|
|
2374
|
+
let l;
|
|
2375
|
+
e[2] !== s ? (l = (v) => v.maps[s].areLayersLoaded, e[2] = s, e[3] = l) : l = e[3];
|
|
2376
|
+
const u = k(l), d = k(Os), p = k(As), y = !u;
|
|
2377
|
+
let c;
|
|
2378
|
+
e[4] !== s || e[5] !== d ? (c = (v) => d(s, v), e[4] = s, e[5] = d, e[6] = c) : c = e[6];
|
|
2379
|
+
const m = c;
|
|
2380
|
+
let h;
|
|
2381
|
+
e[7] !== p || e[8] !== s ? (h = (v) => p(s, v), e[7] = p, e[8] = s, e[9] = h) : h = e[9];
|
|
2382
|
+
const f = h;
|
|
2383
|
+
let S;
|
|
2384
|
+
return e[10] !== t || e[11] !== o || e[12] !== a || e[13] !== y || e[14] !== m || e[15] !== f || e[16] !== r ? (S = t({
|
|
2385
|
+
zoom: r,
|
|
2386
|
+
maxZoom: o,
|
|
2387
|
+
minZoom: a,
|
|
2388
|
+
isLoading: y,
|
|
2389
|
+
setZoom: m,
|
|
2390
|
+
flyTo: f
|
|
2391
|
+
}), e[10] = t, e[11] = o, e[12] = a, e[13] = y, e[14] = m, e[15] = f, e[16] = r, e[17] = S) : S = e[17], S;
|
|
2392
|
+
}
|
|
2393
|
+
function As(n) {
|
|
2394
|
+
return n.flyTo;
|
|
2395
|
+
}
|
|
2396
|
+
function Os(n) {
|
|
2397
|
+
return n.setZoom;
|
|
1530
2398
|
}
|
|
1531
2399
|
export {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
2400
|
+
ws as ApiBaseUrl,
|
|
2401
|
+
it as CONVERSIONS_UNITS,
|
|
2402
|
+
Oe as CartoBasemapURL,
|
|
2403
|
+
K as CartoBasemaps,
|
|
2404
|
+
dn as CustomCompositeEditMode,
|
|
2405
|
+
ts as CustomMeasureAreaMode,
|
|
2406
|
+
ns as CustomMeasureBufferMode,
|
|
2407
|
+
Mt as CustomMeasureDistanceMode,
|
|
2408
|
+
je as DEFAULT_LASSO_TOOLS_COLORS,
|
|
2409
|
+
mn as DEFAULT_LASSO_TOOLS_LAYER_PROPS,
|
|
2410
|
+
ze as DEFAULT_LASSO_TOOLS_MODES,
|
|
2411
|
+
Re as DEFAULT_LASSO_TOOLS_PROPS,
|
|
2412
|
+
Le as DEFAULT_MASK_LAYER_PROPS,
|
|
2413
|
+
os as DEFAULT_MEASUREMENT_TOOLS_MODES,
|
|
2414
|
+
as as DEFAULT_MEASUREMENT_TOOLS_UNITS,
|
|
2415
|
+
Ue as DEFAULT_MEASURE_COLORS,
|
|
2416
|
+
sn as DeckGLComponent,
|
|
2417
|
+
G as EditableEditType,
|
|
2418
|
+
Ae as GmapsBasemap,
|
|
2419
|
+
ve as INTL_UNITS,
|
|
2420
|
+
$n as LassoTools,
|
|
2421
|
+
Ys as LassoToolsProvider,
|
|
2422
|
+
dt as MAPS_BASEMAP,
|
|
2423
|
+
Ce as MAP_LASSO_TOOLS_LAYER_ID,
|
|
2424
|
+
fn as MAP_MASK_LAYER_ID,
|
|
2425
|
+
Te as MAP_MEASURE_LAYER_ID,
|
|
2426
|
+
rs as MEASUREMENT_TOOLS_UNITS_AREA,
|
|
2427
|
+
rt as MEASUREMENT_TOOLS_UNITS_DISTANCE,
|
|
2428
|
+
$ as MEASUREMENT_TOOLS_UNITS_DISTANCE_VALUES,
|
|
2429
|
+
Qs as MapComponent,
|
|
2430
|
+
Ve as MapMeasurementUnitAuto,
|
|
2431
|
+
is as MapMeasurementUnitTurf,
|
|
2432
|
+
Ks as MapProvider,
|
|
2433
|
+
le as MapsTypes,
|
|
2434
|
+
Ms as MeasurementTools,
|
|
2435
|
+
Js as MeasurementToolsProvider,
|
|
2436
|
+
si as ZoomControls,
|
|
2437
|
+
_s as clientID,
|
|
2438
|
+
tt as convertMetersTo,
|
|
2439
|
+
xn as createLassoToolsStore,
|
|
2440
|
+
Sn as createMapStateStore,
|
|
2441
|
+
us as createMeasurementToolsStore,
|
|
2442
|
+
me as formatterTypes,
|
|
2443
|
+
tn as getCursorDefault,
|
|
2444
|
+
Xs as getDeckController,
|
|
2445
|
+
Dn as getLassoToolsLayer,
|
|
2446
|
+
ls as getMeasurementToolsLayer,
|
|
2447
|
+
ke as getTextLayerFormattedDistance,
|
|
2448
|
+
nn as getTooltipDefault,
|
|
2449
|
+
ni as objectToHtml,
|
|
2450
|
+
pn as transitionFlyConfig,
|
|
2451
|
+
Es as useGetLayers,
|
|
2452
|
+
O as useLassoToolsState,
|
|
2453
|
+
Be as useLayers,
|
|
2454
|
+
ti as useMapScreenshot,
|
|
2455
|
+
k as useMapState,
|
|
2456
|
+
T as useMeasurementToolsState,
|
|
2457
|
+
ei as useSource
|
|
1575
2458
|
};
|
|
2459
|
+
//# sourceMappingURL=index.js.map
|