@carto/ps-react-maps 3.0.0-canary.0 → 3.0.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1226 -854
- package/dist/index.js.map +1 -1
- package/dist/types/editable/measurement-tools/provider/types.d.ts +1 -1
- package/dist/types/editable/measurement-tools/types.d.ts +1 -1
- package/dist/types/editable/measurement-tools/use-measurement-tools.d.ts +1 -1
- package/dist/types/index.d.ts +20 -7
- package/dist/types/models/categories.d.ts +7 -0
- package/dist/types/models/features.d.ts +7 -0
- package/dist/types/models/formula.d.ts +7 -0
- package/dist/types/models/histogram..d.ts +7 -0
- package/dist/types/models/range.d.ts +7 -0
- package/dist/types/models/scatter.d.ts +7 -0
- package/dist/types/models/table.d.ts +7 -0
- package/dist/types/models/time-series.d.ts +7 -0
- package/dist/types/models/types.d.ts +7 -0
- package/dist/types/models/use-widget-model.d.ts +1 -0
- package/dist/types/providers/layers/store.d.ts +1 -1
- package/dist/types/providers/layers/types.d.ts +13 -1
- package/dist/types/providers/map/provider.d.ts +2 -2
- package/dist/types/providers/map/store.d.ts +2 -2
- package/dist/types/providers/map/types.d.ts +6 -4
- package/dist/types/providers/sources/store.d.ts +3 -2
- package/dist/types/providers/sources/types.d.ts +3 -1
- package/dist/types/types.d.ts +5 -5
- package/dist/types/{use-get-layers.d.ts → use-layers.d.ts} +1 -1
- package/dist/types/use-legend.d.ts +16 -0
- package/dist/types/utils/mapping-meridian.d.ts +15 -0
- package/dist/types/utils/sort-layers.d.ts +2 -0
- package/package.json +9 -5
package/dist/index.js
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as Z, jsxs as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { DeckGL as
|
|
8
|
-
import { Map as
|
|
9
|
-
import { Map as
|
|
10
|
-
import { CompositeMode as
|
|
11
|
-
import { create as
|
|
12
|
-
import { FlyToInterpolator as
|
|
13
|
-
import { GeoJsonLayer as
|
|
14
|
-
import { DataFilterExtension as
|
|
15
|
-
import { formatNumber as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var At = (n, e, t) => e in n ? Ft(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var ee = (n, e, t) => At(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { jsx as Z, jsxs as Ot } from "react/jsx-runtime";
|
|
5
|
+
import { c as C } from "react/compiler-runtime";
|
|
6
|
+
import { useState as ge, useEffect as ce, useImperativeHandle as Rt, createContext as Ie, useContext as Be, useMemo as ue, useCallback as R, useRef as Dt } from "react";
|
|
7
|
+
import { DeckGL as xt } from "@deck.gl/react";
|
|
8
|
+
import { Map as Ut, MapProvider as qt, useMap as $t } from "react-map-gl/maplibre";
|
|
9
|
+
import { Map as Vt, APIProvider as Nt, limitTiltRange as It, useMap as Bt } from "@vis.gl/react-google-maps";
|
|
10
|
+
import { CompositeMode as Gt, TranslateMode as Ht, ModifyMode as Kt, DrawPolygonMode as Wt, DrawRectangleMode as jt, DrawCircleFromCenterMode as ut, DrawPolygonByDraggingMode as zt, EditableGeoJsonLayer as dt, MeasureAreaMode as Zt, getPickedEditHandle as Qt, MeasureDistanceMode as Yt } from "@deck.gl-community/editable-layers";
|
|
11
|
+
import { create as ft, createStore as Ge, useStore as He } from "zustand";
|
|
12
|
+
import { FlyToInterpolator as Xt, WebMercatorViewport as We } from "@deck.gl/core";
|
|
13
|
+
import { GeoJsonLayer as Jt } from "@deck.gl/layers";
|
|
14
|
+
import { DataFilterExtension as en } from "@deck.gl/extensions";
|
|
15
|
+
import { formatNumber as mt, formatCurrency as tn } from "@carto/ps-utils";
|
|
16
|
+
import nn from "convert-units";
|
|
17
|
+
import sn from "convert-units/definitions/length";
|
|
18
|
+
import { WidgetQuerySource as rn, WidgetTableSource as on, WidgetTilesetSource as an, TileFormat as ln } from "@carto/api-client";
|
|
19
|
+
import { useQuery as de } from "@tanstack/react-query";
|
|
20
|
+
import cn from "html2canvas";
|
|
21
|
+
const De = {
|
|
20
22
|
roadmap: "roadmap",
|
|
21
23
|
satellite: "satellite",
|
|
22
24
|
hybrid: "hybrid"
|
|
23
|
-
},
|
|
25
|
+
}, Q = {
|
|
24
26
|
darkMatter: "darkMatter",
|
|
25
27
|
positron: "positron",
|
|
26
28
|
voyager: "voyager"
|
|
27
|
-
},
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
29
|
+
}, xe = {
|
|
30
|
+
[Q.positron]: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
|
|
31
|
+
[Q.voyager]: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
|
|
32
|
+
[Q.darkMatter]: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
31
33
|
}, le = {
|
|
32
34
|
maplibre: "maplibre",
|
|
33
35
|
googleMaps: "google-maps"
|
|
34
|
-
},
|
|
35
|
-
[
|
|
36
|
-
url:
|
|
36
|
+
}, pt = {
|
|
37
|
+
[Q.positron]: {
|
|
38
|
+
url: xe[Q.positron],
|
|
37
39
|
type: le.maplibre
|
|
38
40
|
},
|
|
39
|
-
[
|
|
40
|
-
url:
|
|
41
|
+
[Q.voyager]: {
|
|
42
|
+
url: xe[Q.voyager],
|
|
41
43
|
type: le.maplibre
|
|
42
44
|
},
|
|
43
|
-
[
|
|
44
|
-
url:
|
|
45
|
+
[Q.darkMatter]: {
|
|
46
|
+
url: xe[Q.darkMatter],
|
|
45
47
|
type: le.maplibre,
|
|
46
48
|
dark: !0
|
|
47
49
|
},
|
|
48
|
-
[
|
|
50
|
+
[De.roadmap]: {
|
|
49
51
|
type: le.googleMaps
|
|
50
52
|
},
|
|
51
|
-
[
|
|
53
|
+
[De.satellite]: {
|
|
52
54
|
type: le.googleMaps
|
|
53
55
|
},
|
|
54
|
-
[
|
|
56
|
+
[De.hybrid]: {
|
|
55
57
|
type: le.googleMaps
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
|
-
function
|
|
60
|
+
function un({
|
|
59
61
|
isDragging: n,
|
|
60
62
|
isHovering: e
|
|
61
63
|
}) {
|
|
62
64
|
return n ? "grabbing" : e ? "pointer" : "grab";
|
|
63
65
|
}
|
|
64
|
-
function
|
|
66
|
+
function dn(n) {
|
|
65
67
|
return n.html ? {
|
|
66
68
|
html: `<div class='map-tooltip__content'>${n.html}</div>`,
|
|
67
69
|
style: {
|
|
@@ -70,135 +72,135 @@ function nn(n) {
|
|
|
70
72
|
}
|
|
71
73
|
} : null;
|
|
72
74
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
const e =
|
|
76
|
-
let t, s, i, r, o, a, l,
|
|
75
|
+
function fn(n) {
|
|
76
|
+
var pe, w, Ke;
|
|
77
|
+
const e = C(66);
|
|
78
|
+
let t, s, i, r, o, a, l, c, u, p, h, d, m, f;
|
|
77
79
|
e[0] !== n ? ({
|
|
78
80
|
instanceRef: t,
|
|
79
81
|
overlayRef: r,
|
|
80
82
|
basemap: l,
|
|
81
|
-
controller:
|
|
82
|
-
id:
|
|
83
|
+
controller: c,
|
|
84
|
+
id: u,
|
|
83
85
|
layers: p,
|
|
84
86
|
parameters: o,
|
|
85
|
-
gmapsProps:
|
|
86
|
-
getCursor:
|
|
87
|
+
gmapsProps: h,
|
|
88
|
+
getCursor: d,
|
|
87
89
|
getTooltip: m,
|
|
88
90
|
onLoad: s,
|
|
89
91
|
onResize: i,
|
|
90
|
-
onViewStateChange:
|
|
92
|
+
onViewStateChange: f,
|
|
91
93
|
...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] =
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
e[15] !== p ? (
|
|
96
|
-
const b =
|
|
97
|
-
let
|
|
98
|
-
e[17] !==
|
|
94
|
+
} = 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] = c, e[9] = u, e[10] = p, e[11] = h, e[12] = d, e[13] = m, e[14] = f) : (t = e[1], s = e[2], i = e[3], r = e[4], o = e[5], a = e[6], l = e[7], c = e[8], u = e[9], p = e[10], h = e[11], d = e[12], m = e[13], f = e[14]);
|
|
95
|
+
const M = l === void 0 ? Q.positron : l, S = c === void 0 ? !0 : c, v = u === void 0 ? "deck-gl-map" : u;
|
|
96
|
+
let y;
|
|
97
|
+
e[15] !== p ? (y = p === void 0 ? [] : p, e[15] = p, e[16] = y) : y = e[16];
|
|
98
|
+
const b = y;
|
|
99
|
+
let P;
|
|
100
|
+
e[17] !== h ? (P = h === void 0 ? {
|
|
99
101
|
apiKey: ""
|
|
100
|
-
} :
|
|
101
|
-
let
|
|
102
|
-
e[19] !==
|
|
103
|
-
apiKey:
|
|
104
|
-
APIProviderProps:
|
|
102
|
+
} : h, e[17] = h, e[18] = P) : P = e[18];
|
|
103
|
+
let _, g, E;
|
|
104
|
+
e[19] !== P ? ({
|
|
105
|
+
apiKey: E,
|
|
106
|
+
APIProviderProps: _,
|
|
105
107
|
...g
|
|
106
|
-
} =
|
|
107
|
-
const
|
|
108
|
-
let
|
|
109
|
-
e[23] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
110
|
-
const [
|
|
108
|
+
} = P, e[19] = P, e[20] = _, e[21] = g, e[22] = E) : (_ = e[20], g = e[21], E = e[22]);
|
|
109
|
+
const L = d === void 0 ? un : d, A = m === void 0 ? dn : m, O = f === void 0 ? gn : f;
|
|
110
|
+
let U;
|
|
111
|
+
e[23] === Symbol.for("react.memo_cache_sentinel") ? (U = [!1, !1], e[23] = U) : U = e[23];
|
|
112
|
+
const [q, Y] = ge(U);
|
|
111
113
|
let V;
|
|
112
|
-
e[24] !==
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
e[26] !== i ? (
|
|
116
|
-
i == null || i(
|
|
117
|
-
}, e[26] = i, e[27] =
|
|
118
|
-
const te =
|
|
114
|
+
e[24] !== q ? (V = q.every(hn), e[24] = q, e[25] = V) : V = e[25];
|
|
115
|
+
const x = V;
|
|
116
|
+
let $;
|
|
117
|
+
e[26] !== i ? ($ = (ye) => {
|
|
118
|
+
i == null || i(ye);
|
|
119
|
+
}, e[26] = i, e[27] = $) : $ = e[27];
|
|
120
|
+
const te = $, {
|
|
119
121
|
url: N,
|
|
120
|
-
type:
|
|
121
|
-
} =
|
|
122
|
-
let
|
|
123
|
-
e[28] !== b ? (X = b.filter(
|
|
124
|
-
const
|
|
122
|
+
type: be
|
|
123
|
+
} = pt[M], G = be === le.googleMaps;
|
|
124
|
+
let Se, X;
|
|
125
|
+
e[28] !== b ? (X = b.filter(yn).map(pn), e[28] = b, e[29] = X) : X = e[29], Se = X;
|
|
126
|
+
const me = Se;
|
|
125
127
|
let ne;
|
|
126
|
-
e[30] !==
|
|
127
|
-
const
|
|
128
|
-
...
|
|
129
|
-
viewState:
|
|
130
|
-
} :
|
|
131
|
-
|
|
132
|
-
}, e[30] =
|
|
128
|
+
e[30] !== G || e[31] !== O ? (ne = (ye) => {
|
|
129
|
+
const Re = G ? {
|
|
130
|
+
...ye,
|
|
131
|
+
viewState: It(ye)
|
|
132
|
+
} : ye;
|
|
133
|
+
O(Re);
|
|
134
|
+
}, e[30] = G, e[31] = O, e[32] = ne) : ne = e[32];
|
|
133
135
|
const se = ne;
|
|
134
136
|
let H;
|
|
135
|
-
e[33] === Symbol.for("react.memo_cache_sentinel") ? (H = (
|
|
136
|
-
const
|
|
137
|
-
Y((
|
|
137
|
+
e[33] === Symbol.for("react.memo_cache_sentinel") ? (H = (ye) => {
|
|
138
|
+
const Re = ye.type === "deckgl" ? 0 : 1;
|
|
139
|
+
Y((Ct) => Ct.map((Tt, kt) => kt === Re ? !0 : Tt));
|
|
138
140
|
}, e[33] = H) : H = e[33];
|
|
139
141
|
const ie = H;
|
|
140
142
|
let re, oe;
|
|
141
|
-
e[34] !==
|
|
142
|
-
s == null || s(
|
|
143
|
-
}, oe = [
|
|
143
|
+
e[34] !== x || e[35] !== s ? (re = () => {
|
|
144
|
+
s == null || s(x);
|
|
145
|
+
}, oe = [x, s], e[34] = x, e[35] = s, e[36] = re, e[37] = oe) : (re = e[36], oe = e[37]), ce(re, oe);
|
|
144
146
|
let J;
|
|
145
147
|
e[38] === Symbol.for("react.memo_cache_sentinel") ? (J = () => ie({
|
|
146
148
|
type: "deckgl"
|
|
147
149
|
}), e[38] = J) : J = e[38];
|
|
148
|
-
let
|
|
149
|
-
e[39] !== o ? (
|
|
150
|
+
let j;
|
|
151
|
+
e[39] !== o ? (j = {
|
|
150
152
|
depthTest: !1,
|
|
151
153
|
...o
|
|
152
|
-
}, e[39] = o, e[40] =
|
|
153
|
-
let
|
|
154
|
-
e[41] !== r ? (
|
|
155
|
-
let
|
|
156
|
-
e[43] !== g || e[44] !==
|
|
157
|
-
lat: ((
|
|
158
|
-
lng: ((
|
|
159
|
-
}, defaultZoom: ((
|
|
154
|
+
}, e[39] = o, e[40] = j) : j = e[40];
|
|
155
|
+
let K;
|
|
156
|
+
e[41] !== r ? (K = /* @__PURE__ */ Z(Sn, { overlayRef: r }), e[41] = r, e[42] = K) : K = e[42];
|
|
157
|
+
let z;
|
|
158
|
+
e[43] !== g || e[44] !== M || e[45] !== G || e[46] !== N || e[47] !== a ? (z = G ? /* @__PURE__ */ Z(Vt, { mapTypeId: M, reuseMaps: !0, renderingType: "RASTER", ...g, defaultCenter: {
|
|
159
|
+
lat: ((pe = a.initialViewState) == null ? void 0 : pe.latitude) ?? 0,
|
|
160
|
+
lng: ((w = a.initialViewState) == null ? void 0 : w.longitude) ?? 0
|
|
161
|
+
}, defaultZoom: ((Ke = a.initialViewState) == null ? void 0 : Ke.zoom) ?? 0, onTilesLoaded: () => ie({
|
|
160
162
|
type: "load"
|
|
161
|
-
}) }) : /* @__PURE__ */ Z(
|
|
163
|
+
}) }) : /* @__PURE__ */ Z(Ut, { reuseMaps: !0, mapStyle: N, onLoad: () => ie({
|
|
162
164
|
type: "load"
|
|
163
|
-
}), onRender:
|
|
164
|
-
let
|
|
165
|
-
e[49] !==
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
] }) }) }), e[49] =
|
|
165
|
+
}), onRender: mn }), e[43] = g, e[44] = M, e[45] = G, e[46] = N, e[47] = a, e[48] = z) : z = e[48];
|
|
166
|
+
let W;
|
|
167
|
+
e[49] !== me || e[50] !== S || e[51] !== L || e[52] !== A || e[53] !== te || e[54] !== se || e[55] !== v || e[56] !== t || e[57] !== a || e[58] !== j || e[59] !== K || e[60] !== z ? (W = /* @__PURE__ */ Z(qt, { children: /* @__PURE__ */ Z("div", { className: "deckgl-map", children: /* @__PURE__ */ Ot(xt, { controller: S, id: v, ref: t, layers: me, getCursor: L, getTooltip: A, onLoad: J, onResize: te, onViewStateChange: se, parameters: j, ...a, children: [
|
|
168
|
+
K,
|
|
169
|
+
z
|
|
170
|
+
] }) }) }), e[49] = me, e[50] = S, e[51] = L, e[52] = A, e[53] = te, e[54] = se, e[55] = v, e[56] = t, e[57] = a, e[58] = j, e[59] = K, e[60] = z, e[61] = W) : W = e[61];
|
|
169
171
|
let ae;
|
|
170
|
-
return e[62] !==
|
|
172
|
+
return e[62] !== _ || e[63] !== E || e[64] !== W ? (ae = /* @__PURE__ */ Z(Nt, { apiKey: E, ..._, children: W }), e[62] = _, e[63] = E, e[64] = W, e[65] = ae) : ae = e[65], ae;
|
|
171
173
|
}
|
|
172
|
-
function
|
|
174
|
+
function mn() {
|
|
173
175
|
const n = document.querySelector(".maplibregl-compact-show");
|
|
174
176
|
n == null || n.classList.remove("maplibregl-compact-show");
|
|
175
177
|
}
|
|
176
|
-
function
|
|
178
|
+
function pn(n) {
|
|
177
179
|
const {
|
|
178
180
|
type: e,
|
|
179
181
|
props: t
|
|
180
182
|
} = n;
|
|
181
183
|
return new e(t);
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function yn(n) {
|
|
184
186
|
return !!(n != null && n.type);
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function hn(n) {
|
|
187
189
|
return n;
|
|
188
190
|
}
|
|
189
|
-
function
|
|
191
|
+
function gn() {
|
|
190
192
|
return null;
|
|
191
193
|
}
|
|
192
|
-
function
|
|
193
|
-
const e =
|
|
194
|
+
function Sn(n) {
|
|
195
|
+
const e = C(4), {
|
|
194
196
|
overlayRef: t
|
|
195
197
|
} = n, {
|
|
196
198
|
default: s
|
|
197
|
-
} =
|
|
199
|
+
} = $t(), i = Bt();
|
|
198
200
|
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]),
|
|
201
|
+
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]), Rt(t, r, o), null;
|
|
200
202
|
}
|
|
201
|
-
const
|
|
203
|
+
const B = {
|
|
202
204
|
addFeature: "addFeature",
|
|
203
205
|
addTentativePosition: "addTentativePosition",
|
|
204
206
|
updateTentativeFeature: "updateTentativeFeature",
|
|
@@ -206,20 +208,20 @@ const G = {
|
|
|
206
208
|
finish: "finish",
|
|
207
209
|
addPosition: "addPosition"
|
|
208
210
|
};
|
|
209
|
-
class
|
|
211
|
+
class vn extends Gt {
|
|
210
212
|
constructor() {
|
|
211
|
-
super([new
|
|
213
|
+
super([new Ht(), new Kt()]);
|
|
212
214
|
}
|
|
213
215
|
handleKeyUp(e, t) {
|
|
214
216
|
super.handleKeyUp(e, t), e.key === "Enter" && (this.resetClickSequence(), t.onEdit({
|
|
215
217
|
updatedData: t.data,
|
|
216
|
-
editType:
|
|
218
|
+
editType: B.addFeature,
|
|
217
219
|
editContext: {}
|
|
218
220
|
}));
|
|
219
221
|
}
|
|
220
222
|
}
|
|
221
|
-
const
|
|
222
|
-
id:
|
|
223
|
+
const Fe = "lassoLayer", Mn = "maskLayer", bn = {
|
|
224
|
+
id: Fe,
|
|
223
225
|
pickable: !1,
|
|
224
226
|
billboard: !1,
|
|
225
227
|
editHandlePointRadiusUnits: "pixels",
|
|
@@ -243,7 +245,7 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
243
245
|
border: [71, 219, 153, 255],
|
|
244
246
|
fill: [71, 219, 153, 0]
|
|
245
247
|
}
|
|
246
|
-
},
|
|
248
|
+
}, Ue = {
|
|
247
249
|
styles: {
|
|
248
250
|
colors: {
|
|
249
251
|
editing: je.editing,
|
|
@@ -253,8 +255,8 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
253
255
|
labels: {
|
|
254
256
|
mask: "Geometry"
|
|
255
257
|
}
|
|
256
|
-
},
|
|
257
|
-
id:
|
|
258
|
+
}, Pe = {
|
|
259
|
+
id: Mn,
|
|
258
260
|
stroked: !0,
|
|
259
261
|
filled: !0,
|
|
260
262
|
lineWidthUnits: "pixels",
|
|
@@ -263,25 +265,25 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
263
265
|
}, ze = {
|
|
264
266
|
polygon: {
|
|
265
267
|
value: "polygon",
|
|
266
|
-
mode:
|
|
268
|
+
mode: Wt
|
|
267
269
|
},
|
|
268
270
|
rectangle: {
|
|
269
271
|
value: "rectangle",
|
|
270
|
-
mode:
|
|
272
|
+
mode: jt
|
|
271
273
|
},
|
|
272
274
|
circle: {
|
|
273
275
|
value: "circle",
|
|
274
|
-
mode:
|
|
276
|
+
mode: ut
|
|
275
277
|
},
|
|
276
278
|
lasso: {
|
|
277
279
|
value: "lasso",
|
|
278
|
-
mode:
|
|
280
|
+
mode: zt
|
|
279
281
|
},
|
|
280
282
|
edit: {
|
|
281
283
|
value: "edit",
|
|
282
|
-
mode:
|
|
284
|
+
mode: vn
|
|
283
285
|
}
|
|
284
|
-
},
|
|
286
|
+
}, we = ft((n) => ({
|
|
285
287
|
layers: {},
|
|
286
288
|
setLayer: (e, t) => n((s) => {
|
|
287
289
|
const i = {
|
|
@@ -294,25 +296,29 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
294
296
|
const r = i[e] ?? {
|
|
295
297
|
type: null,
|
|
296
298
|
props: {}
|
|
297
|
-
}
|
|
299
|
+
};
|
|
298
300
|
return i[e] = {
|
|
299
301
|
...r,
|
|
300
302
|
...t,
|
|
301
303
|
props: {
|
|
302
304
|
id: e,
|
|
303
|
-
...
|
|
304
|
-
...
|
|
305
|
+
...r.props,
|
|
306
|
+
...t.props
|
|
307
|
+
},
|
|
308
|
+
legend: {
|
|
309
|
+
...r.legend,
|
|
310
|
+
...t.legend
|
|
305
311
|
}
|
|
306
312
|
}, {
|
|
307
313
|
layers: i
|
|
308
314
|
};
|
|
309
315
|
})
|
|
310
|
-
})),
|
|
316
|
+
})), En = {
|
|
311
317
|
transitionDuration: "auto",
|
|
312
|
-
transitionInterpolator: new
|
|
318
|
+
transitionInterpolator: new Xt({
|
|
313
319
|
curve: 2
|
|
314
320
|
})
|
|
315
|
-
},
|
|
321
|
+
}, wn = (n) => {
|
|
316
322
|
const e = n.reduce((t, s) => {
|
|
317
323
|
const {
|
|
318
324
|
id: i,
|
|
@@ -377,77 +383,90 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
377
383
|
return a == null ? void 0 : a.getViewports(r);
|
|
378
384
|
},
|
|
379
385
|
getViewport: (i, r = 0, o) => {
|
|
380
|
-
var
|
|
386
|
+
var c;
|
|
381
387
|
const l = s().getDeckInstance(i);
|
|
382
|
-
return (
|
|
388
|
+
return (c = l == null ? void 0 : l.getViewports(o)) == null ? void 0 : c[r];
|
|
383
389
|
},
|
|
384
390
|
addLayers: (i, r) => t((o) => {
|
|
385
|
-
var
|
|
391
|
+
var u;
|
|
386
392
|
const a = {
|
|
387
393
|
...o.maps
|
|
388
|
-
}, l = ((
|
|
394
|
+
}, l = ((u = a[i]) == null ? void 0 : u.layers) ?? [], c = /* @__PURE__ */ new Set([...l, ...r]);
|
|
389
395
|
return a[i] = {
|
|
390
396
|
...a[i],
|
|
391
|
-
layers: [...
|
|
397
|
+
layers: [...c]
|
|
392
398
|
}, {
|
|
393
399
|
maps: a
|
|
394
400
|
};
|
|
395
401
|
}),
|
|
396
402
|
removeLayers: (i, r) => t((o) => {
|
|
397
|
-
var
|
|
403
|
+
var c;
|
|
398
404
|
const a = {
|
|
399
405
|
...o.maps
|
|
400
|
-
}, l = ((
|
|
406
|
+
}, l = ((c = a[i]) == null ? void 0 : c.layers) ?? [];
|
|
401
407
|
return a[i] = {
|
|
402
408
|
...a[i],
|
|
403
|
-
layers: l.filter((
|
|
409
|
+
layers: l.filter((u) => !r.includes(u))
|
|
404
410
|
}, {
|
|
405
411
|
maps: a
|
|
406
412
|
};
|
|
407
413
|
})
|
|
408
414
|
});
|
|
409
|
-
},
|
|
410
|
-
const e = n.reduce((t, s) => (t[s.id] = s.viewState, t), {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
415
|
+
}, Ln = (n) => {
|
|
416
|
+
const e = n.reduce((t, s) => (s.viewState && (t.viewStates[s.id] = s.viewState, t.viewports[s.id] = new We(s.viewState)), t), {
|
|
417
|
+
viewStates: {},
|
|
418
|
+
viewports: {}
|
|
419
|
+
});
|
|
420
|
+
return (t, s) => ({
|
|
421
|
+
viewports: e.viewports,
|
|
422
|
+
updateViewPort: (i) => {
|
|
423
|
+
const r = s(), o = new We(r.viewStates[i]);
|
|
424
|
+
t((a) => ({
|
|
425
|
+
viewports: {
|
|
426
|
+
...a.viewports,
|
|
427
|
+
[i]: o
|
|
428
|
+
}
|
|
429
|
+
}));
|
|
430
|
+
},
|
|
431
|
+
viewStates: e.viewStates,
|
|
432
|
+
setViewState: (i, r) => t((o) => ({
|
|
414
433
|
viewStates: {
|
|
415
|
-
...
|
|
416
|
-
[
|
|
417
|
-
...
|
|
418
|
-
...
|
|
434
|
+
...o.viewStates,
|
|
435
|
+
[i]: {
|
|
436
|
+
...o.viewStates[i],
|
|
437
|
+
...r
|
|
419
438
|
}
|
|
420
439
|
}
|
|
421
440
|
})),
|
|
422
|
-
setZoom: (
|
|
441
|
+
setZoom: (i, r) => t((o) => ({
|
|
423
442
|
viewStates: {
|
|
424
|
-
...
|
|
425
|
-
[
|
|
426
|
-
...
|
|
427
|
-
zoom:
|
|
443
|
+
...o.viewStates,
|
|
444
|
+
[i]: {
|
|
445
|
+
...o.viewStates[i],
|
|
446
|
+
zoom: r
|
|
428
447
|
}
|
|
429
448
|
}
|
|
430
449
|
})),
|
|
431
|
-
setMinZoom: (
|
|
450
|
+
setMinZoom: (i, r) => t((o) => ({
|
|
432
451
|
viewStates: {
|
|
433
|
-
...
|
|
434
|
-
[
|
|
435
|
-
...
|
|
436
|
-
minZoom:
|
|
452
|
+
...o.viewStates,
|
|
453
|
+
[i]: {
|
|
454
|
+
...o.viewStates[i],
|
|
455
|
+
minZoom: r
|
|
437
456
|
}
|
|
438
457
|
}
|
|
439
458
|
})),
|
|
440
|
-
setMaxZoom: (
|
|
459
|
+
setMaxZoom: (i, r) => t((o) => ({
|
|
441
460
|
viewStates: {
|
|
442
|
-
...
|
|
443
|
-
[
|
|
444
|
-
...
|
|
445
|
-
maxZoom:
|
|
461
|
+
...o.viewStates,
|
|
462
|
+
[i]: {
|
|
463
|
+
...o.viewStates[i],
|
|
464
|
+
maxZoom: r
|
|
446
465
|
}
|
|
447
466
|
}
|
|
448
467
|
}))
|
|
449
468
|
});
|
|
450
|
-
},
|
|
469
|
+
}, Pn = (n, e) => ({
|
|
451
470
|
fitBounds: (t, s, i) => {
|
|
452
471
|
const r = e(), o = r.getViewport(t);
|
|
453
472
|
if (!o) return;
|
|
@@ -461,7 +480,7 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
461
480
|
const r = e();
|
|
462
481
|
if (!r.getViewport(t)) return;
|
|
463
482
|
const a = {
|
|
464
|
-
...
|
|
483
|
+
...En,
|
|
465
484
|
...i == null ? void 0 : i.viewStateOptions
|
|
466
485
|
}, l = {
|
|
467
486
|
...s,
|
|
@@ -469,123 +488,123 @@ const Ce = "lassoLayer", fn = "maskLayer", mn = {
|
|
|
469
488
|
};
|
|
470
489
|
r.setViewState(t, l);
|
|
471
490
|
}
|
|
472
|
-
}),
|
|
473
|
-
...
|
|
474
|
-
...
|
|
475
|
-
...
|
|
476
|
-
})),
|
|
477
|
-
function
|
|
478
|
-
const e =
|
|
491
|
+
}), _n = (n) => Ge()((...e) => ({
|
|
492
|
+
...wn(n)(...e),
|
|
493
|
+
...Ln(n)(...e),
|
|
494
|
+
...Pn(...e)
|
|
495
|
+
})), yt = Ie({});
|
|
496
|
+
function yi(n) {
|
|
497
|
+
const e = C(5), {
|
|
479
498
|
children: t,
|
|
480
499
|
values: s
|
|
481
500
|
} = n;
|
|
482
501
|
let i;
|
|
483
|
-
e[0] !== s ? (i =
|
|
484
|
-
const [r] =
|
|
502
|
+
e[0] !== s ? (i = _n(s), e[0] = s, e[1] = i) : i = e[1];
|
|
503
|
+
const [r] = ge(i);
|
|
485
504
|
let o;
|
|
486
|
-
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(
|
|
505
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(yt.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
487
506
|
}
|
|
488
507
|
function k(n) {
|
|
489
|
-
const e =
|
|
508
|
+
const e = Be(yt);
|
|
490
509
|
if (!e)
|
|
491
510
|
throw new Error("Missing Map.Provider in the tree");
|
|
492
|
-
return
|
|
511
|
+
return He(e, n);
|
|
493
512
|
}
|
|
494
|
-
function
|
|
513
|
+
function Cn(n) {
|
|
495
514
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
496
515
|
}
|
|
497
|
-
var
|
|
498
|
-
return
|
|
516
|
+
var Tn = function(e) {
|
|
517
|
+
return kn(e) && !Fn(e);
|
|
499
518
|
};
|
|
500
|
-
function
|
|
519
|
+
function kn(n) {
|
|
501
520
|
return !!n && typeof n == "object";
|
|
502
521
|
}
|
|
503
|
-
function
|
|
522
|
+
function Fn(n) {
|
|
504
523
|
var e = Object.prototype.toString.call(n);
|
|
505
|
-
return e === "[object RegExp]" || e === "[object Date]" ||
|
|
524
|
+
return e === "[object RegExp]" || e === "[object Date]" || Rn(n);
|
|
506
525
|
}
|
|
507
|
-
var
|
|
508
|
-
function
|
|
509
|
-
return n.$$typeof ===
|
|
526
|
+
var An = typeof Symbol == "function" && Symbol.for, On = An ? Symbol.for("react.element") : 60103;
|
|
527
|
+
function Rn(n) {
|
|
528
|
+
return n.$$typeof === On;
|
|
510
529
|
}
|
|
511
|
-
function
|
|
530
|
+
function Dn(n) {
|
|
512
531
|
return Array.isArray(n) ? [] : {};
|
|
513
532
|
}
|
|
514
|
-
function
|
|
515
|
-
return e.clone !== !1 && e.isMergeableObject(n) ?
|
|
533
|
+
function Le(n, e) {
|
|
534
|
+
return e.clone !== !1 && e.isMergeableObject(n) ? Me(Dn(n), n, e) : n;
|
|
516
535
|
}
|
|
517
|
-
function
|
|
536
|
+
function xn(n, e, t) {
|
|
518
537
|
return n.concat(e).map(function(s) {
|
|
519
|
-
return
|
|
538
|
+
return Le(s, t);
|
|
520
539
|
});
|
|
521
540
|
}
|
|
522
|
-
function
|
|
541
|
+
function Un(n, e) {
|
|
523
542
|
if (!e.customMerge)
|
|
524
|
-
return
|
|
543
|
+
return Me;
|
|
525
544
|
var t = e.customMerge(n);
|
|
526
|
-
return typeof t == "function" ? t :
|
|
545
|
+
return typeof t == "function" ? t : Me;
|
|
527
546
|
}
|
|
528
|
-
function
|
|
547
|
+
function qn(n) {
|
|
529
548
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(n).filter(function(e) {
|
|
530
549
|
return Object.propertyIsEnumerable.call(n, e);
|
|
531
550
|
}) : [];
|
|
532
551
|
}
|
|
533
|
-
function
|
|
534
|
-
return Object.keys(n).concat(
|
|
552
|
+
function Ze(n) {
|
|
553
|
+
return Object.keys(n).concat(qn(n));
|
|
535
554
|
}
|
|
536
|
-
function
|
|
555
|
+
function ht(n, e) {
|
|
537
556
|
try {
|
|
538
557
|
return e in n;
|
|
539
558
|
} catch {
|
|
540
559
|
return !1;
|
|
541
560
|
}
|
|
542
561
|
}
|
|
543
|
-
function
|
|
544
|
-
return
|
|
562
|
+
function $n(n, e) {
|
|
563
|
+
return ht(n, e) && !(Object.hasOwnProperty.call(n, e) && Object.propertyIsEnumerable.call(n, e));
|
|
545
564
|
}
|
|
546
|
-
function
|
|
565
|
+
function Vn(n, e, t) {
|
|
547
566
|
var s = {};
|
|
548
|
-
return t.isMergeableObject(n) &&
|
|
549
|
-
s[i] =
|
|
550
|
-
}),
|
|
551
|
-
|
|
567
|
+
return t.isMergeableObject(n) && Ze(n).forEach(function(i) {
|
|
568
|
+
s[i] = Le(n[i], t);
|
|
569
|
+
}), Ze(e).forEach(function(i) {
|
|
570
|
+
$n(n, i) || (ht(n, i) && t.isMergeableObject(e[i]) ? s[i] = Un(i, t)(n[i], e[i], t) : s[i] = Le(e[i], t));
|
|
552
571
|
}), s;
|
|
553
572
|
}
|
|
554
|
-
function
|
|
555
|
-
t = t || {}, t.arrayMerge = t.arrayMerge ||
|
|
573
|
+
function Me(n, e, t) {
|
|
574
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || xn, t.isMergeableObject = t.isMergeableObject || Tn, t.cloneUnlessOtherwiseSpecified = Le;
|
|
556
575
|
var s = Array.isArray(e), i = Array.isArray(n), r = s === i;
|
|
557
|
-
return r ? s ? t.arrayMerge(n, e, t) :
|
|
576
|
+
return r ? s ? t.arrayMerge(n, e, t) : Vn(n, e, t) : Le(e, t);
|
|
558
577
|
}
|
|
559
|
-
|
|
578
|
+
Me.all = function(e, t) {
|
|
560
579
|
if (!Array.isArray(e))
|
|
561
580
|
throw new Error("first argument should be an array");
|
|
562
581
|
return e.reduce(function(s, i) {
|
|
563
|
-
return
|
|
582
|
+
return Me(s, i, t);
|
|
564
583
|
}, {});
|
|
565
584
|
};
|
|
566
|
-
var
|
|
567
|
-
const
|
|
568
|
-
function
|
|
585
|
+
var Nn = Me, In = Nn;
|
|
586
|
+
const ve = /* @__PURE__ */ Cn(In);
|
|
587
|
+
function Bn({
|
|
569
588
|
mode: n,
|
|
570
589
|
...e
|
|
571
590
|
}) {
|
|
572
|
-
const t =
|
|
591
|
+
const t = Gn(e);
|
|
573
592
|
return {
|
|
574
|
-
type:
|
|
593
|
+
type: dt,
|
|
575
594
|
props: {
|
|
576
595
|
...t,
|
|
577
596
|
mode: n
|
|
578
597
|
}
|
|
579
598
|
};
|
|
580
599
|
}
|
|
581
|
-
function
|
|
600
|
+
function Gn({
|
|
582
601
|
layerProps: n,
|
|
583
602
|
onEdit: e,
|
|
584
603
|
guideColor: t,
|
|
585
604
|
fillColor: s,
|
|
586
605
|
pointColor: i
|
|
587
606
|
}) {
|
|
588
|
-
const r =
|
|
607
|
+
const r = ve(n, {
|
|
589
608
|
modeConfig: {
|
|
590
609
|
// // We force distance due to conversion is addressed at feature getText level
|
|
591
610
|
// formatTooltip: (_distance: number) => {
|
|
@@ -594,33 +613,33 @@ function Un({
|
|
|
594
613
|
preventOverlappingLines: !0
|
|
595
614
|
},
|
|
596
615
|
onEdit: e
|
|
597
|
-
}), o =
|
|
616
|
+
}), o = ve(bn, {
|
|
598
617
|
getTentativeLineColor: t,
|
|
599
618
|
getTentativeFillColor: s,
|
|
600
619
|
getLineColor: t,
|
|
601
620
|
getFillColor: s,
|
|
602
621
|
getEditHandlePointColor: i,
|
|
603
622
|
getEditHandlePointOutlineColor: t,
|
|
604
|
-
dataComparator: (l,
|
|
623
|
+
dataComparator: (l, c) => l.features[0] === c.features[0]
|
|
605
624
|
});
|
|
606
|
-
return
|
|
625
|
+
return ve(o, r);
|
|
607
626
|
}
|
|
608
|
-
const
|
|
627
|
+
const Hn = (n) => Ge()((e) => ({
|
|
609
628
|
data: n.reduce((s, i) => {
|
|
610
629
|
const {
|
|
611
630
|
enabled: r = !1,
|
|
612
631
|
mapId: o,
|
|
613
632
|
modeInstance: a,
|
|
614
633
|
modes: l = ze,
|
|
615
|
-
modeSelected:
|
|
616
|
-
values:
|
|
634
|
+
modeSelected: c = ze.polygon.value,
|
|
635
|
+
values: u = {}
|
|
617
636
|
} = i;
|
|
618
637
|
return s[o] = {
|
|
619
638
|
enabled: r,
|
|
620
639
|
modeInstance: a,
|
|
621
640
|
modes: l,
|
|
622
|
-
modeSelected:
|
|
623
|
-
values:
|
|
641
|
+
modeSelected: c,
|
|
642
|
+
values: u
|
|
624
643
|
}, s;
|
|
625
644
|
}, {}),
|
|
626
645
|
setEnabled: (s, i) => {
|
|
@@ -698,158 +717,158 @@ const xn = (n) => qe()((e) => ({
|
|
|
698
717
|
}
|
|
699
718
|
}));
|
|
700
719
|
}
|
|
701
|
-
})),
|
|
702
|
-
function
|
|
703
|
-
const e =
|
|
720
|
+
})), gt = Ie({});
|
|
721
|
+
function hi(n) {
|
|
722
|
+
const e = C(5), {
|
|
704
723
|
children: t,
|
|
705
724
|
values: s
|
|
706
725
|
} = n;
|
|
707
726
|
let i;
|
|
708
|
-
e[0] !== s ? (i = () =>
|
|
709
|
-
const [r] =
|
|
727
|
+
e[0] !== s ? (i = () => Hn(s), e[0] = s, e[1] = i) : i = e[1];
|
|
728
|
+
const [r] = ge(i);
|
|
710
729
|
let o;
|
|
711
|
-
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(
|
|
730
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(gt.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
712
731
|
}
|
|
713
|
-
function
|
|
714
|
-
const e =
|
|
732
|
+
function D(n) {
|
|
733
|
+
const e = Be(gt);
|
|
715
734
|
if (!e)
|
|
716
735
|
throw new Error("Missing Map.Provider in the tree");
|
|
717
|
-
return
|
|
736
|
+
return He(e, n);
|
|
718
737
|
}
|
|
719
|
-
function
|
|
738
|
+
function Kn({
|
|
720
739
|
mapId: n,
|
|
721
740
|
children: e
|
|
722
741
|
}) {
|
|
723
|
-
const t =
|
|
742
|
+
const t = D((d) => {
|
|
724
743
|
var m;
|
|
725
|
-
return (m =
|
|
726
|
-
}), s =
|
|
744
|
+
return (m = d.data[n]) == null ? void 0 : m.enabled;
|
|
745
|
+
}), s = D((d) => d.setEnabled), i = D((d) => {
|
|
727
746
|
var m;
|
|
728
|
-
return (m =
|
|
729
|
-
}), r =
|
|
747
|
+
return (m = d.data[n]) == null ? void 0 : m.values;
|
|
748
|
+
}), r = D((d) => d.setValue), o = D((d) => d.setVisibility), a = D((d) => {
|
|
730
749
|
var m;
|
|
731
|
-
return (m =
|
|
732
|
-
}), l =
|
|
750
|
+
return (m = d.data[n]) == null ? void 0 : m.modeSelected;
|
|
751
|
+
}), l = D((d) => d.setModeSelected), c = D((d) => {
|
|
733
752
|
var m;
|
|
734
|
-
return (m =
|
|
735
|
-
}),
|
|
753
|
+
return (m = d.data[n]) == null ? void 0 : m.modes;
|
|
754
|
+
}), u = D((d) => d.setModeInstance);
|
|
736
755
|
ce(() => {
|
|
737
|
-
const
|
|
738
|
-
if (
|
|
739
|
-
const m =
|
|
740
|
-
|
|
756
|
+
const d = c[a];
|
|
757
|
+
if (d) {
|
|
758
|
+
const m = d.mode, f = new m();
|
|
759
|
+
u(n, f);
|
|
741
760
|
}
|
|
742
|
-
}, [n, a,
|
|
761
|
+
}, [n, a, c, u]);
|
|
743
762
|
const [
|
|
744
763
|
p
|
|
745
764
|
// , draw
|
|
746
|
-
] =
|
|
747
|
-
const
|
|
765
|
+
] = ue(() => {
|
|
766
|
+
const d = (M) => {
|
|
748
767
|
var S;
|
|
749
768
|
return {
|
|
750
|
-
id:
|
|
751
|
-
visible:
|
|
752
|
-
label: (S =
|
|
769
|
+
id: M.id,
|
|
770
|
+
visible: M.visible,
|
|
771
|
+
label: (S = M.properties) == null ? void 0 : S.label
|
|
753
772
|
};
|
|
754
773
|
};
|
|
755
774
|
return [
|
|
756
|
-
Object.values(i).filter((
|
|
775
|
+
Object.values(i).filter((M) => M.type === "mask").map(d)
|
|
757
776
|
// , draw
|
|
758
777
|
];
|
|
759
|
-
}, [i]),
|
|
760
|
-
s(n, !!
|
|
778
|
+
}, [i]), h = R((d) => {
|
|
779
|
+
s(n, !!d), l(n, d);
|
|
761
780
|
}, [n, s, l]);
|
|
762
781
|
return e({
|
|
763
782
|
mapId: n,
|
|
764
783
|
enabled: t,
|
|
765
|
-
modes:
|
|
784
|
+
modes: c,
|
|
766
785
|
modeSelected: a,
|
|
767
786
|
values: {
|
|
768
787
|
mask: p
|
|
769
788
|
// draw,
|
|
770
789
|
},
|
|
771
|
-
setValue:
|
|
772
|
-
setEnabled:
|
|
773
|
-
setVisibility:
|
|
774
|
-
setModeSelected:
|
|
790
|
+
setValue: R((d) => r(n, d), [n, r]),
|
|
791
|
+
setEnabled: R((d) => s(n, d), [n, s]),
|
|
792
|
+
setVisibility: R((d, m) => o(n, d, m), [n, o]),
|
|
793
|
+
setModeSelected: h
|
|
775
794
|
});
|
|
776
795
|
}
|
|
777
|
-
const
|
|
796
|
+
const Wn = [new en({
|
|
778
797
|
filterSize: 1
|
|
779
798
|
})];
|
|
780
|
-
function
|
|
799
|
+
function jn({
|
|
781
800
|
children: n,
|
|
782
801
|
mapId: e,
|
|
783
802
|
defaultProps: {
|
|
784
|
-
styles: t =
|
|
803
|
+
styles: t = Ue.styles,
|
|
785
804
|
labels: s
|
|
786
805
|
} = {
|
|
787
|
-
styles:
|
|
788
|
-
labels:
|
|
806
|
+
styles: Ue.styles,
|
|
807
|
+
labels: Ue.labels
|
|
789
808
|
},
|
|
790
809
|
layerProps: i = {},
|
|
791
810
|
defaultType: r = "mask"
|
|
792
811
|
}) {
|
|
793
|
-
const o =
|
|
794
|
-
var
|
|
795
|
-
return (
|
|
796
|
-
}), a =
|
|
797
|
-
var
|
|
798
|
-
return (
|
|
799
|
-
}),
|
|
800
|
-
var
|
|
801
|
-
return (
|
|
802
|
-
}), p =
|
|
803
|
-
var
|
|
804
|
-
return (
|
|
805
|
-
}),
|
|
806
|
-
ce(() => (o &&
|
|
807
|
-
|
|
808
|
-
}), [
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
}, [e, a]), b =
|
|
812
|
+
const o = D((g) => {
|
|
813
|
+
var E;
|
|
814
|
+
return (E = g.data[e]) == null ? void 0 : E.enabled;
|
|
815
|
+
}), a = D((g) => g.setEnabled), l = D((g) => {
|
|
816
|
+
var E;
|
|
817
|
+
return (E = g.data[e]) == null ? void 0 : E.values;
|
|
818
|
+
}), c = D((g) => g.setValue), u = D((g) => {
|
|
819
|
+
var E;
|
|
820
|
+
return (E = g.data[e]) == null ? void 0 : E.modeInstance;
|
|
821
|
+
}), p = D((g) => {
|
|
822
|
+
var E;
|
|
823
|
+
return (E = g.data[e]) == null ? void 0 : E.modeSelected;
|
|
824
|
+
}), h = we((g) => g.setLayer), d = k((g) => g.addLayers), m = k((g) => g.removeLayers), [f, M] = ge(() => _e()), S = ue(() => Object.values(l ?? {}).filter((g) => g.type === "mask"), [l]), v = Dt(S.length);
|
|
825
|
+
ce(() => (o && d(e, [Fe]), () => {
|
|
826
|
+
M(_e()), m(e, [Fe]);
|
|
827
|
+
}), [d, o, e, m]);
|
|
828
|
+
const y = R(() => {
|
|
829
|
+
M(_e()), a(e, !1);
|
|
830
|
+
}, [e, a]), b = R(({
|
|
812
831
|
editType: g,
|
|
813
|
-
updatedData:
|
|
832
|
+
updatedData: E
|
|
814
833
|
}) => {
|
|
815
|
-
var
|
|
816
|
-
if (g ===
|
|
817
|
-
|
|
834
|
+
var L;
|
|
835
|
+
if (g === B.cancel) {
|
|
836
|
+
y();
|
|
818
837
|
return;
|
|
819
838
|
}
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
822
|
-
(
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
geometry:
|
|
826
|
-
properties:
|
|
839
|
+
if (M(E), g !== B.updateTentativeFeature && g === B.addFeature) {
|
|
840
|
+
const A = E.features[0];
|
|
841
|
+
(L = A.properties).label ?? (L.label = `${s == null ? void 0 : s.mask} ${v.current + 1}`), v.current += 1;
|
|
842
|
+
const O = A.id ?? crypto.randomUUID();
|
|
843
|
+
c(e, O, {
|
|
844
|
+
geometry: A.geometry,
|
|
845
|
+
properties: A.properties,
|
|
827
846
|
visible: !0,
|
|
828
847
|
type: r
|
|
829
|
-
}),
|
|
848
|
+
}), y();
|
|
830
849
|
}
|
|
831
|
-
}, [
|
|
850
|
+
}, [y, s == null ? void 0 : s.mask, c, e, r]);
|
|
832
851
|
ce(() => {
|
|
833
|
-
const g =
|
|
834
|
-
border:
|
|
835
|
-
point:
|
|
836
|
-
fill:
|
|
837
|
-
} = t.colors.editing,
|
|
852
|
+
const g = f.features.length > 0, {
|
|
853
|
+
border: E,
|
|
854
|
+
point: L,
|
|
855
|
+
fill: A
|
|
856
|
+
} = t.colors.editing, O = Bn({
|
|
838
857
|
layerProps: {
|
|
839
858
|
...i.mask,
|
|
840
859
|
pickable: !0,
|
|
841
|
-
data:
|
|
860
|
+
data: f,
|
|
842
861
|
selectedFeatureIndexes: g ? [0] : []
|
|
843
862
|
},
|
|
844
|
-
guideColor:
|
|
845
|
-
fillColor:
|
|
846
|
-
pointColor:
|
|
863
|
+
guideColor: E,
|
|
864
|
+
fillColor: A,
|
|
865
|
+
pointColor: L,
|
|
847
866
|
onEdit: b,
|
|
848
|
-
mode:
|
|
867
|
+
mode: u
|
|
849
868
|
});
|
|
850
|
-
|
|
851
|
-
}, [
|
|
852
|
-
const
|
|
869
|
+
h(Fe, O);
|
|
870
|
+
}, [f, i.mask, u, b, h, t.colors.editing]);
|
|
871
|
+
const P = ue(() => ({
|
|
853
872
|
type: "FeatureCollection",
|
|
854
873
|
features: S.map((g) => ({
|
|
855
874
|
type: "Feature",
|
|
@@ -857,82 +876,82 @@ function $n({
|
|
|
857
876
|
properties: g.properties,
|
|
858
877
|
id: g.id
|
|
859
878
|
}))
|
|
860
|
-
}), [S]),
|
|
861
|
-
const g = S.filter((
|
|
862
|
-
return
|
|
863
|
-
}, [
|
|
879
|
+
}), [S]), _ = ue(() => {
|
|
880
|
+
const g = S.filter((L) => L.visible).map((L) => L.id), E = f.features.map((L) => L.id);
|
|
881
|
+
return E.length ? g.filter((L) => !E.includes(L)) : g;
|
|
882
|
+
}, [f.features, S]);
|
|
864
883
|
return ce(() => {
|
|
865
884
|
const g = {
|
|
866
|
-
...
|
|
885
|
+
...Pe,
|
|
867
886
|
pickable: o && p === "edit",
|
|
868
887
|
visible: !0,
|
|
869
|
-
data:
|
|
888
|
+
data: P,
|
|
870
889
|
getLineColor: t.colors.finished.border,
|
|
871
890
|
getFillColor: t.colors.finished.fill,
|
|
872
|
-
extensions:
|
|
873
|
-
getFilterValue: (
|
|
891
|
+
extensions: Wn,
|
|
892
|
+
getFilterValue: (E) => Number(_.includes(E.id)),
|
|
874
893
|
filterRange: [1, 1],
|
|
875
894
|
updateTriggers: {
|
|
876
|
-
getFilterValue:
|
|
895
|
+
getFilterValue: _
|
|
877
896
|
},
|
|
878
897
|
onClick: ({
|
|
879
|
-
object:
|
|
898
|
+
object: E
|
|
880
899
|
}) => {
|
|
881
|
-
const
|
|
882
|
-
|
|
900
|
+
const L = _e();
|
|
901
|
+
L.features.push(E), M(L), a(e, !0);
|
|
883
902
|
}
|
|
884
903
|
};
|
|
885
|
-
return
|
|
886
|
-
type:
|
|
904
|
+
return h(Pe.id, {
|
|
905
|
+
type: Jt,
|
|
887
906
|
props: g
|
|
888
|
-
}),
|
|
889
|
-
m(e, [
|
|
907
|
+
}), d(e, [Pe.id]), () => {
|
|
908
|
+
m(e, [Pe.id]);
|
|
890
909
|
};
|
|
891
|
-
}, [
|
|
910
|
+
}, [d, o, e, P, _, p, m, a, h, t.colors.finished.border, t.colors.finished.fill]), n;
|
|
892
911
|
}
|
|
893
|
-
function
|
|
912
|
+
function _e() {
|
|
894
913
|
return {
|
|
895
914
|
type: "FeatureCollection",
|
|
896
915
|
features: []
|
|
897
916
|
};
|
|
898
917
|
}
|
|
899
|
-
|
|
900
|
-
var
|
|
901
|
-
function
|
|
918
|
+
jn.Controls = Kn;
|
|
919
|
+
var Qe = 63710088e-1;
|
|
920
|
+
function Ve(n, e, t = {}) {
|
|
902
921
|
const s = { type: "Feature" };
|
|
903
922
|
return (t.id === 0 || t.id) && (s.id = t.id), t.bbox && (s.bbox = t.bbox), s.properties = e || {}, s.geometry = n, s;
|
|
904
923
|
}
|
|
905
|
-
function
|
|
924
|
+
function St(n, e, t = {}) {
|
|
906
925
|
if (!n)
|
|
907
926
|
throw new Error("coordinates is required");
|
|
908
927
|
if (!Array.isArray(n))
|
|
909
928
|
throw new Error("coordinates must be an Array");
|
|
910
929
|
if (n.length < 2)
|
|
911
930
|
throw new Error("coordinates must be at least 2 numbers long");
|
|
912
|
-
if (!
|
|
931
|
+
if (!Xe(n[0]) || !Xe(n[1]))
|
|
913
932
|
throw new Error("coordinates must contain numbers");
|
|
914
|
-
return
|
|
933
|
+
return Ve({
|
|
915
934
|
type: "Point",
|
|
916
935
|
coordinates: n
|
|
917
936
|
}, e, t);
|
|
918
937
|
}
|
|
919
|
-
function
|
|
938
|
+
function Ye(n, e = {}) {
|
|
920
939
|
const t = { type: "FeatureCollection" };
|
|
921
940
|
return e.id && (t.id = e.id), e.bbox && (t.bbox = e.bbox), t.features = n, t;
|
|
922
941
|
}
|
|
923
|
-
function
|
|
942
|
+
function Xe(n) {
|
|
924
943
|
return !isNaN(n) && n !== null && !Array.isArray(n);
|
|
925
944
|
}
|
|
926
|
-
function
|
|
945
|
+
function vt(n, e, t) {
|
|
927
946
|
if (n !== null)
|
|
928
|
-
for (var s, i, r, o, a, l,
|
|
929
|
-
|
|
947
|
+
for (var s, i, r, o, a, l, c, u = 0, p = 0, h, d = n.type, m = d === "FeatureCollection", f = d === "Feature", M = m ? n.features.length : 1, S = 0; S < M; S++) {
|
|
948
|
+
c = m ? n.features[S].geometry : f ? n.geometry : n, h = c ? c.type === "GeometryCollection" : !1, a = h ? c.geometries.length : 1;
|
|
930
949
|
for (var v = 0; v < a; v++) {
|
|
931
|
-
var
|
|
932
|
-
if (o =
|
|
950
|
+
var y = 0, b = 0;
|
|
951
|
+
if (o = h ? c.geometries[v] : c, o !== null) {
|
|
933
952
|
l = o.coordinates;
|
|
934
|
-
var
|
|
935
|
-
switch (
|
|
953
|
+
var P = o.type;
|
|
954
|
+
switch (u = P === "Polygon" || P === "MultiPolygon" ? 1 : 0, P) {
|
|
936
955
|
case null:
|
|
937
956
|
break;
|
|
938
957
|
case "Point":
|
|
@@ -940,11 +959,11 @@ function yt(n, e, t) {
|
|
|
940
959
|
l,
|
|
941
960
|
p,
|
|
942
961
|
S,
|
|
943
|
-
|
|
962
|
+
y,
|
|
944
963
|
b
|
|
945
964
|
) === !1)
|
|
946
965
|
return !1;
|
|
947
|
-
p++,
|
|
966
|
+
p++, y++;
|
|
948
967
|
break;
|
|
949
968
|
case "LineString":
|
|
950
969
|
case "MultiPoint":
|
|
@@ -953,41 +972,41 @@ function yt(n, e, t) {
|
|
|
953
972
|
l[s],
|
|
954
973
|
p,
|
|
955
974
|
S,
|
|
956
|
-
|
|
975
|
+
y,
|
|
957
976
|
b
|
|
958
977
|
) === !1)
|
|
959
978
|
return !1;
|
|
960
|
-
p++,
|
|
979
|
+
p++, P === "MultiPoint" && y++;
|
|
961
980
|
}
|
|
962
|
-
|
|
981
|
+
P === "LineString" && y++;
|
|
963
982
|
break;
|
|
964
983
|
case "Polygon":
|
|
965
984
|
case "MultiLineString":
|
|
966
985
|
for (s = 0; s < l.length; s++) {
|
|
967
|
-
for (i = 0; i < l[s].length -
|
|
986
|
+
for (i = 0; i < l[s].length - u; i++) {
|
|
968
987
|
if (e(
|
|
969
988
|
l[s][i],
|
|
970
989
|
p,
|
|
971
990
|
S,
|
|
972
|
-
|
|
991
|
+
y,
|
|
973
992
|
b
|
|
974
993
|
) === !1)
|
|
975
994
|
return !1;
|
|
976
995
|
p++;
|
|
977
996
|
}
|
|
978
|
-
|
|
997
|
+
P === "MultiLineString" && y++, P === "Polygon" && b++;
|
|
979
998
|
}
|
|
980
|
-
|
|
999
|
+
P === "Polygon" && y++;
|
|
981
1000
|
break;
|
|
982
1001
|
case "MultiPolygon":
|
|
983
1002
|
for (s = 0; s < l.length; s++) {
|
|
984
1003
|
for (b = 0, i = 0; i < l[s].length; i++) {
|
|
985
|
-
for (r = 0; r < l[s][i].length -
|
|
1004
|
+
for (r = 0; r < l[s][i].length - u; r++) {
|
|
986
1005
|
if (e(
|
|
987
1006
|
l[s][i][r],
|
|
988
1007
|
p,
|
|
989
1008
|
S,
|
|
990
|
-
|
|
1009
|
+
y,
|
|
991
1010
|
b
|
|
992
1011
|
) === !1)
|
|
993
1012
|
return !1;
|
|
@@ -995,12 +1014,12 @@ function yt(n, e, t) {
|
|
|
995
1014
|
}
|
|
996
1015
|
b++;
|
|
997
1016
|
}
|
|
998
|
-
|
|
1017
|
+
y++;
|
|
999
1018
|
}
|
|
1000
1019
|
break;
|
|
1001
1020
|
case "GeometryCollection":
|
|
1002
1021
|
for (s = 0; s < o.geometries.length; s++)
|
|
1003
|
-
if (
|
|
1022
|
+
if (vt(o.geometries[s], e) === !1)
|
|
1004
1023
|
return !1;
|
|
1005
1024
|
break;
|
|
1006
1025
|
default:
|
|
@@ -1010,16 +1029,16 @@ function yt(n, e, t) {
|
|
|
1010
1029
|
}
|
|
1011
1030
|
}
|
|
1012
1031
|
}
|
|
1013
|
-
function
|
|
1014
|
-
var t, s, i, r, o, a, l,
|
|
1015
|
-
for (t = 0; t <
|
|
1016
|
-
for (a =
|
|
1032
|
+
function zn(n, e) {
|
|
1033
|
+
var t, s, i, r, o, a, l, c, u, p, h = 0, d = n.type === "FeatureCollection", m = n.type === "Feature", f = d ? n.features.length : 1;
|
|
1034
|
+
for (t = 0; t < f; t++) {
|
|
1035
|
+
for (a = d ? n.features[t].geometry : m ? n.geometry : n, c = d ? n.features[t].properties : m ? n.properties : {}, u = d ? n.features[t].bbox : m ? n.bbox : void 0, p = d ? 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
1036
|
if (r = l ? a.geometries[i] : a, r === null) {
|
|
1018
1037
|
if (e(
|
|
1019
1038
|
null,
|
|
1020
|
-
|
|
1039
|
+
h,
|
|
1040
|
+
c,
|
|
1021
1041
|
u,
|
|
1022
|
-
d,
|
|
1023
1042
|
p
|
|
1024
1043
|
) === !1)
|
|
1025
1044
|
return !1;
|
|
@@ -1034,9 +1053,9 @@ function qn(n, e) {
|
|
|
1034
1053
|
case "MultiPolygon": {
|
|
1035
1054
|
if (e(
|
|
1036
1055
|
r,
|
|
1037
|
-
|
|
1056
|
+
h,
|
|
1057
|
+
c,
|
|
1038
1058
|
u,
|
|
1039
|
-
d,
|
|
1040
1059
|
p
|
|
1041
1060
|
) === !1)
|
|
1042
1061
|
return !1;
|
|
@@ -1046,9 +1065,9 @@ function qn(n, e) {
|
|
|
1046
1065
|
for (s = 0; s < r.geometries.length; s++)
|
|
1047
1066
|
if (e(
|
|
1048
1067
|
r.geometries[s],
|
|
1049
|
-
|
|
1068
|
+
h,
|
|
1069
|
+
c,
|
|
1050
1070
|
u,
|
|
1051
|
-
d,
|
|
1052
1071
|
p
|
|
1053
1072
|
) === !1)
|
|
1054
1073
|
return !1;
|
|
@@ -1058,12 +1077,12 @@ function qn(n, e) {
|
|
|
1058
1077
|
throw new Error("Unknown Geometry Type");
|
|
1059
1078
|
}
|
|
1060
1079
|
}
|
|
1061
|
-
|
|
1080
|
+
h++;
|
|
1062
1081
|
}
|
|
1063
1082
|
}
|
|
1064
|
-
function
|
|
1083
|
+
function Zn(n, e, t) {
|
|
1065
1084
|
var s = t;
|
|
1066
|
-
return
|
|
1085
|
+
return zn(
|
|
1067
1086
|
n,
|
|
1068
1087
|
function(i, r, o, a, l) {
|
|
1069
1088
|
r === 0 && t === void 0 ? s = i : s = e(
|
|
@@ -1077,21 +1096,21 @@ function Gn(n, e, t) {
|
|
|
1077
1096
|
}
|
|
1078
1097
|
), s;
|
|
1079
1098
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return
|
|
1099
|
+
function Je(n) {
|
|
1100
|
+
return Zn(
|
|
1082
1101
|
n,
|
|
1083
|
-
(e, t) => e +
|
|
1102
|
+
(e, t) => e + Qn(t),
|
|
1084
1103
|
0
|
|
1085
1104
|
);
|
|
1086
1105
|
}
|
|
1087
|
-
function
|
|
1106
|
+
function Qn(n) {
|
|
1088
1107
|
let e = 0, t;
|
|
1089
1108
|
switch (n.type) {
|
|
1090
1109
|
case "Polygon":
|
|
1091
|
-
return
|
|
1110
|
+
return et(n.coordinates);
|
|
1092
1111
|
case "MultiPolygon":
|
|
1093
1112
|
for (t = 0; t < n.coordinates.length; t++)
|
|
1094
|
-
e +=
|
|
1113
|
+
e += et(n.coordinates[t]);
|
|
1095
1114
|
return e;
|
|
1096
1115
|
case "Point":
|
|
1097
1116
|
case "MultiPoint":
|
|
@@ -1101,29 +1120,29 @@ function Bn(n) {
|
|
|
1101
1120
|
}
|
|
1102
1121
|
return 0;
|
|
1103
1122
|
}
|
|
1104
|
-
function
|
|
1123
|
+
function et(n) {
|
|
1105
1124
|
let e = 0;
|
|
1106
1125
|
if (n && n.length > 0) {
|
|
1107
|
-
e += Math.abs(
|
|
1126
|
+
e += Math.abs(tt(n[0]));
|
|
1108
1127
|
for (let t = 1; t < n.length; t++)
|
|
1109
|
-
e -= Math.abs(
|
|
1128
|
+
e -= Math.abs(tt(n[t]));
|
|
1110
1129
|
}
|
|
1111
1130
|
return e;
|
|
1112
1131
|
}
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1132
|
+
var Yn = Qe * Qe / 2, qe = Math.PI / 180;
|
|
1133
|
+
function tt(n) {
|
|
1115
1134
|
const e = n.length - 1;
|
|
1116
1135
|
if (e <= 2)
|
|
1117
1136
|
return 0;
|
|
1118
1137
|
let t = 0, s = 0;
|
|
1119
1138
|
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] *
|
|
1121
|
-
t += (
|
|
1139
|
+
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] * qe, l = r[1] * qe, c = o[0] * qe;
|
|
1140
|
+
t += (c - a) * Math.sin(l), s++;
|
|
1122
1141
|
}
|
|
1123
|
-
return t *
|
|
1142
|
+
return t * Yn;
|
|
1124
1143
|
}
|
|
1125
|
-
class
|
|
1126
|
-
constructor(e = [], t =
|
|
1144
|
+
class Mt {
|
|
1145
|
+
constructor(e = [], t = Xn) {
|
|
1127
1146
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
1128
1147
|
for (let s = (this.length >> 1) - 1; s >= 0; s--) this._down(s);
|
|
1129
1148
|
}
|
|
@@ -1158,16 +1177,16 @@ class gt {
|
|
|
1158
1177
|
t[e] = r;
|
|
1159
1178
|
}
|
|
1160
1179
|
}
|
|
1161
|
-
function
|
|
1180
|
+
function Xn(n, e) {
|
|
1162
1181
|
return n < e ? -1 : n > e ? 1 : 0;
|
|
1163
1182
|
}
|
|
1164
|
-
function
|
|
1183
|
+
function bt(n, e) {
|
|
1165
1184
|
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
1185
|
}
|
|
1167
|
-
function
|
|
1186
|
+
function Jn(n, e) {
|
|
1168
1187
|
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
1188
|
}
|
|
1170
|
-
class
|
|
1189
|
+
class nt {
|
|
1171
1190
|
constructor(e, t, s, i) {
|
|
1172
1191
|
this.p = {
|
|
1173
1192
|
x: e[0],
|
|
@@ -1178,60 +1197,60 @@ class Qe {
|
|
|
1178
1197
|
return this.p.x === e.p.x && this.p.y === e.p.y;
|
|
1179
1198
|
}
|
|
1180
1199
|
}
|
|
1181
|
-
function
|
|
1200
|
+
function es(n, e) {
|
|
1182
1201
|
if (n.type === "FeatureCollection") {
|
|
1183
1202
|
const t = n.features;
|
|
1184
1203
|
for (let s = 0; s < t.length; s++)
|
|
1185
|
-
|
|
1204
|
+
st(t[s], e);
|
|
1186
1205
|
} else
|
|
1187
|
-
|
|
1206
|
+
st(n, e);
|
|
1188
1207
|
}
|
|
1189
|
-
let
|
|
1190
|
-
function
|
|
1208
|
+
let Ce = 0, Te = 0, ke = 0;
|
|
1209
|
+
function st(n, e) {
|
|
1191
1210
|
const t = n.type === "Feature" ? n.geometry : n;
|
|
1192
1211
|
let s = t.coordinates;
|
|
1193
1212
|
(t.type === "Polygon" || t.type === "MultiLineString") && (s = [s]), t.type === "LineString" && (s = [[s]]);
|
|
1194
1213
|
for (let i = 0; i < s.length; i++)
|
|
1195
1214
|
for (let r = 0; r < s[i].length; r++) {
|
|
1196
1215
|
let o = s[i][r][0], a = null;
|
|
1197
|
-
|
|
1216
|
+
Te = Te + 1;
|
|
1198
1217
|
for (let l = 0; l < s[i][r].length - 1; l++) {
|
|
1199
1218
|
a = s[i][r][l + 1];
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1219
|
+
const c = new nt(o, Ce, Te, ke), u = new nt(a, Ce, Te, ke + 1);
|
|
1220
|
+
c.otherEvent = u, u.otherEvent = c, bt(c, u) > 0 ? (u.isLeftEndpoint = !0, c.isLeftEndpoint = !1) : (c.isLeftEndpoint = !0, u.isLeftEndpoint = !1), e.push(c), e.push(u), o = a, ke = ke + 1;
|
|
1202
1221
|
}
|
|
1203
1222
|
}
|
|
1204
|
-
|
|
1223
|
+
Ce = Ce + 1;
|
|
1205
1224
|
}
|
|
1206
|
-
class
|
|
1225
|
+
class ts {
|
|
1207
1226
|
constructor(e) {
|
|
1208
1227
|
this.leftSweepEvent = e, this.rightSweepEvent = e.otherEvent;
|
|
1209
1228
|
}
|
|
1210
1229
|
}
|
|
1211
|
-
function
|
|
1230
|
+
function ns(n, e) {
|
|
1212
1231
|
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,
|
|
1214
|
-
if (
|
|
1232
|
+
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, c = e.rightSweepEvent.p.y, u = (c - a) * (i - t) - (l - o) * (r - s), p = (l - o) * (s - a) - (c - a) * (t - o), h = (i - t) * (s - a) - (r - s) * (t - o);
|
|
1233
|
+
if (u === 0)
|
|
1215
1234
|
return !1;
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1218
|
-
const
|
|
1219
|
-
return [
|
|
1235
|
+
const d = p / u, m = h / u;
|
|
1236
|
+
if (d >= 0 && d <= 1 && m >= 0 && m <= 1) {
|
|
1237
|
+
const f = t + d * (i - t), M = s + d * (r - s);
|
|
1238
|
+
return [f, M];
|
|
1220
1239
|
}
|
|
1221
1240
|
return !1;
|
|
1222
1241
|
}
|
|
1223
|
-
function
|
|
1242
|
+
function ss(n, e) {
|
|
1224
1243
|
e = e || !1;
|
|
1225
|
-
const t = [], s = new
|
|
1244
|
+
const t = [], s = new Mt([], Jn);
|
|
1226
1245
|
for (; n.length; ) {
|
|
1227
1246
|
const i = n.pop();
|
|
1228
1247
|
if (i.isLeftEndpoint) {
|
|
1229
|
-
const r = new
|
|
1248
|
+
const r = new ts(i);
|
|
1230
1249
|
for (let o = 0; o < s.data.length; o++) {
|
|
1231
1250
|
const a = s.data[o];
|
|
1232
1251
|
if (e && a.leftSweepEvent.featureId === i.featureId)
|
|
1233
1252
|
continue;
|
|
1234
|
-
const l =
|
|
1253
|
+
const l = ns(r, a);
|
|
1235
1254
|
l !== !1 && t.push(l);
|
|
1236
1255
|
}
|
|
1237
1256
|
s.push(r);
|
|
@@ -1239,47 +1258,47 @@ function Kn(n, e) {
|
|
|
1239
1258
|
}
|
|
1240
1259
|
return t;
|
|
1241
1260
|
}
|
|
1242
|
-
function
|
|
1243
|
-
const t = new
|
|
1244
|
-
return
|
|
1261
|
+
function is(n, e) {
|
|
1262
|
+
const t = new Mt([], bt);
|
|
1263
|
+
return es(n, t), ss(t, e);
|
|
1245
1264
|
}
|
|
1246
|
-
var
|
|
1247
|
-
function
|
|
1265
|
+
var rs = is;
|
|
1266
|
+
function os(n, e, t = {}) {
|
|
1248
1267
|
const { removeDuplicates: s = !0, ignoreSelfIntersections: i = !1 } = t;
|
|
1249
1268
|
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(
|
|
1251
|
-
const o =
|
|
1252
|
-
|
|
1269
|
+
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(Ve(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(Ve(e));
|
|
1270
|
+
const o = rs(
|
|
1271
|
+
Ye(r),
|
|
1253
1272
|
i
|
|
1254
1273
|
);
|
|
1255
1274
|
let a = [];
|
|
1256
1275
|
if (s) {
|
|
1257
1276
|
const l = {};
|
|
1258
|
-
o.forEach((
|
|
1259
|
-
const
|
|
1260
|
-
l[
|
|
1277
|
+
o.forEach((c) => {
|
|
1278
|
+
const u = c.join(",");
|
|
1279
|
+
l[u] || (l[u] = !0, a.push(c));
|
|
1261
1280
|
});
|
|
1262
1281
|
} else
|
|
1263
1282
|
a = o;
|
|
1264
|
-
return
|
|
1283
|
+
return Ye(a.map((l) => St(l)));
|
|
1265
1284
|
}
|
|
1266
|
-
function
|
|
1285
|
+
function as(n, e = {}) {
|
|
1267
1286
|
let t = 0, s = 0, i = 0;
|
|
1268
|
-
return
|
|
1287
|
+
return vt(
|
|
1269
1288
|
n,
|
|
1270
1289
|
function(r) {
|
|
1271
1290
|
t += r[0], s += r[1], i++;
|
|
1272
1291
|
}
|
|
1273
|
-
),
|
|
1292
|
+
), St([t / i, s / i], e.properties);
|
|
1274
1293
|
}
|
|
1275
|
-
const
|
|
1276
|
-
length:
|
|
1294
|
+
const ls = nn({
|
|
1295
|
+
length: sn
|
|
1277
1296
|
});
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1297
|
+
function it(n, e) {
|
|
1298
|
+
return ls(n).from(at[T.meter]).to(at[e]);
|
|
1280
1299
|
}
|
|
1281
|
-
const
|
|
1282
|
-
function
|
|
1300
|
+
const rt = 1e4;
|
|
1301
|
+
function Oe({
|
|
1283
1302
|
meters: n,
|
|
1284
1303
|
unit: e,
|
|
1285
1304
|
locale: t,
|
|
@@ -1287,18 +1306,18 @@ function ke({
|
|
|
1287
1306
|
autoSplitNumber: s,
|
|
1288
1307
|
...i
|
|
1289
1308
|
} = {
|
|
1290
|
-
autoSplitNumber:
|
|
1309
|
+
autoSplitNumber: rt
|
|
1291
1310
|
}
|
|
1292
1311
|
}) {
|
|
1293
|
-
const r = e ===
|
|
1294
|
-
let l,
|
|
1312
|
+
const r = e === Ne["m-km"], o = e === Ne["ft-mi"], a = r || o;
|
|
1313
|
+
let l, c;
|
|
1295
1314
|
if (a) {
|
|
1296
|
-
const
|
|
1297
|
-
let p =
|
|
1298
|
-
l =
|
|
1315
|
+
const u = n < (s ?? rt);
|
|
1316
|
+
let p = u ? T.meter : T.kilometer;
|
|
1317
|
+
l = u ? Ee.meter : Ee.kilometer, o && (l = u ? Ee.feet : Ee.mile, p = u ? T.feet : T.mile), c = it(n, p);
|
|
1299
1318
|
} else
|
|
1300
|
-
l =
|
|
1301
|
-
return `${
|
|
1319
|
+
l = Ee[e], c = it(n, e);
|
|
1320
|
+
return `${mt(c, t, {
|
|
1302
1321
|
style: "unit",
|
|
1303
1322
|
unit: l,
|
|
1304
1323
|
unitDisplay: "short",
|
|
@@ -1308,7 +1327,7 @@ function ke({
|
|
|
1308
1327
|
...i
|
|
1309
1328
|
})}`;
|
|
1310
1329
|
}
|
|
1311
|
-
function
|
|
1330
|
+
function gi(n, {
|
|
1312
1331
|
hasDoubleClickZoom: e
|
|
1313
1332
|
}) {
|
|
1314
1333
|
return typeof n == "boolean" ? {
|
|
@@ -1318,7 +1337,7 @@ function Xs(n, {
|
|
|
1318
1337
|
doubleClickZoom: e
|
|
1319
1338
|
};
|
|
1320
1339
|
}
|
|
1321
|
-
function
|
|
1340
|
+
function Et(n, e, t) {
|
|
1322
1341
|
if (n > 0) {
|
|
1323
1342
|
const {
|
|
1324
1343
|
formatTooltip: s,
|
|
@@ -1340,13 +1359,13 @@ function vt(n, e, t) {
|
|
|
1340
1359
|
}
|
|
1341
1360
|
return [];
|
|
1342
1361
|
}
|
|
1343
|
-
class
|
|
1362
|
+
class cs extends Zt {
|
|
1344
1363
|
constructor() {
|
|
1345
1364
|
super(...arguments);
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1365
|
+
ee(this, "_isMeasuringSessionFinished", !1);
|
|
1366
|
+
ee(this, "area", 0);
|
|
1367
|
+
ee(this, "tooltips", []);
|
|
1368
|
+
ee(this, "resultPolygon", {
|
|
1350
1369
|
type: "FeatureCollection",
|
|
1351
1370
|
features: []
|
|
1352
1371
|
});
|
|
@@ -1355,9 +1374,9 @@ class ts extends zt {
|
|
|
1355
1374
|
this._isMeasuringSessionFinished && (this._isMeasuringSessionFinished = !1, this.resetClickSequence(), this.area = 0);
|
|
1356
1375
|
const {
|
|
1357
1376
|
picks: i
|
|
1358
|
-
} = t, r =
|
|
1377
|
+
} = t, r = Qt(i), o = this.getClickSequence();
|
|
1359
1378
|
let a = !1;
|
|
1360
|
-
!r && !this.allowOverlapping(s) && (this.addClickSequence(t), a = !0), this.area =
|
|
1379
|
+
!r && !this.allowOverlapping(s) && (this.addClickSequence(t), a = !0), this.area = Je({
|
|
1361
1380
|
type: "Polygon",
|
|
1362
1381
|
coordinates: [this.getClickSequence()]
|
|
1363
1382
|
}), this.isFinalizedEdition(o, r) ? this.finalizeEdition(s) : a && s.onEdit({
|
|
@@ -1378,8 +1397,8 @@ class ts extends zt {
|
|
|
1378
1397
|
super.handlePointerMove(t, s);
|
|
1379
1398
|
const i = this.getTentativeGuide(s);
|
|
1380
1399
|
if (i && i.geometry.type === "Polygon") {
|
|
1381
|
-
const r =
|
|
1382
|
-
this.area =
|
|
1400
|
+
const r = as(i);
|
|
1401
|
+
this.area = Je(i), this.tooltips = Et(this.area, r.geometry.coordinates, s.modeConfig);
|
|
1383
1402
|
}
|
|
1384
1403
|
}
|
|
1385
1404
|
resetClickSequence() {
|
|
@@ -1412,7 +1431,7 @@ class ts extends zt {
|
|
|
1412
1431
|
type: "LineString",
|
|
1413
1432
|
coordinates: [...i.slice(0, i.length - 1)]
|
|
1414
1433
|
};
|
|
1415
|
-
|
|
1434
|
+
os(o, a).features.length > 0 && (s = !0);
|
|
1416
1435
|
}
|
|
1417
1436
|
return s;
|
|
1418
1437
|
}
|
|
@@ -1428,7 +1447,7 @@ class ts extends zt {
|
|
|
1428
1447
|
const r = this.getAddFeatureOrBooleanPolygonAction(i, t);
|
|
1429
1448
|
this._isMeasuringSessionFinished = !0, r && (this.resultPolygon = r.updatedData, t.onEdit({
|
|
1430
1449
|
...r,
|
|
1431
|
-
editType:
|
|
1450
|
+
editType: B.addPosition,
|
|
1432
1451
|
editContext: {
|
|
1433
1452
|
...r.editContext,
|
|
1434
1453
|
distance: this.area,
|
|
@@ -1451,7 +1470,7 @@ class ts extends zt {
|
|
|
1451
1470
|
unit: i,
|
|
1452
1471
|
options: r
|
|
1453
1472
|
}) {
|
|
1454
|
-
return
|
|
1473
|
+
return Oe({
|
|
1455
1474
|
meters: t,
|
|
1456
1475
|
locale: s,
|
|
1457
1476
|
unit: i,
|
|
@@ -1459,22 +1478,22 @@ class ts extends zt {
|
|
|
1459
1478
|
}) + "2";
|
|
1460
1479
|
}
|
|
1461
1480
|
}
|
|
1462
|
-
class
|
|
1481
|
+
class us extends ut {
|
|
1463
1482
|
constructor() {
|
|
1464
1483
|
super(...arguments);
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1484
|
+
ee(this, "_isMeasuringSessionFinished", !1);
|
|
1485
|
+
ee(this, "_currentArea", 0);
|
|
1486
|
+
ee(this, "resultPolygon", {
|
|
1468
1487
|
type: "FeatureCollection",
|
|
1469
1488
|
features: []
|
|
1470
1489
|
});
|
|
1471
|
-
|
|
1490
|
+
ee(this, "tooltips", []);
|
|
1472
1491
|
}
|
|
1473
1492
|
handleClick(t, s) {
|
|
1474
1493
|
this._isMeasuringSessionFinished && (this._isMeasuringSessionFinished = !1, this.resetClickSequence(), this._currentArea = 0), super.handleClick(t, s);
|
|
1475
1494
|
}
|
|
1476
1495
|
handlePointerMove(t, s) {
|
|
1477
|
-
this._isMeasuringSessionFinished || (super.handlePointerMove(t, s), this.tooltips =
|
|
1496
|
+
this._isMeasuringSessionFinished || (super.handlePointerMove(t, s), this.tooltips = Et(this.areaCircle, this.position, s.modeConfig));
|
|
1478
1497
|
}
|
|
1479
1498
|
checkAndFinishPolygon(t) {
|
|
1480
1499
|
const s = this.getClickSequence(), i = this.getTentativeGuide(t);
|
|
@@ -1498,7 +1517,7 @@ class ns extends at {
|
|
|
1498
1517
|
const i = this.getAddFeatureOrBooleanPolygonAction(s, t);
|
|
1499
1518
|
this._isMeasuringSessionFinished = !0, t.onUpdateCursor("cell"), i && (this.resultPolygon = i.updatedData, t.onEdit({
|
|
1500
1519
|
...i,
|
|
1501
|
-
editType:
|
|
1520
|
+
editType: B.addPosition,
|
|
1502
1521
|
editContext: {
|
|
1503
1522
|
...i.editContext,
|
|
1504
1523
|
distance: this._currentArea,
|
|
@@ -1527,7 +1546,7 @@ class ns extends at {
|
|
|
1527
1546
|
unit: i,
|
|
1528
1547
|
options: r
|
|
1529
1548
|
}) {
|
|
1530
|
-
return
|
|
1549
|
+
return Oe({
|
|
1531
1550
|
meters: t,
|
|
1532
1551
|
locale: s,
|
|
1533
1552
|
unit: i,
|
|
@@ -1535,12 +1554,12 @@ class ns extends at {
|
|
|
1535
1554
|
}) + "2";
|
|
1536
1555
|
}
|
|
1537
1556
|
}
|
|
1538
|
-
class
|
|
1557
|
+
class wt extends Yt {
|
|
1539
1558
|
handleClick(e, t) {
|
|
1540
1559
|
super.handleClick(e, t), t.onEdit({
|
|
1541
1560
|
// data is the same
|
|
1542
1561
|
updatedData: t.data,
|
|
1543
|
-
editType:
|
|
1562
|
+
editType: B.addPosition,
|
|
1544
1563
|
editContext: {
|
|
1545
1564
|
distance: this._currentDistance,
|
|
1546
1565
|
finished: this._isMeasuringSessionFinished,
|
|
@@ -1554,7 +1573,7 @@ class Mt extends Wt {
|
|
|
1554
1573
|
const {
|
|
1555
1574
|
key: s
|
|
1556
1575
|
} = e, i = this.getClickSequence().length;
|
|
1557
|
-
let r =
|
|
1576
|
+
let r = B.finish;
|
|
1558
1577
|
switch (s) {
|
|
1559
1578
|
case "Escape":
|
|
1560
1579
|
t.onEdit({
|
|
@@ -1562,12 +1581,12 @@ class Mt extends Wt {
|
|
|
1562
1581
|
type: "FeatureCollection",
|
|
1563
1582
|
features: []
|
|
1564
1583
|
},
|
|
1565
|
-
editType:
|
|
1584
|
+
editType: B.cancel,
|
|
1566
1585
|
editContext: {}
|
|
1567
1586
|
});
|
|
1568
1587
|
break;
|
|
1569
1588
|
case "Enter":
|
|
1570
|
-
this._isMeasuringSessionFinished = !0, i === 1 && (this.resetClickSequence(), r =
|
|
1589
|
+
this._isMeasuringSessionFinished = !0, i === 1 && (this.resetClickSequence(), r = B.cancel), t.onUpdateCursor("cell"), t.onEdit({
|
|
1571
1590
|
updatedData: t.data,
|
|
1572
1591
|
editType: r,
|
|
1573
1592
|
editContext: {
|
|
@@ -1586,7 +1605,7 @@ class Mt extends Wt {
|
|
|
1586
1605
|
unit: s,
|
|
1587
1606
|
options: i
|
|
1588
1607
|
}) {
|
|
1589
|
-
return
|
|
1608
|
+
return Oe({
|
|
1590
1609
|
meters: e,
|
|
1591
1610
|
locale: t,
|
|
1592
1611
|
unit: s,
|
|
@@ -1594,8 +1613,8 @@ class Mt extends Wt {
|
|
|
1594
1613
|
});
|
|
1595
1614
|
}
|
|
1596
1615
|
}
|
|
1597
|
-
const
|
|
1598
|
-
id:
|
|
1616
|
+
const Ae = "mapMeasureLayer", ds = {
|
|
1617
|
+
id: Ae,
|
|
1599
1618
|
pickable: !1,
|
|
1600
1619
|
billboard: !1,
|
|
1601
1620
|
editHandlePointRadiusUnits: "pixels",
|
|
@@ -1619,19 +1638,19 @@ const Te = "mapMeasureLayer", ss = {
|
|
|
1619
1638
|
getLineWidth: 2
|
|
1620
1639
|
}
|
|
1621
1640
|
}
|
|
1622
|
-
},
|
|
1641
|
+
}, $e = {
|
|
1623
1642
|
editing: [23, 102, 214, 255],
|
|
1624
1643
|
finished: [71, 219, 153, 255],
|
|
1625
1644
|
point: [255, 255, 255, 255]
|
|
1626
|
-
},
|
|
1645
|
+
}, ot = {
|
|
1627
1646
|
styles: {
|
|
1628
1647
|
colors: {
|
|
1629
|
-
editing:
|
|
1630
|
-
finished:
|
|
1631
|
-
point:
|
|
1648
|
+
editing: $e.editing,
|
|
1649
|
+
finished: $e.finished,
|
|
1650
|
+
point: $e.point
|
|
1632
1651
|
}
|
|
1633
1652
|
}
|
|
1634
|
-
},
|
|
1653
|
+
}, T = {
|
|
1635
1654
|
kilometer: "kilometer",
|
|
1636
1655
|
meter: "meter",
|
|
1637
1656
|
centimeter: "centimeter",
|
|
@@ -1639,31 +1658,31 @@ const Te = "mapMeasureLayer", ss = {
|
|
|
1639
1658
|
mile: "mile",
|
|
1640
1659
|
yard: "yard",
|
|
1641
1660
|
feet: "feet"
|
|
1642
|
-
},
|
|
1661
|
+
}, Ne = {
|
|
1643
1662
|
"m-km": "m-km",
|
|
1644
1663
|
"ft-mi": "ft-mi",
|
|
1645
|
-
...
|
|
1646
|
-
},
|
|
1664
|
+
...T
|
|
1665
|
+
}, fs = {
|
|
1647
1666
|
meters: "meters",
|
|
1648
1667
|
kilometer: "kilometers",
|
|
1649
1668
|
mile: "miles"
|
|
1650
|
-
},
|
|
1651
|
-
[
|
|
1652
|
-
[
|
|
1653
|
-
[
|
|
1654
|
-
[
|
|
1655
|
-
[
|
|
1656
|
-
[
|
|
1657
|
-
[
|
|
1658
|
-
},
|
|
1659
|
-
[
|
|
1660
|
-
[
|
|
1661
|
-
[
|
|
1662
|
-
[
|
|
1663
|
-
[
|
|
1664
|
-
[
|
|
1665
|
-
[
|
|
1666
|
-
},
|
|
1669
|
+
}, at = {
|
|
1670
|
+
[T.kilometer]: "km",
|
|
1671
|
+
[T.meter]: "m",
|
|
1672
|
+
[T.centimeter]: "cm",
|
|
1673
|
+
[T.milimeter]: "mm",
|
|
1674
|
+
[T.mile]: "mi",
|
|
1675
|
+
[T.yard]: "yd",
|
|
1676
|
+
[T.feet]: "ft"
|
|
1677
|
+
}, Ee = {
|
|
1678
|
+
[T.kilometer]: "kilometer",
|
|
1679
|
+
[T.meter]: "meter",
|
|
1680
|
+
[T.centimeter]: "centimeter",
|
|
1681
|
+
[T.milimeter]: "millimeter",
|
|
1682
|
+
[T.mile]: "mile",
|
|
1683
|
+
[T.yard]: "yard",
|
|
1684
|
+
[T.feet]: "foot"
|
|
1685
|
+
}, I = {
|
|
1667
1686
|
"m-km": {
|
|
1668
1687
|
value: "m-km",
|
|
1669
1688
|
system: "metric"
|
|
@@ -1700,34 +1719,34 @@ const Te = "mapMeasureLayer", ss = {
|
|
|
1700
1719
|
value: "feet",
|
|
1701
1720
|
system: "imperial"
|
|
1702
1721
|
}
|
|
1703
|
-
},
|
|
1722
|
+
}, lt = [I["m-km"], I.kilometer, I.meter, I["ft-mi"], I.mile, I.feet], ms = [I["m-km"], I.kilometer, I.meter, I["ft-mi"], I.mile, I.feet], ps = {
|
|
1704
1723
|
distance: {
|
|
1705
1724
|
value: "distance",
|
|
1706
|
-
mode:
|
|
1725
|
+
mode: wt
|
|
1707
1726
|
},
|
|
1708
1727
|
buffer: {
|
|
1709
1728
|
value: "buffer",
|
|
1710
|
-
mode:
|
|
1729
|
+
mode: us
|
|
1711
1730
|
},
|
|
1712
1731
|
area: {
|
|
1713
1732
|
value: "area",
|
|
1714
|
-
mode:
|
|
1733
|
+
mode: cs
|
|
1715
1734
|
}
|
|
1716
|
-
},
|
|
1717
|
-
distance:
|
|
1718
|
-
buffer:
|
|
1719
|
-
area:
|
|
1735
|
+
}, ys = {
|
|
1736
|
+
distance: lt,
|
|
1737
|
+
buffer: lt,
|
|
1738
|
+
area: ms
|
|
1720
1739
|
};
|
|
1721
|
-
function
|
|
1740
|
+
function hs({
|
|
1722
1741
|
mode: n,
|
|
1723
1742
|
...e
|
|
1724
1743
|
}) {
|
|
1725
|
-
const t =
|
|
1744
|
+
const t = gs({
|
|
1726
1745
|
mode: n,
|
|
1727
1746
|
...e
|
|
1728
1747
|
});
|
|
1729
1748
|
return {
|
|
1730
|
-
type:
|
|
1749
|
+
type: dt,
|
|
1731
1750
|
props: {
|
|
1732
1751
|
...t,
|
|
1733
1752
|
mode: n,
|
|
@@ -1735,7 +1754,7 @@ function ls({
|
|
|
1735
1754
|
}
|
|
1736
1755
|
};
|
|
1737
1756
|
}
|
|
1738
|
-
function
|
|
1757
|
+
function gs({
|
|
1739
1758
|
mode: n,
|
|
1740
1759
|
layerProps: e,
|
|
1741
1760
|
locale: t,
|
|
@@ -1746,14 +1765,14 @@ function cs({
|
|
|
1746
1765
|
pointColor: a,
|
|
1747
1766
|
textOptions: l
|
|
1748
1767
|
}) {
|
|
1749
|
-
const
|
|
1768
|
+
const c = ve(e, {
|
|
1750
1769
|
visible: s,
|
|
1751
1770
|
pickable: s,
|
|
1752
1771
|
modeConfig: {
|
|
1753
1772
|
// We force distance due to conversion is addressed at feature getText level
|
|
1754
|
-
formatTooltip: (
|
|
1773
|
+
formatTooltip: (h) => h,
|
|
1755
1774
|
turfOptions: {
|
|
1756
|
-
units:
|
|
1775
|
+
units: fs.meters
|
|
1757
1776
|
}
|
|
1758
1777
|
},
|
|
1759
1778
|
...s && {
|
|
@@ -1761,10 +1780,10 @@ function cs({
|
|
|
1761
1780
|
},
|
|
1762
1781
|
_subLayerProps: {
|
|
1763
1782
|
tooltips: {
|
|
1764
|
-
getText: (
|
|
1765
|
-
var
|
|
1766
|
-
return (
|
|
1767
|
-
meters:
|
|
1783
|
+
getText: (h) => {
|
|
1784
|
+
var d;
|
|
1785
|
+
return (d = n == null ? void 0 : n.getTooltipText) == null ? void 0 : d.call(n, {
|
|
1786
|
+
meters: h.text,
|
|
1768
1787
|
locale: t,
|
|
1769
1788
|
unit: i,
|
|
1770
1789
|
options: l
|
|
@@ -1775,7 +1794,7 @@ function cs({
|
|
|
1775
1794
|
}
|
|
1776
1795
|
}
|
|
1777
1796
|
}
|
|
1778
|
-
}),
|
|
1797
|
+
}), u = ve(ds, {
|
|
1779
1798
|
_subLayerProps: {
|
|
1780
1799
|
guides: {
|
|
1781
1800
|
getLineColor: o,
|
|
@@ -1785,37 +1804,37 @@ function cs({
|
|
|
1785
1804
|
getEditHandlePointColor: a,
|
|
1786
1805
|
getEditHandlePointOutlineColor: o
|
|
1787
1806
|
});
|
|
1788
|
-
return
|
|
1807
|
+
return ve(u, c);
|
|
1789
1808
|
}
|
|
1790
|
-
const
|
|
1809
|
+
const Ss = (n) => Ge()((e) => ({
|
|
1791
1810
|
measurements: n.reduce((s, i) => {
|
|
1792
1811
|
const {
|
|
1793
1812
|
mapId: r,
|
|
1794
1813
|
modeSelected: o,
|
|
1795
|
-
modes: a =
|
|
1796
|
-
units: l =
|
|
1797
|
-
distance:
|
|
1798
|
-
finished:
|
|
1814
|
+
modes: a = ps,
|
|
1815
|
+
units: l = ys,
|
|
1816
|
+
distance: c = 0,
|
|
1817
|
+
finished: u = !1,
|
|
1799
1818
|
locale: p = "en",
|
|
1800
|
-
positions:
|
|
1801
|
-
clearLayerOnStart:
|
|
1802
|
-
unit: m =
|
|
1803
|
-
enabled:
|
|
1819
|
+
positions: h = [],
|
|
1820
|
+
clearLayerOnStart: d = !1,
|
|
1821
|
+
unit: m = Ne["m-km"],
|
|
1822
|
+
enabled: f = !1
|
|
1804
1823
|
} = i;
|
|
1805
1824
|
return s[r] = {
|
|
1806
1825
|
modes: a,
|
|
1807
1826
|
units: l,
|
|
1808
1827
|
modeSelected: o,
|
|
1809
|
-
distance:
|
|
1810
|
-
finished:
|
|
1828
|
+
distance: c,
|
|
1829
|
+
finished: u,
|
|
1811
1830
|
locale: p,
|
|
1812
|
-
positions:
|
|
1831
|
+
positions: h,
|
|
1813
1832
|
unit: m,
|
|
1814
|
-
clearLayerOnStart:
|
|
1815
|
-
enabled:
|
|
1833
|
+
clearLayerOnStart: d,
|
|
1834
|
+
enabled: f
|
|
1816
1835
|
}, s;
|
|
1817
1836
|
}, {}),
|
|
1818
|
-
mode:
|
|
1837
|
+
mode: wt,
|
|
1819
1838
|
setModeInstance: (s, i) => {
|
|
1820
1839
|
e((r) => ({
|
|
1821
1840
|
measurements: {
|
|
@@ -1893,7 +1912,7 @@ const us = (n) => qe()((e) => ({
|
|
|
1893
1912
|
}
|
|
1894
1913
|
}));
|
|
1895
1914
|
},
|
|
1896
|
-
|
|
1915
|
+
setEnabled: (s, i) => {
|
|
1897
1916
|
e((r) => ({
|
|
1898
1917
|
measurements: {
|
|
1899
1918
|
...r.measurements,
|
|
@@ -1904,146 +1923,146 @@ const us = (n) => qe()((e) => ({
|
|
|
1904
1923
|
}
|
|
1905
1924
|
}));
|
|
1906
1925
|
}
|
|
1907
|
-
})),
|
|
1908
|
-
function
|
|
1909
|
-
const e =
|
|
1926
|
+
})), Lt = Ie({});
|
|
1927
|
+
function Si(n) {
|
|
1928
|
+
const e = C(5), {
|
|
1910
1929
|
children: t,
|
|
1911
1930
|
values: s
|
|
1912
1931
|
} = n;
|
|
1913
1932
|
let i;
|
|
1914
|
-
e[0] !== s ? (i =
|
|
1915
|
-
const [r] =
|
|
1933
|
+
e[0] !== s ? (i = Ss(s), e[0] = s, e[1] = i) : i = e[1];
|
|
1934
|
+
const [r] = ge(i);
|
|
1916
1935
|
let o;
|
|
1917
|
-
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(
|
|
1936
|
+
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ Z(Lt.Provider, { value: r, children: t }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
1918
1937
|
}
|
|
1919
|
-
function
|
|
1920
|
-
const e =
|
|
1938
|
+
function F(n) {
|
|
1939
|
+
const e = Be(Lt);
|
|
1921
1940
|
if (!e)
|
|
1922
1941
|
throw new Error("Missing Map.Provider in the tree");
|
|
1923
|
-
return
|
|
1942
|
+
return He(e, n);
|
|
1924
1943
|
}
|
|
1925
|
-
function
|
|
1926
|
-
const e =
|
|
1944
|
+
function Pt(n) {
|
|
1945
|
+
const e = C(73), {
|
|
1927
1946
|
mapId: t
|
|
1928
1947
|
} = n;
|
|
1929
1948
|
let s;
|
|
1930
|
-
e[0] !== t ? (s = (
|
|
1931
|
-
const i =
|
|
1949
|
+
e[0] !== t ? (s = (w) => w.measurements[t].modes, e[0] = t, e[1] = s) : s = e[1];
|
|
1950
|
+
const i = F(s);
|
|
1932
1951
|
let r;
|
|
1933
|
-
e[2] !== t ? (r = (
|
|
1934
|
-
const o =
|
|
1952
|
+
e[2] !== t ? (r = (w) => w.measurements[t].units, e[2] = t, e[3] = r) : r = e[3];
|
|
1953
|
+
const o = F(r);
|
|
1935
1954
|
let a;
|
|
1936
|
-
e[4] !== t ? (a = (
|
|
1937
|
-
const l =
|
|
1938
|
-
let
|
|
1939
|
-
e[6] !==
|
|
1940
|
-
const p =
|
|
1941
|
-
let
|
|
1942
|
-
e[9] !== t ? (
|
|
1943
|
-
const
|
|
1955
|
+
e[4] !== t ? (a = (w) => w.measurements[t].distance, e[4] = t, e[5] = a) : a = e[5];
|
|
1956
|
+
const l = F(a), c = F(_s);
|
|
1957
|
+
let u;
|
|
1958
|
+
e[6] !== c || e[7] !== t ? (u = (w) => c(t, w), e[6] = c, e[7] = t, e[8] = u) : u = e[8];
|
|
1959
|
+
const p = u;
|
|
1960
|
+
let h;
|
|
1961
|
+
e[9] !== t ? (h = (w) => w.measurements[t].clearLayerOnStart, e[9] = t, e[10] = h) : h = e[10];
|
|
1962
|
+
const d = F(h);
|
|
1944
1963
|
let m;
|
|
1945
|
-
e[11] !== t ? (m = (
|
|
1946
|
-
const
|
|
1964
|
+
e[11] !== t ? (m = (w) => w.measurements[t].modeSelected, e[11] = t, e[12] = m) : m = e[12];
|
|
1965
|
+
const f = F(m), M = F(Ps);
|
|
1947
1966
|
let S;
|
|
1948
|
-
e[13] !==
|
|
1967
|
+
e[13] !== M || e[14] !== t ? (S = (w) => M(t, w), e[13] = M, e[14] = t, e[15] = S) : S = e[15];
|
|
1949
1968
|
const v = S;
|
|
1969
|
+
let y;
|
|
1970
|
+
e[16] !== t ? (y = (w) => w.measurements[t].enabled, e[16] = t, e[17] = y) : y = e[17];
|
|
1971
|
+
const b = F(y), P = F(Ls);
|
|
1972
|
+
let _;
|
|
1973
|
+
e[18] !== P || e[19] !== t ? (_ = (w) => P(t, w), e[18] = P, e[19] = t, e[20] = _) : _ = e[20];
|
|
1974
|
+
const g = _;
|
|
1950
1975
|
let E;
|
|
1951
|
-
e[
|
|
1952
|
-
const
|
|
1953
|
-
let
|
|
1954
|
-
e[
|
|
1955
|
-
const
|
|
1956
|
-
let
|
|
1957
|
-
e[
|
|
1958
|
-
const
|
|
1959
|
-
let
|
|
1960
|
-
e[
|
|
1961
|
-
const
|
|
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;
|
|
1976
|
+
e[21] !== t ? (E = (w) => w.measurements[t].finished, e[21] = t, e[22] = E) : E = e[22];
|
|
1977
|
+
const L = F(E), A = F(ws);
|
|
1978
|
+
let O;
|
|
1979
|
+
e[23] !== A || e[24] !== t ? (O = (w) => A(t, w), e[23] = A, e[24] = t, e[25] = O) : O = e[25];
|
|
1980
|
+
const U = O;
|
|
1981
|
+
let q;
|
|
1982
|
+
e[26] !== t ? (q = (w) => w.measurements[t].locale, e[26] = t, e[27] = q) : q = e[27];
|
|
1983
|
+
const Y = F(q), V = F(Es);
|
|
1984
|
+
let x;
|
|
1985
|
+
e[28] !== V || e[29] !== t ? (x = (w) => V(t, w), e[28] = V, e[29] = t, e[30] = x) : x = e[30];
|
|
1986
|
+
const $ = x;
|
|
1968
1987
|
let te;
|
|
1969
|
-
e[31] !== t ? (te = (
|
|
1970
|
-
const N =
|
|
1971
|
-
let
|
|
1972
|
-
e[33] !==
|
|
1973
|
-
const
|
|
1988
|
+
e[31] !== t ? (te = (w) => w.measurements[t].modeInstance, e[31] = t, e[32] = te) : te = e[32];
|
|
1989
|
+
const N = F(te), be = F(bs);
|
|
1990
|
+
let G;
|
|
1991
|
+
e[33] !== be || e[34] !== t ? (G = (w) => be(t, w), e[33] = be, e[34] = t, e[35] = G) : G = e[35];
|
|
1992
|
+
const Se = G;
|
|
1974
1993
|
let X;
|
|
1975
|
-
e[36] !== t ? (X = (
|
|
1976
|
-
const
|
|
1994
|
+
e[36] !== t ? (X = (w) => w.measurements[t].positions, e[36] = t, e[37] = X) : X = e[37];
|
|
1995
|
+
const me = F(X), ne = F(Ms);
|
|
1977
1996
|
let se;
|
|
1978
|
-
e[38] !== ne || e[39] !== t ? (se = (
|
|
1997
|
+
e[38] !== ne || e[39] !== t ? (se = (w) => ne(t, w), e[38] = ne, e[39] = t, e[40] = se) : se = e[40];
|
|
1979
1998
|
const H = se;
|
|
1980
1999
|
let ie;
|
|
1981
|
-
e[41] !== t ? (ie = (
|
|
1982
|
-
const re =
|
|
2000
|
+
e[41] !== t ? (ie = (w) => w.measurements[t].unit, e[41] = t, e[42] = ie) : ie = e[42];
|
|
2001
|
+
const re = F(ie), oe = F(vs);
|
|
1983
2002
|
let J;
|
|
1984
|
-
e[43] !== oe || e[44] !== t ? (J = (
|
|
1985
|
-
const
|
|
1986
|
-
let
|
|
1987
|
-
e[46] !== N || e[47] !== H ? (
|
|
2003
|
+
e[43] !== oe || e[44] !== t ? (J = (w) => oe(t, w), e[43] = oe, e[44] = t, e[45] = J) : J = e[45];
|
|
2004
|
+
const j = J;
|
|
2005
|
+
let K;
|
|
2006
|
+
e[46] !== N || e[47] !== H ? (K = () => {
|
|
1988
2007
|
N == null || N.resetClickSequence(), H([]);
|
|
1989
|
-
}, e[46] = N, e[47] = H, e[48] =
|
|
1990
|
-
const
|
|
1991
|
-
let
|
|
1992
|
-
e[49] !== g ? (
|
|
1993
|
-
g(
|
|
1994
|
-
}, e[49] = g, e[50] =
|
|
1995
|
-
const ae =
|
|
1996
|
-
let
|
|
1997
|
-
return e[51] !==
|
|
2008
|
+
}, e[46] = N, e[47] = H, e[48] = K) : K = e[48];
|
|
2009
|
+
const z = K;
|
|
2010
|
+
let W;
|
|
2011
|
+
e[49] !== g ? (W = (w) => {
|
|
2012
|
+
g(w);
|
|
2013
|
+
}, e[49] = g, e[50] = W) : W = e[50];
|
|
2014
|
+
const ae = W;
|
|
2015
|
+
let pe;
|
|
2016
|
+
return e[51] !== z || e[52] !== d || e[53] !== l || e[54] !== b || e[55] !== L || e[56] !== Y || e[57] !== N || e[58] !== f || e[59] !== i || e[60] !== me || e[61] !== p || e[62] !== g || e[63] !== U || e[64] !== $ || e[65] !== Se || e[66] !== v || e[67] !== H || e[68] !== j || e[69] !== ae || e[70] !== re || e[71] !== o ? (pe = {
|
|
1998
2017
|
modes: i,
|
|
1999
2018
|
units: o,
|
|
2000
2019
|
distance: l,
|
|
2001
|
-
clearLayerOnStart:
|
|
2002
|
-
modeSelected:
|
|
2020
|
+
clearLayerOnStart: d,
|
|
2021
|
+
modeSelected: f,
|
|
2003
2022
|
enabled: b,
|
|
2004
|
-
finished:
|
|
2023
|
+
finished: L,
|
|
2005
2024
|
locale: Y,
|
|
2006
2025
|
modeInstance: N,
|
|
2007
|
-
positions:
|
|
2026
|
+
positions: me,
|
|
2008
2027
|
unit: re,
|
|
2009
2028
|
setDistance: p,
|
|
2010
2029
|
setModeSelected: v,
|
|
2011
|
-
setFinished:
|
|
2012
|
-
setLocale:
|
|
2030
|
+
setFinished: U,
|
|
2031
|
+
setLocale: $,
|
|
2013
2032
|
setPositions: H,
|
|
2014
|
-
setUnit:
|
|
2015
|
-
|
|
2033
|
+
setUnit: j,
|
|
2034
|
+
setEnabled: g,
|
|
2016
2035
|
toggleLayer: ae,
|
|
2017
|
-
clearLayer:
|
|
2018
|
-
setModeInstance:
|
|
2019
|
-
}, e[51] =
|
|
2036
|
+
clearLayer: z,
|
|
2037
|
+
setModeInstance: Se
|
|
2038
|
+
}, e[51] = z, e[52] = d, e[53] = l, e[54] = b, e[55] = L, e[56] = Y, e[57] = N, e[58] = f, e[59] = i, e[60] = me, e[61] = p, e[62] = g, e[63] = U, e[64] = $, e[65] = Se, e[66] = v, e[67] = H, e[68] = j, e[69] = ae, e[70] = re, e[71] = o, e[72] = pe) : pe = e[72], pe;
|
|
2020
2039
|
}
|
|
2021
|
-
function
|
|
2040
|
+
function vs(n) {
|
|
2022
2041
|
return n.setUnit;
|
|
2023
2042
|
}
|
|
2024
|
-
function
|
|
2043
|
+
function Ms(n) {
|
|
2025
2044
|
return n.setPositions;
|
|
2026
2045
|
}
|
|
2027
|
-
function
|
|
2046
|
+
function bs(n) {
|
|
2028
2047
|
return n.setModeInstance;
|
|
2029
2048
|
}
|
|
2030
|
-
function
|
|
2049
|
+
function Es(n) {
|
|
2031
2050
|
return n.setLocale;
|
|
2032
2051
|
}
|
|
2033
|
-
function
|
|
2052
|
+
function ws(n) {
|
|
2034
2053
|
return n.setFinished;
|
|
2035
2054
|
}
|
|
2036
|
-
function
|
|
2037
|
-
return n.
|
|
2055
|
+
function Ls(n) {
|
|
2056
|
+
return n.setEnabled;
|
|
2038
2057
|
}
|
|
2039
|
-
function
|
|
2058
|
+
function Ps(n) {
|
|
2040
2059
|
return n.setModeSelected;
|
|
2041
2060
|
}
|
|
2042
|
-
function
|
|
2061
|
+
function _s(n) {
|
|
2043
2062
|
return n.setDistance;
|
|
2044
2063
|
}
|
|
2045
|
-
function
|
|
2046
|
-
const e =
|
|
2064
|
+
function Cs(n) {
|
|
2065
|
+
const e = C(38), {
|
|
2047
2066
|
mapId: t,
|
|
2048
2067
|
textOptions: s,
|
|
2049
2068
|
children: i
|
|
@@ -2056,78 +2075,78 @@ function vs(n) {
|
|
|
2056
2075
|
modes: o,
|
|
2057
2076
|
units: a,
|
|
2058
2077
|
distance: l,
|
|
2059
|
-
setDistance:
|
|
2060
|
-
clearLayerOnStart:
|
|
2078
|
+
setDistance: c,
|
|
2079
|
+
clearLayerOnStart: u,
|
|
2061
2080
|
modeSelected: p,
|
|
2062
|
-
setModeSelected:
|
|
2063
|
-
enabled:
|
|
2064
|
-
|
|
2065
|
-
finished:
|
|
2066
|
-
setFinished:
|
|
2081
|
+
setModeSelected: h,
|
|
2082
|
+
enabled: d,
|
|
2083
|
+
setEnabled: m,
|
|
2084
|
+
finished: f,
|
|
2085
|
+
setFinished: M,
|
|
2067
2086
|
locale: S,
|
|
2068
2087
|
setLocale: v,
|
|
2069
|
-
modeInstance:
|
|
2088
|
+
modeInstance: y,
|
|
2070
2089
|
setModeInstance: b,
|
|
2071
|
-
positions:
|
|
2072
|
-
setPositions:
|
|
2090
|
+
positions: P,
|
|
2091
|
+
setPositions: _,
|
|
2073
2092
|
unit: g,
|
|
2074
|
-
setUnit:
|
|
2075
|
-
clearLayer:
|
|
2076
|
-
toggleLayer:
|
|
2077
|
-
} =
|
|
2078
|
-
let
|
|
2079
|
-
e[2] !== p || e[3] !== o || e[4] !== m || e[5] !== b || e[6] !==
|
|
2093
|
+
setUnit: E,
|
|
2094
|
+
clearLayer: L,
|
|
2095
|
+
toggleLayer: A
|
|
2096
|
+
} = Pt(r);
|
|
2097
|
+
let O, U;
|
|
2098
|
+
e[2] !== p || e[3] !== o || e[4] !== m || e[5] !== b || e[6] !== _ ? (O = () => {
|
|
2080
2099
|
if (p && o[p]) {
|
|
2081
|
-
const
|
|
2082
|
-
b(new
|
|
2100
|
+
const $ = o[p].mode;
|
|
2101
|
+
b(new $()), m(!0);
|
|
2083
2102
|
}
|
|
2084
2103
|
return () => {
|
|
2085
|
-
|
|
2104
|
+
_([]);
|
|
2086
2105
|
};
|
|
2087
|
-
},
|
|
2088
|
-
let
|
|
2089
|
-
e[9] !==
|
|
2090
|
-
|
|
2091
|
-
}, e[9] =
|
|
2092
|
-
const Y =
|
|
2093
|
-
let
|
|
2094
|
-
return e[14] !== i || e[15] !==
|
|
2106
|
+
}, U = [o, p, _, b, m], e[2] = p, e[3] = o, e[4] = m, e[5] = b, e[6] = _, e[7] = O, e[8] = U) : (O = e[7], U = e[8]), ce(O, U);
|
|
2107
|
+
let q;
|
|
2108
|
+
e[9] !== A || e[10] !== L || e[11] !== u || e[12] !== f ? (q = ($) => {
|
|
2109
|
+
$ && (u || !f) && L(), A($);
|
|
2110
|
+
}, e[9] = A, e[10] = L, e[11] = u, e[12] = f, e[13] = q) : q = e[13];
|
|
2111
|
+
const Y = q, V = !!u;
|
|
2112
|
+
let x;
|
|
2113
|
+
return e[14] !== i || e[15] !== L || e[16] !== l || e[17] !== d || e[18] !== f || e[19] !== S || e[20] !== t || e[21] !== y || e[22] !== p || e[23] !== o || e[24] !== P || e[25] !== c || e[26] !== m || e[27] !== M || e[28] !== v || e[29] !== h || e[30] !== _ || e[31] !== E || e[32] !== V || e[33] !== s || e[34] !== Y || e[35] !== g || e[36] !== a ? (x = i({
|
|
2095
2114
|
mapId: t,
|
|
2096
2115
|
distance: l,
|
|
2097
|
-
enabled:
|
|
2098
|
-
finished:
|
|
2116
|
+
enabled: d,
|
|
2117
|
+
finished: f,
|
|
2099
2118
|
locale: S,
|
|
2100
|
-
positions:
|
|
2119
|
+
positions: P,
|
|
2101
2120
|
unit: g,
|
|
2102
2121
|
clearLayerOnStart: V,
|
|
2103
2122
|
modeSelected: p,
|
|
2104
2123
|
modes: o,
|
|
2105
2124
|
units: a,
|
|
2106
|
-
value:
|
|
2125
|
+
value: Oe({
|
|
2107
2126
|
meters: l,
|
|
2108
2127
|
unit: g,
|
|
2109
2128
|
locale: S,
|
|
2110
2129
|
options: s
|
|
2111
2130
|
}),
|
|
2112
|
-
modeInstance:
|
|
2113
|
-
setModeSelected:
|
|
2114
|
-
setDistance:
|
|
2115
|
-
setFinished:
|
|
2131
|
+
modeInstance: y,
|
|
2132
|
+
setModeSelected: h,
|
|
2133
|
+
setDistance: c,
|
|
2134
|
+
setFinished: M,
|
|
2116
2135
|
setLocale: v,
|
|
2117
|
-
setPositions:
|
|
2118
|
-
setUnit:
|
|
2119
|
-
|
|
2136
|
+
setPositions: _,
|
|
2137
|
+
setUnit: E,
|
|
2138
|
+
setEnabled: m,
|
|
2120
2139
|
toggleLayer: Y,
|
|
2121
|
-
clearLayer:
|
|
2122
|
-
}), e[14] = i, e[15] =
|
|
2140
|
+
clearLayer: L
|
|
2141
|
+
}), e[14] = i, e[15] = L, e[16] = l, e[17] = d, e[18] = f, e[19] = S, e[20] = t, e[21] = y, e[22] = p, e[23] = o, e[24] = P, e[25] = c, e[26] = m, e[27] = M, e[28] = v, e[29] = h, e[30] = _, e[31] = E, e[32] = V, e[33] = s, e[34] = Y, e[35] = g, e[36] = a, e[37] = x) : x = e[37], x;
|
|
2123
2142
|
}
|
|
2124
|
-
function
|
|
2143
|
+
function Ts({
|
|
2125
2144
|
children: n,
|
|
2126
2145
|
mapId: e,
|
|
2127
2146
|
defaultProps: {
|
|
2128
|
-
styles: t =
|
|
2147
|
+
styles: t = ot.styles
|
|
2129
2148
|
} = {
|
|
2130
|
-
styles:
|
|
2149
|
+
styles: ot.styles
|
|
2131
2150
|
},
|
|
2132
2151
|
layerProps: s = {},
|
|
2133
2152
|
textOptions: i
|
|
@@ -2137,72 +2156,75 @@ function Ms({
|
|
|
2137
2156
|
clearLayerOnStart: o,
|
|
2138
2157
|
enabled: a,
|
|
2139
2158
|
finished: l,
|
|
2140
|
-
setFinished:
|
|
2141
|
-
locale:
|
|
2159
|
+
setFinished: c,
|
|
2160
|
+
locale: u,
|
|
2142
2161
|
setPositions: p,
|
|
2143
|
-
unit:
|
|
2144
|
-
modeInstance:
|
|
2145
|
-
} =
|
|
2162
|
+
unit: h,
|
|
2163
|
+
modeInstance: d
|
|
2164
|
+
} = Pt({
|
|
2146
2165
|
mapId: e
|
|
2147
|
-
}), m =
|
|
2148
|
-
ce(() => (a &&
|
|
2149
|
-
|
|
2150
|
-
}), [
|
|
2151
|
-
const S =
|
|
2166
|
+
}), m = we((v) => v.setLayer), f = k((v) => v.addLayers), M = k((v) => v.removeLayers);
|
|
2167
|
+
ce(() => (a && f(e, [Ae]), () => {
|
|
2168
|
+
M(e, [Ae]);
|
|
2169
|
+
}), [f, o, e, M, a]);
|
|
2170
|
+
const S = R(({
|
|
2152
2171
|
editType: v,
|
|
2153
|
-
editContext:
|
|
2172
|
+
editContext: y
|
|
2154
2173
|
}) => {
|
|
2155
|
-
if (v ===
|
|
2156
|
-
|
|
2174
|
+
if (v === B.cancel) {
|
|
2175
|
+
d.resetClickSequence();
|
|
2157
2176
|
return;
|
|
2158
2177
|
}
|
|
2159
|
-
v ===
|
|
2160
|
-
const b =
|
|
2178
|
+
v === B.addPosition && r(y.distance), c(!!y.finished);
|
|
2179
|
+
const b = y.positions;
|
|
2161
2180
|
b != null && b.length && p(b);
|
|
2162
|
-
}, [
|
|
2181
|
+
}, [d, r, c, p]);
|
|
2163
2182
|
return ce(() => {
|
|
2164
|
-
const v = l ? t.colors.finished : t.colors.editing,
|
|
2183
|
+
const v = l ? t.colors.finished : t.colors.editing, y = l ? t.colors.finished : t.colors.point, b = hs({
|
|
2165
2184
|
layerProps: {
|
|
2166
2185
|
...s,
|
|
2167
2186
|
pickable: s.pickable ?? !l
|
|
2168
2187
|
},
|
|
2169
2188
|
enabled: a,
|
|
2170
2189
|
guideColor: v,
|
|
2171
|
-
pointColor:
|
|
2172
|
-
locale:
|
|
2190
|
+
pointColor: y,
|
|
2191
|
+
locale: u,
|
|
2173
2192
|
onEdit: S,
|
|
2174
|
-
unit:
|
|
2175
|
-
mode:
|
|
2193
|
+
unit: h,
|
|
2194
|
+
mode: d,
|
|
2176
2195
|
textOptions: i
|
|
2177
2196
|
});
|
|
2178
|
-
m(
|
|
2179
|
-
}, [l,
|
|
2197
|
+
m(Ae, b);
|
|
2198
|
+
}, [l, d, s, u, S, m, t.colors.editing, t.colors.finished, t.colors.point, i, h, a]), n;
|
|
2180
2199
|
}
|
|
2181
|
-
|
|
2182
|
-
function
|
|
2183
|
-
const e =
|
|
2200
|
+
Ts.Controls = Cs;
|
|
2201
|
+
function ks(n) {
|
|
2202
|
+
const e = C(7), {
|
|
2184
2203
|
id: t
|
|
2185
2204
|
} = n;
|
|
2186
2205
|
let s;
|
|
2187
|
-
e[0] !== t ? (s = (
|
|
2206
|
+
e[0] !== t ? (s = (c) => c.maps[t], e[0] = t, e[1] = s) : s = e[1];
|
|
2188
2207
|
const {
|
|
2189
2208
|
layers: i
|
|
2190
|
-
} = k(s), r =
|
|
2209
|
+
} = k(s), r = we(As);
|
|
2191
2210
|
let o, a;
|
|
2192
2211
|
if (e[2] !== r || e[3] !== i) {
|
|
2193
|
-
let
|
|
2194
|
-
e[5] !== r ? (
|
|
2212
|
+
let c;
|
|
2213
|
+
e[5] !== r ? (c = (u) => r[u], e[5] = r, e[6] = c) : c = e[6], a = i.map(c).filter(Fs), e[2] = r, e[3] = i, e[4] = a;
|
|
2195
2214
|
} else
|
|
2196
2215
|
a = e[4];
|
|
2197
2216
|
return o = a, o;
|
|
2198
2217
|
}
|
|
2199
|
-
function
|
|
2218
|
+
function Fs(n) {
|
|
2200
2219
|
return !!n;
|
|
2201
2220
|
}
|
|
2202
|
-
function
|
|
2221
|
+
function As(n) {
|
|
2203
2222
|
return n.layers;
|
|
2204
2223
|
}
|
|
2205
|
-
function
|
|
2224
|
+
function _t(n) {
|
|
2225
|
+
return n.sort((e, t) => (e.order ?? 1 / 0) - (t.order ?? 1 / 0));
|
|
2226
|
+
}
|
|
2227
|
+
function vi({
|
|
2206
2228
|
id: n,
|
|
2207
2229
|
onLoad: e,
|
|
2208
2230
|
onViewStateChange: t,
|
|
@@ -2212,25 +2234,27 @@ function Qs({
|
|
|
2212
2234
|
basemap: i,
|
|
2213
2235
|
instanceRef: r,
|
|
2214
2236
|
overlayRef: o
|
|
2215
|
-
} = k((
|
|
2237
|
+
} = k((y) => y.maps[n]), a = k((y) => y.viewStates[n]), l = k((y) => y.setViewState), c = k((y) => y.setLoad), u = k((y) => y.setLayersLoad), p = k((y) => y.updateViewPort), h = ks({
|
|
2216
2238
|
id: n
|
|
2217
|
-
}),
|
|
2218
|
-
const
|
|
2239
|
+
}), d = ue(() => _t(h), [h]), m = R((y) => {
|
|
2240
|
+
const b = l;
|
|
2219
2241
|
if (t) {
|
|
2220
|
-
t(
|
|
2242
|
+
t(y, b);
|
|
2221
2243
|
return;
|
|
2222
2244
|
}
|
|
2223
|
-
|
|
2224
|
-
}, [n, t, l]),
|
|
2225
|
-
|
|
2226
|
-
}, [n, e,
|
|
2227
|
-
var
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2230
|
-
}, [n, r, s,
|
|
2231
|
-
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2245
|
+
b(n, y.viewState);
|
|
2246
|
+
}, [n, t, l]), f = R((y) => {
|
|
2247
|
+
c(n, y), e == null || e(y);
|
|
2248
|
+
}, [n, e, c]), M = R((y) => {
|
|
2249
|
+
var _, g, E;
|
|
2250
|
+
const b = (g = (_ = r == null ? void 0 : r.current) == null ? void 0 : _.deck) == null ? void 0 : g.props.layers, P = !!(b != null && b.every((L) => L == null ? void 0 : L.isLoaded));
|
|
2251
|
+
u(n, P), (E = s.onAfterRender) == null || E.call(s, y);
|
|
2252
|
+
}, [n, r, s, u]), S = s.onDragEnd, v = R((...y) => {
|
|
2253
|
+
p(n), S && S(...y);
|
|
2254
|
+
}, [n, p, S]);
|
|
2255
|
+
return /* @__PURE__ */ Z(fn, { ...s, layers: d, instanceRef: r, overlayRef: o, basemap: i, initialViewState: a, onLoad: f, onViewStateChange: m, onAfterRender: M, onDragEnd: v });
|
|
2256
|
+
}
|
|
2257
|
+
const Os = "https://gcp-us-east1.api.carto.com", Rs = "ps", Ds = ft((n) => ({
|
|
2234
2258
|
sources: {},
|
|
2235
2259
|
setSource: (e, t) => n((s) => {
|
|
2236
2260
|
const i = {
|
|
@@ -2240,127 +2264,455 @@ const ws = "https://gcp-us-east1.api.carto.com", _s = "ps", ei = ct((n) => ({
|
|
|
2240
2264
|
return delete i[e], {
|
|
2241
2265
|
sources: i
|
|
2242
2266
|
};
|
|
2243
|
-
const {
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
clientId: o
|
|
2267
|
+
const r = {
|
|
2268
|
+
...i[e] ?? {
|
|
2269
|
+
apiBaseUrl: Os,
|
|
2270
|
+
clientId: Rs
|
|
2271
|
+
},
|
|
2272
|
+
...t
|
|
2250
2273
|
};
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
...
|
|
2254
|
-
|
|
2274
|
+
let o;
|
|
2275
|
+
return r.type === "query" && (o = new rn({
|
|
2276
|
+
...r,
|
|
2277
|
+
accessToken: "",
|
|
2278
|
+
sqlQuery: r.data
|
|
2279
|
+
})), r.type === "table" && (o = new on({
|
|
2280
|
+
...r,
|
|
2281
|
+
accessToken: "",
|
|
2282
|
+
tableName: r.data
|
|
2283
|
+
})), r.type === "tileset" && (o = new an({
|
|
2284
|
+
...r,
|
|
2285
|
+
accessToken: "",
|
|
2286
|
+
tableName: r.data,
|
|
2287
|
+
tileFormat: r.tileFormat ?? ln.BINARY,
|
|
2288
|
+
spatialDataType: r.spatialDataType ?? "geo"
|
|
2289
|
+
})), r.widgets = o, i[e] = r, {
|
|
2255
2290
|
sources: i
|
|
2256
2291
|
};
|
|
2257
2292
|
})
|
|
2258
2293
|
}));
|
|
2259
|
-
function
|
|
2294
|
+
function xs(n) {
|
|
2295
|
+
const e = C(2);
|
|
2296
|
+
let t;
|
|
2297
|
+
return e[0] !== n ? (t = (s) => s.sources[n], e[0] = n, e[1] = t) : t = e[1], Ds(t);
|
|
2298
|
+
}
|
|
2299
|
+
function fe(n, e) {
|
|
2300
|
+
const t = xs(e);
|
|
2301
|
+
return ue(() => {
|
|
2302
|
+
const s = t == null ? void 0 : t.widgets;
|
|
2303
|
+
return !s || !n ? null : (s.props.accessToken = n, s);
|
|
2304
|
+
}, [n, t]);
|
|
2305
|
+
}
|
|
2306
|
+
function Us(n) {
|
|
2307
|
+
const e = C(12), {
|
|
2308
|
+
accessToken: t,
|
|
2309
|
+
sourceId: s,
|
|
2310
|
+
widgetProps: i,
|
|
2311
|
+
useQueryProps: r
|
|
2312
|
+
} = n, o = fe(t, s);
|
|
2313
|
+
let a;
|
|
2314
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["categories", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2315
|
+
let l;
|
|
2316
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getCategories(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2317
|
+
const c = !!o;
|
|
2318
|
+
let u;
|
|
2319
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2320
|
+
queryKey: a,
|
|
2321
|
+
queryFn: l,
|
|
2322
|
+
enabled: c,
|
|
2323
|
+
...r
|
|
2324
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2325
|
+
}
|
|
2326
|
+
function Mi(n) {
|
|
2327
|
+
const e = C(6);
|
|
2328
|
+
let t, s;
|
|
2329
|
+
e[0] !== n ? ({
|
|
2330
|
+
children: t,
|
|
2331
|
+
...s
|
|
2332
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2333
|
+
const i = Us(s);
|
|
2334
|
+
let r;
|
|
2335
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2336
|
+
}
|
|
2337
|
+
function qs(n) {
|
|
2338
|
+
const e = C(12), {
|
|
2339
|
+
accessToken: t,
|
|
2340
|
+
sourceId: s,
|
|
2341
|
+
widgetProps: i,
|
|
2342
|
+
useQueryProps: r
|
|
2343
|
+
} = n, o = fe(t, s);
|
|
2344
|
+
let a;
|
|
2345
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["features", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2346
|
+
let l;
|
|
2347
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getFeatures(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2348
|
+
const c = !!o;
|
|
2349
|
+
let u;
|
|
2350
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2351
|
+
queryKey: a,
|
|
2352
|
+
queryFn: l,
|
|
2353
|
+
enabled: c,
|
|
2354
|
+
...r
|
|
2355
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2356
|
+
}
|
|
2357
|
+
function bi(n) {
|
|
2358
|
+
const e = C(6);
|
|
2359
|
+
let t, s;
|
|
2360
|
+
e[0] !== n ? ({
|
|
2361
|
+
children: t,
|
|
2362
|
+
...s
|
|
2363
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2364
|
+
const i = qs(s);
|
|
2365
|
+
let r;
|
|
2366
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2367
|
+
}
|
|
2368
|
+
function $s(n) {
|
|
2369
|
+
const e = C(12), {
|
|
2370
|
+
accessToken: t,
|
|
2371
|
+
sourceId: s,
|
|
2372
|
+
widgetProps: i,
|
|
2373
|
+
useQueryProps: r
|
|
2374
|
+
} = n, o = fe(t, s);
|
|
2375
|
+
let a;
|
|
2376
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["formula", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2377
|
+
let l;
|
|
2378
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getFormula(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2379
|
+
const c = !!o;
|
|
2380
|
+
let u;
|
|
2381
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2382
|
+
queryKey: a,
|
|
2383
|
+
queryFn: l,
|
|
2384
|
+
enabled: c,
|
|
2385
|
+
...r
|
|
2386
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2387
|
+
}
|
|
2388
|
+
function Ei(n) {
|
|
2389
|
+
const e = C(6);
|
|
2390
|
+
let t, s;
|
|
2391
|
+
e[0] !== n ? ({
|
|
2392
|
+
children: t,
|
|
2393
|
+
...s
|
|
2394
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2395
|
+
const i = $s(s);
|
|
2396
|
+
let r;
|
|
2397
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2398
|
+
}
|
|
2399
|
+
function Vs(n) {
|
|
2400
|
+
const e = C(12), {
|
|
2401
|
+
accessToken: t,
|
|
2402
|
+
sourceId: s,
|
|
2403
|
+
widgetProps: i,
|
|
2404
|
+
useQueryProps: r
|
|
2405
|
+
} = n, o = fe(t, s);
|
|
2406
|
+
let a;
|
|
2407
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["histogram", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2408
|
+
let l;
|
|
2409
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getHistogram(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2410
|
+
const c = !!o;
|
|
2411
|
+
let u;
|
|
2412
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2413
|
+
queryKey: a,
|
|
2414
|
+
queryFn: l,
|
|
2415
|
+
enabled: c,
|
|
2416
|
+
...r
|
|
2417
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2418
|
+
}
|
|
2419
|
+
function wi(n) {
|
|
2420
|
+
const e = C(6);
|
|
2421
|
+
let t, s;
|
|
2422
|
+
e[0] !== n ? ({
|
|
2423
|
+
children: t,
|
|
2424
|
+
...s
|
|
2425
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2426
|
+
const i = Vs(s);
|
|
2427
|
+
let r;
|
|
2428
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2429
|
+
}
|
|
2430
|
+
function Ns(n) {
|
|
2431
|
+
const e = C(12), {
|
|
2432
|
+
accessToken: t,
|
|
2433
|
+
sourceId: s,
|
|
2434
|
+
widgetProps: i,
|
|
2435
|
+
useQueryProps: r
|
|
2436
|
+
} = n, o = fe(t, s);
|
|
2437
|
+
let a;
|
|
2438
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["range", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2439
|
+
let l;
|
|
2440
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getRange(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2441
|
+
const c = !!o;
|
|
2442
|
+
let u;
|
|
2443
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2444
|
+
queryKey: a,
|
|
2445
|
+
queryFn: l,
|
|
2446
|
+
enabled: c,
|
|
2447
|
+
...r
|
|
2448
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2449
|
+
}
|
|
2450
|
+
function Li(n) {
|
|
2451
|
+
const e = C(6);
|
|
2452
|
+
let t, s;
|
|
2453
|
+
e[0] !== n ? ({
|
|
2454
|
+
children: t,
|
|
2455
|
+
...s
|
|
2456
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2457
|
+
const i = Ns(s);
|
|
2458
|
+
let r;
|
|
2459
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2460
|
+
}
|
|
2461
|
+
function Is(n) {
|
|
2462
|
+
const e = C(12), {
|
|
2463
|
+
accessToken: t,
|
|
2464
|
+
sourceId: s,
|
|
2465
|
+
widgetProps: i,
|
|
2466
|
+
useQueryProps: r
|
|
2467
|
+
} = n, o = fe(t, s);
|
|
2468
|
+
let a;
|
|
2469
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["scatter", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2470
|
+
let l;
|
|
2471
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getScatter(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2472
|
+
const c = !!o;
|
|
2473
|
+
let u;
|
|
2474
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2475
|
+
queryKey: a,
|
|
2476
|
+
queryFn: l,
|
|
2477
|
+
enabled: c,
|
|
2478
|
+
...r
|
|
2479
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2480
|
+
}
|
|
2481
|
+
function Pi(n) {
|
|
2482
|
+
const e = C(6);
|
|
2483
|
+
let t, s;
|
|
2484
|
+
e[0] !== n ? ({
|
|
2485
|
+
children: t,
|
|
2486
|
+
...s
|
|
2487
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2488
|
+
const i = Is(s);
|
|
2489
|
+
let r;
|
|
2490
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2491
|
+
}
|
|
2492
|
+
function Bs(n) {
|
|
2493
|
+
const e = C(12), {
|
|
2494
|
+
accessToken: t,
|
|
2495
|
+
sourceId: s,
|
|
2496
|
+
widgetProps: i,
|
|
2497
|
+
useQueryProps: r
|
|
2498
|
+
} = n, o = fe(t, s);
|
|
2499
|
+
let a;
|
|
2500
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["table", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2501
|
+
let l;
|
|
2502
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getTable(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2503
|
+
const c = !!o;
|
|
2504
|
+
let u;
|
|
2505
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2506
|
+
queryKey: a,
|
|
2507
|
+
queryFn: l,
|
|
2508
|
+
enabled: c,
|
|
2509
|
+
...r
|
|
2510
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2511
|
+
}
|
|
2512
|
+
function _i(n) {
|
|
2513
|
+
const e = C(6);
|
|
2514
|
+
let t, s;
|
|
2515
|
+
e[0] !== n ? ({
|
|
2516
|
+
children: t,
|
|
2517
|
+
...s
|
|
2518
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2519
|
+
const i = Bs(s);
|
|
2520
|
+
let r;
|
|
2521
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2522
|
+
}
|
|
2523
|
+
function Gs(n) {
|
|
2524
|
+
const e = C(12), {
|
|
2525
|
+
accessToken: t,
|
|
2526
|
+
sourceId: s,
|
|
2527
|
+
widgetProps: i,
|
|
2528
|
+
useQueryProps: r
|
|
2529
|
+
} = n, o = fe(t, s);
|
|
2530
|
+
let a;
|
|
2531
|
+
e[0] !== t || e[1] !== s || e[2] !== i ? (a = ["time-series", s, t, i], e[0] = t, e[1] = s, e[2] = i, e[3] = a) : a = e[3];
|
|
2532
|
+
let l;
|
|
2533
|
+
e[4] !== o || e[5] !== i ? (l = () => o == null ? void 0 : o.getTimeSeries(i), e[4] = o, e[5] = i, e[6] = l) : l = e[6];
|
|
2534
|
+
const c = !!o;
|
|
2535
|
+
let u;
|
|
2536
|
+
return e[7] !== a || e[8] !== l || e[9] !== c || e[10] !== r ? (u = {
|
|
2537
|
+
queryKey: a,
|
|
2538
|
+
queryFn: l,
|
|
2539
|
+
enabled: c,
|
|
2540
|
+
...r
|
|
2541
|
+
}, e[7] = a, e[8] = l, e[9] = c, e[10] = r, e[11] = u) : u = e[11], de(u);
|
|
2542
|
+
}
|
|
2543
|
+
function Ci(n) {
|
|
2544
|
+
const e = C(6);
|
|
2545
|
+
let t, s;
|
|
2546
|
+
e[0] !== n ? ({
|
|
2547
|
+
children: t,
|
|
2548
|
+
...s
|
|
2549
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
2550
|
+
const i = Gs(s);
|
|
2551
|
+
let r;
|
|
2552
|
+
return e[3] !== t || e[4] !== i ? (r = t(i), e[3] = t, e[4] = i, e[5] = r) : r = e[5], r;
|
|
2553
|
+
}
|
|
2554
|
+
function Ti(n, e) {
|
|
2555
|
+
const t = we((c) => c.layers), s = we((c) => c.setLayer), i = ue(() => _t(n.map((c) => t[c]).filter((c) => !!c)), [t, n]), r = ue(() => i.map(e), [e, i]), o = R(({
|
|
2556
|
+
id: c,
|
|
2557
|
+
visible: u,
|
|
2558
|
+
...p
|
|
2559
|
+
}) => {
|
|
2560
|
+
s(c, {
|
|
2561
|
+
props: {
|
|
2562
|
+
visible: u
|
|
2563
|
+
},
|
|
2564
|
+
legend: p
|
|
2565
|
+
});
|
|
2566
|
+
}, [s]), a = R(({
|
|
2567
|
+
id: c,
|
|
2568
|
+
collapsed: u
|
|
2569
|
+
}) => {
|
|
2570
|
+
s(c, {
|
|
2571
|
+
legend: {
|
|
2572
|
+
collapsed: u
|
|
2573
|
+
}
|
|
2574
|
+
});
|
|
2575
|
+
}, [s]), l = R(({
|
|
2576
|
+
id: c,
|
|
2577
|
+
opacity: u
|
|
2578
|
+
}) => {
|
|
2579
|
+
s(c, {
|
|
2580
|
+
props: {
|
|
2581
|
+
opacity: u
|
|
2582
|
+
}
|
|
2583
|
+
});
|
|
2584
|
+
}, [s]);
|
|
2585
|
+
return {
|
|
2586
|
+
legend: r,
|
|
2587
|
+
onChangeVisibility: o,
|
|
2588
|
+
onChangeOpacity: l,
|
|
2589
|
+
onChangRowCollapsed: a
|
|
2590
|
+
};
|
|
2591
|
+
}
|
|
2592
|
+
function ki({
|
|
2260
2593
|
mapId: n
|
|
2261
2594
|
}) {
|
|
2262
|
-
const [e, t] =
|
|
2263
|
-
var
|
|
2264
|
-
return (
|
|
2265
|
-
}), o = k((
|
|
2266
|
-
var
|
|
2267
|
-
return (
|
|
2268
|
-
}),
|
|
2269
|
-
var
|
|
2270
|
-
return (
|
|
2595
|
+
const [e, t] = ge(void 0), [s, i] = ge(!1), r = k((f) => {
|
|
2596
|
+
var M;
|
|
2597
|
+
return (M = f.maps[n]) == null ? void 0 : M.basemap;
|
|
2598
|
+
}), o = k((f) => f.getDeckInstance), a = k((f) => f.getOverlayInstance), l = k((f) => {
|
|
2599
|
+
var M;
|
|
2600
|
+
return (M = f.maps[n]) == null ? void 0 : M.areLayersLoaded;
|
|
2601
|
+
}), u = k((f) => {
|
|
2602
|
+
var M;
|
|
2603
|
+
return (M = f.maps[n]) == null ? void 0 : M.isLoaded;
|
|
2271
2604
|
}) && l, {
|
|
2272
2605
|
type: p
|
|
2273
|
-
} =
|
|
2606
|
+
} = pt[r], h = p === le.googleMaps, d = R(async () => {
|
|
2607
|
+
const f = o(n), M = a(n);
|
|
2274
2608
|
try {
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
const
|
|
2278
|
-
if (
|
|
2279
|
-
const
|
|
2280
|
-
if (
|
|
2609
|
+
const S = document.createElement("canvas");
|
|
2610
|
+
S.width = f.width ?? 0, S.height = f.height ?? 0;
|
|
2611
|
+
const v = S.getContext("2d");
|
|
2612
|
+
if (h) {
|
|
2613
|
+
const b = M;
|
|
2614
|
+
if (b.getRenderingType() !== "RASTER")
|
|
2281
2615
|
throw new Error("Only raster type is supported for Google Maps");
|
|
2282
|
-
const
|
|
2616
|
+
const P = await cn(b.getDiv(), {
|
|
2283
2617
|
useCORS: !0
|
|
2284
2618
|
});
|
|
2285
|
-
|
|
2619
|
+
v == null || v.drawImage(P, 0, 0, f.width, f.height);
|
|
2286
2620
|
} else {
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2621
|
+
const b = M;
|
|
2622
|
+
b.redraw(), v == null || v.drawImage(b.getMap().getCanvas(), 0, 0, f.width, f.height);
|
|
2289
2623
|
}
|
|
2290
|
-
|
|
2291
|
-
const
|
|
2292
|
-
t(
|
|
2293
|
-
} catch (
|
|
2294
|
-
console.error(
|
|
2624
|
+
f == null || f.redraw("screenshot"), v == null || v.drawImage(f.getCanvas(), 0, 0, f.width, f.height);
|
|
2625
|
+
const y = S.toDataURL();
|
|
2626
|
+
t(y);
|
|
2627
|
+
} catch (S) {
|
|
2628
|
+
console.error(S);
|
|
2295
2629
|
} finally {
|
|
2296
2630
|
i(!1);
|
|
2297
2631
|
}
|
|
2298
|
-
}, [o,
|
|
2632
|
+
}, [o, h, n, a]);
|
|
2299
2633
|
return {
|
|
2300
|
-
takeScreenshot:
|
|
2301
|
-
i(!0),
|
|
2302
|
-
}, [
|
|
2634
|
+
takeScreenshot: R(() => {
|
|
2635
|
+
i(!0), u && d();
|
|
2636
|
+
}, [d, u]),
|
|
2303
2637
|
isLoading: s,
|
|
2304
2638
|
screenshot: e
|
|
2305
2639
|
};
|
|
2306
2640
|
}
|
|
2307
|
-
const
|
|
2641
|
+
const he = {
|
|
2308
2642
|
currency: "CURRENCY",
|
|
2309
2643
|
default: "DEFAULT",
|
|
2310
2644
|
number: "NUMBER"
|
|
2311
|
-
},
|
|
2312
|
-
[
|
|
2313
|
-
type:
|
|
2314
|
-
format: (n, e) =>
|
|
2645
|
+
}, ct = {
|
|
2646
|
+
[he.currency]: {
|
|
2647
|
+
type: he.currency,
|
|
2648
|
+
format: (n, e) => tn(n, e)
|
|
2315
2649
|
},
|
|
2316
|
-
[
|
|
2317
|
-
type:
|
|
2318
|
-
format: (n, e) =>
|
|
2650
|
+
[he.number]: {
|
|
2651
|
+
type: he.number,
|
|
2652
|
+
format: (n, e) => mt(n, e)
|
|
2319
2653
|
},
|
|
2320
|
-
[
|
|
2321
|
-
type:
|
|
2654
|
+
[he.default]: {
|
|
2655
|
+
type: he.default,
|
|
2322
2656
|
format: (n) => n.toLocaleString()
|
|
2323
2657
|
}
|
|
2324
2658
|
};
|
|
2325
|
-
function
|
|
2659
|
+
function Fi({
|
|
2326
2660
|
properties: n,
|
|
2327
2661
|
formatters: e = {},
|
|
2328
2662
|
includeColumns: t = Object.keys(n),
|
|
2329
2663
|
locale: s = "en-US",
|
|
2330
2664
|
showColumnName: i = !0,
|
|
2331
2665
|
title: r,
|
|
2332
|
-
getColumnName: o =
|
|
2333
|
-
getFieldHtml: a =
|
|
2334
|
-
getTitle: l =
|
|
2335
|
-
getValue:
|
|
2666
|
+
getColumnName: o = zs,
|
|
2667
|
+
getFieldHtml: a = Ks,
|
|
2668
|
+
getTitle: l = Hs,
|
|
2669
|
+
getValue: c = Ws
|
|
2336
2670
|
}) {
|
|
2337
|
-
const
|
|
2338
|
-
const
|
|
2339
|
-
return
|
|
2671
|
+
const u = r ? l(r) : "", h = t.reduce((d, m) => {
|
|
2672
|
+
const f = e[m], M = n[m], S = c(M, s, f), v = i ? o(m) : "";
|
|
2673
|
+
return d + a(v, S);
|
|
2340
2674
|
}, "");
|
|
2341
|
-
return
|
|
2675
|
+
return u + h;
|
|
2342
2676
|
}
|
|
2343
|
-
function
|
|
2677
|
+
function Hs(n) {
|
|
2344
2678
|
return `<h3 style="margin: 0"><strong>${n}</strong></h3></br>`;
|
|
2345
2679
|
}
|
|
2346
|
-
function
|
|
2680
|
+
function Ks(n, e) {
|
|
2347
2681
|
return `${n}${e}</br>`;
|
|
2348
2682
|
}
|
|
2349
|
-
function
|
|
2683
|
+
function Ws(n, e, t) {
|
|
2350
2684
|
try {
|
|
2351
|
-
return
|
|
2685
|
+
return js(t)(n, e);
|
|
2352
2686
|
} catch {
|
|
2353
2687
|
return n;
|
|
2354
2688
|
}
|
|
2355
2689
|
}
|
|
2356
|
-
function
|
|
2357
|
-
return typeof n == "function" ? n : ((n &&
|
|
2690
|
+
function js(n) {
|
|
2691
|
+
return typeof n == "function" ? n : ((n && ct[n]) ?? ct[he.default]).format;
|
|
2358
2692
|
}
|
|
2359
|
-
function
|
|
2693
|
+
function zs(n) {
|
|
2360
2694
|
return `<strong>${n}</strong>: `;
|
|
2361
2695
|
}
|
|
2362
|
-
function
|
|
2363
|
-
|
|
2696
|
+
function Ai(n) {
|
|
2697
|
+
var t, s, i, r, o, a, l, c;
|
|
2698
|
+
const e = n.props;
|
|
2699
|
+
return {
|
|
2700
|
+
collapsed: (t = n.legend) == null ? void 0 : t.collapsed,
|
|
2701
|
+
collapsible: (s = n.legend) == null ? void 0 : s.collapsible,
|
|
2702
|
+
helperText: (i = n.legend) == null ? void 0 : i.helperText,
|
|
2703
|
+
id: e.id,
|
|
2704
|
+
legend: (r = n.legend) == null ? void 0 : r.variables,
|
|
2705
|
+
maxZoom: (o = n.legend) == null ? void 0 : o.maxZoom,
|
|
2706
|
+
minZoom: (a = n.legend) == null ? void 0 : a.minZoom,
|
|
2707
|
+
opacity: (e == null ? void 0 : e.opacity) ?? 1,
|
|
2708
|
+
opacityControl: (l = n.legend) == null ? void 0 : l.opacityControl,
|
|
2709
|
+
switchable: (c = n.legend) == null ? void 0 : c.switchable,
|
|
2710
|
+
title: n.name,
|
|
2711
|
+
visible: (e == null ? void 0 : e.visible) ?? !0
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
function Oi(n) {
|
|
2715
|
+
const e = C(18), {
|
|
2364
2716
|
children: t,
|
|
2365
2717
|
id: s
|
|
2366
2718
|
} = n;
|
|
@@ -2373,87 +2725,107 @@ function si(n) {
|
|
|
2373
2725
|
} = k(i);
|
|
2374
2726
|
let l;
|
|
2375
2727
|
e[2] !== s ? (l = (v) => v.maps[s].areLayersLoaded, e[2] = s, e[3] = l) : l = e[3];
|
|
2376
|
-
const
|
|
2377
|
-
let
|
|
2378
|
-
e[4] !== s || e[5] !==
|
|
2379
|
-
const m =
|
|
2380
|
-
let
|
|
2381
|
-
e[7] !== p || e[8] !== s ? (
|
|
2382
|
-
const
|
|
2728
|
+
const c = k(l), u = k(Qs), p = k(Zs), h = !c;
|
|
2729
|
+
let d;
|
|
2730
|
+
e[4] !== s || e[5] !== u ? (d = (v) => u(s, v), e[4] = s, e[5] = u, e[6] = d) : d = e[6];
|
|
2731
|
+
const m = d;
|
|
2732
|
+
let f;
|
|
2733
|
+
e[7] !== p || e[8] !== s ? (f = (v) => p(s, v), e[7] = p, e[8] = s, e[9] = f) : f = e[9];
|
|
2734
|
+
const M = f;
|
|
2383
2735
|
let S;
|
|
2384
|
-
return e[10] !== t || e[11] !== o || e[12] !== a || e[13] !==
|
|
2736
|
+
return e[10] !== t || e[11] !== o || e[12] !== a || e[13] !== h || e[14] !== m || e[15] !== M || e[16] !== r ? (S = t({
|
|
2385
2737
|
zoom: r,
|
|
2386
2738
|
maxZoom: o,
|
|
2387
2739
|
minZoom: a,
|
|
2388
|
-
isLoading:
|
|
2740
|
+
isLoading: h,
|
|
2389
2741
|
setZoom: m,
|
|
2390
|
-
flyTo:
|
|
2391
|
-
}), e[10] = t, e[11] = o, e[12] = a, e[13] =
|
|
2742
|
+
flyTo: M
|
|
2743
|
+
}), e[10] = t, e[11] = o, e[12] = a, e[13] = h, e[14] = m, e[15] = M, e[16] = r, e[17] = S) : S = e[17], S;
|
|
2392
2744
|
}
|
|
2393
|
-
function
|
|
2745
|
+
function Zs(n) {
|
|
2394
2746
|
return n.flyTo;
|
|
2395
2747
|
}
|
|
2396
|
-
function
|
|
2748
|
+
function Qs(n) {
|
|
2397
2749
|
return n.setZoom;
|
|
2398
2750
|
}
|
|
2399
2751
|
export {
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2752
|
+
Os as ApiBaseUrl,
|
|
2753
|
+
at as CONVERSIONS_UNITS,
|
|
2754
|
+
xe as CartoBasemapURL,
|
|
2755
|
+
Q as CartoBasemaps,
|
|
2756
|
+
Mi as CategoriesModel,
|
|
2757
|
+
vn as CustomCompositeEditMode,
|
|
2758
|
+
cs as CustomMeasureAreaMode,
|
|
2759
|
+
us as CustomMeasureBufferMode,
|
|
2760
|
+
wt as CustomMeasureDistanceMode,
|
|
2408
2761
|
je as DEFAULT_LASSO_TOOLS_COLORS,
|
|
2409
|
-
|
|
2762
|
+
bn as DEFAULT_LASSO_TOOLS_LAYER_PROPS,
|
|
2410
2763
|
ze as DEFAULT_LASSO_TOOLS_MODES,
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2764
|
+
Ue as DEFAULT_LASSO_TOOLS_PROPS,
|
|
2765
|
+
Pe as DEFAULT_MASK_LAYER_PROPS,
|
|
2766
|
+
ps as DEFAULT_MEASUREMENT_TOOLS_MODES,
|
|
2767
|
+
ys as DEFAULT_MEASUREMENT_TOOLS_UNITS,
|
|
2768
|
+
$e as DEFAULT_MEASURE_COLORS,
|
|
2769
|
+
fn as DeckGLComponent,
|
|
2770
|
+
B as EditableEditType,
|
|
2771
|
+
bi as FeaturesModel,
|
|
2772
|
+
Ei as FormulaModel,
|
|
2773
|
+
De as GmapsBasemap,
|
|
2774
|
+
wi as HistogramModel,
|
|
2775
|
+
Ee as INTL_UNITS,
|
|
2776
|
+
jn as LassoTools,
|
|
2777
|
+
hi as LassoToolsProvider,
|
|
2778
|
+
pt as MAPS_BASEMAP,
|
|
2779
|
+
Fe as MAP_LASSO_TOOLS_LAYER_ID,
|
|
2780
|
+
Mn as MAP_MASK_LAYER_ID,
|
|
2781
|
+
Ae as MAP_MEASURE_LAYER_ID,
|
|
2782
|
+
ms as MEASUREMENT_TOOLS_UNITS_AREA,
|
|
2783
|
+
lt as MEASUREMENT_TOOLS_UNITS_DISTANCE,
|
|
2784
|
+
I as MEASUREMENT_TOOLS_UNITS_DISTANCE_VALUES,
|
|
2785
|
+
vi as MapComponent,
|
|
2786
|
+
Ne as MapMeasurementUnitAuto,
|
|
2787
|
+
fs as MapMeasurementUnitTurf,
|
|
2788
|
+
yi as MapProvider,
|
|
2433
2789
|
le as MapsTypes,
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2790
|
+
Ts as MeasurementTools,
|
|
2791
|
+
Si as MeasurementToolsProvider,
|
|
2792
|
+
Li as RangeModel,
|
|
2793
|
+
Pi as ScatterModel,
|
|
2794
|
+
_i as TableModel,
|
|
2795
|
+
Ci as TimeSeriesModel,
|
|
2796
|
+
Oi as ZoomControls,
|
|
2797
|
+
Rs as clientID,
|
|
2798
|
+
it as convertMetersTo,
|
|
2799
|
+
Hn as createLassoToolsStore,
|
|
2800
|
+
_n as createMapStore,
|
|
2801
|
+
Ss as createMeasurementToolsStore,
|
|
2802
|
+
he as formatterTypes,
|
|
2803
|
+
un as getCursorDefault,
|
|
2804
|
+
gi as getDeckController,
|
|
2805
|
+
Bn as getLassoToolsLayer,
|
|
2806
|
+
hs as getMeasurementToolsLayer,
|
|
2807
|
+
Oe as getTextLayerFormattedDistance,
|
|
2808
|
+
dn as getTooltipDefault,
|
|
2809
|
+
Ai as mappingLegendMeridian,
|
|
2810
|
+
Fi as objectToHtml,
|
|
2811
|
+
_t as sortLayers,
|
|
2812
|
+
En as transitionFlyConfig,
|
|
2813
|
+
Us as useCategories,
|
|
2814
|
+
qs as useFeatures,
|
|
2815
|
+
$s as useFormula,
|
|
2816
|
+
Vs as useHistogram,
|
|
2817
|
+
D as useLassoToolsState,
|
|
2818
|
+
we as useLayerStore,
|
|
2819
|
+
ks as useLayers,
|
|
2820
|
+
Ti as useLegend,
|
|
2821
|
+
ki as useMapScreenshot,
|
|
2822
|
+
k as useMapStore,
|
|
2823
|
+
F as useMeasurementToolsState,
|
|
2824
|
+
Ns as useRange,
|
|
2825
|
+
Is as useScatter,
|
|
2826
|
+
Ds as useSourceStore,
|
|
2827
|
+
Bs as useTable,
|
|
2828
|
+
Gs as useTimeSeries,
|
|
2829
|
+
fe as useWidgetModel
|
|
2458
2830
|
};
|
|
2459
2831
|
//# sourceMappingURL=index.js.map
|