@carto/ps-react-maps 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +94 -91
- package/dist/index.js.map +1 -1
- package/dist/types/common/common.d.ts +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/lasso-tools.d.ts +11 -8
- package/dist/types/common/measurement-tools.d.ts +1 -2
- package/dist/types/editable/lasso-tools/const.d.ts +2 -1
- package/dist/types/editable/lasso-tools/provider/types.d.ts +1 -1
- package/dist/types/editable/lasso-tools/types.d.ts +3 -4
- package/dist/types/editable/measurement-tools/types.d.ts +2 -4
- package/dist/types/utils/mapping-meridian.d.ts +1 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,17 +3,17 @@ var yt = (o, e, t) => e in o ? gt(o, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var ne = (o, e, t) => yt(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { jsx as H, jsxs as ht } from "react/jsx-runtime";
|
|
5
5
|
import { c as k } from "react/compiler-runtime";
|
|
6
|
-
import { useState as fe, useEffect as Y, useImperativeHandle as St, createContext as
|
|
6
|
+
import { useState as fe, useEffect as Y, useImperativeHandle as St, createContext as Ue, useContext as $e, useMemo as de, useCallback as $, useRef as Ee } from "react";
|
|
7
7
|
import { DeckGL as vt } from "@deck.gl/react";
|
|
8
8
|
import { Map as bt, MapProvider as Tt, useMap as Mt } from "react-map-gl/maplibre";
|
|
9
9
|
import { Map as Lt, APIProvider as _t, limitTiltRange as Pt, useMap as Et } from "@vis.gl/react-google-maps";
|
|
10
|
-
import { CompositeMode as kt, TranslateMode as Ct, ModifyMode as
|
|
10
|
+
import { CompositeMode as kt, TranslateMode as Ct, ModifyMode as wt, DrawPolygonByDraggingMode as Ft, DrawCircleFromCenterMode as Xe, DrawRectangleMode as Ot, DrawPolygonMode as At, EditableGeoJsonLayer as Je, MeasureAreaMode as Rt, getPickedEditHandle as Dt, MeasureDistanceMode as xt, ViewMode as qt } from "@deck.gl-community/editable-layers";
|
|
11
11
|
import { DataFilterExtension as Ut, MaskExtension as $t } from "@deck.gl/extensions";
|
|
12
|
-
import { create as et, createStore as
|
|
12
|
+
import { create as et, createStore as Ve, useStore as je } from "zustand";
|
|
13
13
|
import { FlyToInterpolator as Vt, WebMercatorViewport as jt } from "@deck.gl/core";
|
|
14
14
|
import { GeoJsonLayer as Nt } from "@deck.gl/layers";
|
|
15
15
|
import { useShallow as tt } from "zustand/shallow";
|
|
16
|
-
import { area as
|
|
16
|
+
import { area as Ie, centroid as It, lineIntersect as Bt } from "@turf/turf";
|
|
17
17
|
import { formatNumber as st, formatCurrency as Ht } from "@carto/ps-utils";
|
|
18
18
|
import Qt from "convert-units";
|
|
19
19
|
import Kt from "convert-units/definitions/length";
|
|
@@ -21,7 +21,7 @@ import { WidgetRasterSource as Gt, WidgetTilesetSource as Zt, TileFormat as zt,
|
|
|
21
21
|
import { useQuery as me } from "@tanstack/react-query";
|
|
22
22
|
import Jt from "html2canvas";
|
|
23
23
|
import { multiPolygon as es } from "@turf/helpers";
|
|
24
|
-
const
|
|
24
|
+
const Fe = {
|
|
25
25
|
roadmap: "roadmap",
|
|
26
26
|
satellite: "satellite",
|
|
27
27
|
hybrid: "hybrid"
|
|
@@ -50,13 +50,13 @@ const we = {
|
|
|
50
50
|
type: ue.maplibre,
|
|
51
51
|
dark: !0
|
|
52
52
|
},
|
|
53
|
-
[
|
|
53
|
+
[Fe.roadmap]: {
|
|
54
54
|
type: ue.googleMaps
|
|
55
55
|
},
|
|
56
|
-
[
|
|
56
|
+
[Fe.satellite]: {
|
|
57
57
|
type: ue.googleMaps
|
|
58
58
|
},
|
|
59
|
-
[
|
|
59
|
+
[Fe.hybrid]: {
|
|
60
60
|
type: ue.googleMaps
|
|
61
61
|
}
|
|
62
62
|
};
|
|
@@ -76,7 +76,7 @@ function ss(o) {
|
|
|
76
76
|
} : null;
|
|
77
77
|
}
|
|
78
78
|
function ns(o) {
|
|
79
|
-
var ye, _,
|
|
79
|
+
var ye, _, Ne;
|
|
80
80
|
const e = k(66);
|
|
81
81
|
let t, n, s, i, r, a, l, m, c, p, d, u, g, f;
|
|
82
82
|
e[0] !== o ? ({
|
|
@@ -103,12 +103,12 @@ function ns(o) {
|
|
|
103
103
|
e[17] !== d ? (v = d === void 0 ? {
|
|
104
104
|
apiKey: ""
|
|
105
105
|
} : d, e[17] = d, e[18] = v) : v = e[18];
|
|
106
|
-
let L, E,
|
|
106
|
+
let L, E, F;
|
|
107
107
|
e[19] !== v ? ({
|
|
108
|
-
apiKey:
|
|
108
|
+
apiKey: F,
|
|
109
109
|
APIProviderProps: L,
|
|
110
110
|
...E
|
|
111
|
-
} = v, e[19] = v, e[20] = L, e[21] = E, e[22] =
|
|
111
|
+
} = v, e[19] = v, e[20] = L, e[21] = E, e[22] = F) : (L = e[20], E = e[21], F = e[22]);
|
|
112
112
|
const O = u === void 0 ? ts : u, D = g === void 0 ? ss : g, U = f === void 0 ? ls : f;
|
|
113
113
|
let V;
|
|
114
114
|
e[23] === Symbol.for("react.memo_cache_sentinel") ? (V = [!1, !1], e[23] = V) : V = e[23];
|
|
@@ -129,17 +129,17 @@ function ns(o) {
|
|
|
129
129
|
const ge = be;
|
|
130
130
|
let oe;
|
|
131
131
|
e[30] !== I || e[31] !== U ? (oe = (he) => {
|
|
132
|
-
const
|
|
132
|
+
const we = I ? {
|
|
133
133
|
...he,
|
|
134
134
|
viewState: Pt(he)
|
|
135
135
|
} : he;
|
|
136
|
-
U(
|
|
136
|
+
U(we);
|
|
137
137
|
}, e[30] = I, e[31] = U, e[32] = oe) : oe = e[32];
|
|
138
138
|
const ie = oe;
|
|
139
139
|
let Z;
|
|
140
140
|
e[33] === Symbol.for("react.memo_cache_sentinel") ? (Z = (he) => {
|
|
141
|
-
const
|
|
142
|
-
P((ft) => ft.map((mt, pt) => pt ===
|
|
141
|
+
const we = he.type === "deckgl" ? 0 : 1;
|
|
142
|
+
P((ft) => ft.map((mt, pt) => pt === we ? !0 : mt));
|
|
143
143
|
}, e[33] = Z) : Z = e[33];
|
|
144
144
|
const re = Z;
|
|
145
145
|
let ae, le;
|
|
@@ -161,7 +161,7 @@ function ns(o) {
|
|
|
161
161
|
e[43] !== E || e[44] !== M || e[45] !== I || e[46] !== N || e[47] !== a ? (J = I ? /* @__PURE__ */ H(Lt, { mapTypeId: M, reuseMaps: !0, renderingType: "RASTER", ...E, defaultCenter: {
|
|
162
162
|
lat: ((ye = a.initialViewState) == null ? void 0 : ye.latitude) ?? 0,
|
|
163
163
|
lng: ((_ = a.initialViewState) == null ? void 0 : _.longitude) ?? 0
|
|
164
|
-
}, defaultZoom: ((
|
|
164
|
+
}, defaultZoom: ((Ne = a.initialViewState) == null ? void 0 : Ne.zoom) ?? 0, onTilesLoaded: () => re({
|
|
165
165
|
type: "load"
|
|
166
166
|
}) }) : /* @__PURE__ */ H(bt, { reuseMaps: !0, mapStyle: N, onLoad: () => re({
|
|
167
167
|
type: "load"
|
|
@@ -172,7 +172,7 @@ function ns(o) {
|
|
|
172
172
|
J
|
|
173
173
|
] }) }) }), e[49] = ge, e[50] = h, e[51] = O, e[52] = D, e[53] = B, e[54] = ie, e[55] = y, e[56] = t, e[57] = a, e[58] = X, e[59] = z, e[60] = J, e[61] = W) : W = e[61];
|
|
174
174
|
let ce;
|
|
175
|
-
return e[62] !== L || e[63] !==
|
|
175
|
+
return e[62] !== L || e[63] !== F || e[64] !== W ? (ce = /* @__PURE__ */ H(_t, { apiKey: F, ...L, children: W }), e[62] = L, e[63] = F, e[64] = W, e[65] = ce) : ce = e[65], ce;
|
|
176
176
|
}
|
|
177
177
|
function os() {
|
|
178
178
|
const o = document.querySelector(".maplibregl-compact-show");
|
|
@@ -213,7 +213,7 @@ const K = {
|
|
|
213
213
|
};
|
|
214
214
|
class us extends kt {
|
|
215
215
|
constructor() {
|
|
216
|
-
super([new Ct(), new
|
|
216
|
+
super([new Ct(), new wt()]);
|
|
217
217
|
}
|
|
218
218
|
handleKeyUp(e, t) {
|
|
219
219
|
super.handleKeyUp(e, t), e.key === "Enter" && (this.resetClickSequence(), t.onEdit({
|
|
@@ -236,7 +236,7 @@ const Te = "lassoLayer", ke = "maskLayer", ds = {
|
|
|
236
236
|
lineWidthUnits: "pixels",
|
|
237
237
|
getLineWidth: 2,
|
|
238
238
|
lineWidthMinPixels: 2
|
|
239
|
-
},
|
|
239
|
+
}, Be = {
|
|
240
240
|
editing: {
|
|
241
241
|
border: [3, 111, 226, 255],
|
|
242
242
|
fill: [3, 111, 226, 20.4],
|
|
@@ -249,8 +249,8 @@ const Te = "lassoLayer", ke = "maskLayer", ds = {
|
|
|
249
249
|
}, Ae = {
|
|
250
250
|
styles: {
|
|
251
251
|
colors: {
|
|
252
|
-
editing:
|
|
253
|
-
finished:
|
|
252
|
+
editing: Be.editing,
|
|
253
|
+
finished: Be.finished
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
256
|
labels: {
|
|
@@ -265,7 +265,7 @@ const Te = "lassoLayer", ke = "maskLayer", ds = {
|
|
|
265
265
|
visible: !0,
|
|
266
266
|
extensions: fs,
|
|
267
267
|
filterRange: [1, 1]
|
|
268
|
-
},
|
|
268
|
+
}, Re = {
|
|
269
269
|
polygon: {
|
|
270
270
|
value: "polygon",
|
|
271
271
|
mode: At
|
|
@@ -280,7 +280,7 @@ const Te = "lassoLayer", ke = "maskLayer", ds = {
|
|
|
280
280
|
},
|
|
281
281
|
lasso: {
|
|
282
282
|
value: "lasso",
|
|
283
|
-
mode:
|
|
283
|
+
mode: Ft
|
|
284
284
|
},
|
|
285
285
|
edit: {
|
|
286
286
|
value: "edit",
|
|
@@ -496,11 +496,11 @@ const Te = "lassoLayer", ke = "maskLayer", ds = {
|
|
|
496
496
|
};
|
|
497
497
|
i.setViewState(t, l);
|
|
498
498
|
}
|
|
499
|
-
}), hs = (o) =>
|
|
499
|
+
}), hs = (o) => Ve()((...e) => ({
|
|
500
500
|
...ps(o)(...e),
|
|
501
501
|
...gs(o)(...e),
|
|
502
502
|
...ys(...e)
|
|
503
|
-
})), ot =
|
|
503
|
+
})), ot = Ue({});
|
|
504
504
|
function Ss(o) {
|
|
505
505
|
const e = k(5), {
|
|
506
506
|
children: t,
|
|
@@ -512,18 +512,18 @@ function Ss(o) {
|
|
|
512
512
|
let r;
|
|
513
513
|
return e[2] !== t || e[3] !== i ? (r = /* @__PURE__ */ H(ot.Provider, { value: i, children: t }), e[2] = t, e[3] = i, e[4] = r) : r = e[4], r;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const e =
|
|
515
|
+
function w(o) {
|
|
516
|
+
const e = $e(ot);
|
|
517
517
|
if (!Object.keys(e).length)
|
|
518
518
|
throw new Error("Missing MapProvider in the tree");
|
|
519
|
-
return
|
|
519
|
+
return je(e, o);
|
|
520
520
|
}
|
|
521
521
|
function vs(o) {
|
|
522
522
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
523
523
|
}
|
|
524
|
-
var
|
|
524
|
+
var De, He;
|
|
525
525
|
function bs() {
|
|
526
|
-
if (He) return
|
|
526
|
+
if (He) return De;
|
|
527
527
|
He = 1;
|
|
528
528
|
var o = function(y) {
|
|
529
529
|
return e(y) && !t(y);
|
|
@@ -595,7 +595,7 @@ function bs() {
|
|
|
595
595
|
}, {});
|
|
596
596
|
};
|
|
597
597
|
var M = f;
|
|
598
|
-
return
|
|
598
|
+
return De = M, De;
|
|
599
599
|
}
|
|
600
600
|
var Ts = bs();
|
|
601
601
|
const Me = /* @__PURE__ */ vs(Ts);
|
|
@@ -639,14 +639,14 @@ function Ls({
|
|
|
639
639
|
});
|
|
640
640
|
return Me(r, i);
|
|
641
641
|
}
|
|
642
|
-
const _s = (o) =>
|
|
642
|
+
const _s = (o) => Ve()((e) => ({
|
|
643
643
|
data: o.reduce((n, s) => {
|
|
644
644
|
const {
|
|
645
645
|
enabled: i = !1,
|
|
646
646
|
mapId: r,
|
|
647
|
-
modeInstance: a,
|
|
648
|
-
modes: l =
|
|
649
|
-
modeSelected: m =
|
|
647
|
+
modeInstance: a = new Re.polygon.mode(),
|
|
648
|
+
modes: l = Re,
|
|
649
|
+
modeSelected: m = Re.polygon.value,
|
|
650
650
|
values: c = {}
|
|
651
651
|
} = s;
|
|
652
652
|
return n[r] = {
|
|
@@ -732,7 +732,7 @@ const _s = (o) => $e()((e) => ({
|
|
|
732
732
|
}
|
|
733
733
|
}));
|
|
734
734
|
}
|
|
735
|
-
})), it =
|
|
735
|
+
})), it = Ue({});
|
|
736
736
|
function Ps(o) {
|
|
737
737
|
const e = k(5), {
|
|
738
738
|
children: t,
|
|
@@ -745,10 +745,10 @@ function Ps(o) {
|
|
|
745
745
|
return e[2] !== t || e[3] !== i ? (r = /* @__PURE__ */ H(it.Provider, { value: i, children: t }), e[2] = t, e[3] = i, e[4] = r) : r = e[4], r;
|
|
746
746
|
}
|
|
747
747
|
function j(o) {
|
|
748
|
-
const e =
|
|
748
|
+
const e = $e(it);
|
|
749
749
|
if (!Object.keys(e).length)
|
|
750
750
|
throw new Error("Missing LassoToolsProvider in the tree");
|
|
751
|
-
return
|
|
751
|
+
return je(e, o);
|
|
752
752
|
}
|
|
753
753
|
function Es({
|
|
754
754
|
mapId: o,
|
|
@@ -769,7 +769,10 @@ function Es({
|
|
|
769
769
|
}), c = j((u) => u.setModeInstance);
|
|
770
770
|
Y(() => {
|
|
771
771
|
const u = m[a];
|
|
772
|
-
u && t
|
|
772
|
+
if (u && t) {
|
|
773
|
+
const g = u.mode;
|
|
774
|
+
c(o, new g());
|
|
775
|
+
}
|
|
773
776
|
}, [t, o, a, m, c]);
|
|
774
777
|
const [
|
|
775
778
|
p
|
|
@@ -828,7 +831,7 @@ function Ce({
|
|
|
828
831
|
autoSplitNumber: Ke
|
|
829
832
|
}
|
|
830
833
|
}) {
|
|
831
|
-
const i = e ===
|
|
834
|
+
const i = e === qe["m-km"], r = e === qe["ft-mi"], a = i || r;
|
|
832
835
|
let l, m;
|
|
833
836
|
if (a) {
|
|
834
837
|
const c = o < (n ?? Ke);
|
|
@@ -895,7 +898,7 @@ class Cs extends Rt {
|
|
|
895
898
|
picks: s
|
|
896
899
|
} = t, i = Dt(s), r = this.getClickSequence();
|
|
897
900
|
let a = !1;
|
|
898
|
-
!i && !this.allowOverlapping(n) && (this.addClickSequence(t), a = !0), this.area =
|
|
901
|
+
!i && !this.allowOverlapping(n) && (this.addClickSequence(t), a = !0), this.area = Ie({
|
|
899
902
|
type: "Polygon",
|
|
900
903
|
coordinates: [this.getClickSequence()]
|
|
901
904
|
}), this.isFinalizedEdition(r, i) ? this.finalizeEdition(n) : a && n.onEdit({
|
|
@@ -917,7 +920,7 @@ class Cs extends Rt {
|
|
|
917
920
|
const s = this.getTentativeGuide(n);
|
|
918
921
|
if (s && s.geometry.type === "Polygon") {
|
|
919
922
|
const i = It(s);
|
|
920
|
-
this.area =
|
|
923
|
+
this.area = Ie(s), this.tooltips = at(this.area, i.geometry.coordinates, n.modeConfig);
|
|
921
924
|
}
|
|
922
925
|
}
|
|
923
926
|
resetClickSequence() {
|
|
@@ -997,7 +1000,7 @@ class Cs extends Rt {
|
|
|
997
1000
|
}) + "2";
|
|
998
1001
|
}
|
|
999
1002
|
}
|
|
1000
|
-
class
|
|
1003
|
+
class ws extends Xe {
|
|
1001
1004
|
constructor() {
|
|
1002
1005
|
super(...arguments);
|
|
1003
1006
|
ne(this, "_isMeasuringSessionFinished", !1);
|
|
@@ -1132,7 +1135,7 @@ class lt extends xt {
|
|
|
1132
1135
|
});
|
|
1133
1136
|
}
|
|
1134
1137
|
}
|
|
1135
|
-
const ve = "mapMeasureLayer",
|
|
1138
|
+
const ve = "mapMeasureLayer", Fs = {
|
|
1136
1139
|
id: ve,
|
|
1137
1140
|
pickable: !1,
|
|
1138
1141
|
billboard: !1,
|
|
@@ -1157,16 +1160,16 @@ const ve = "mapMeasureLayer", ws = {
|
|
|
1157
1160
|
getLineWidth: 2
|
|
1158
1161
|
}
|
|
1159
1162
|
}
|
|
1160
|
-
},
|
|
1163
|
+
}, xe = {
|
|
1161
1164
|
editing: [23, 102, 214, 255],
|
|
1162
1165
|
finished: [71, 219, 153, 255],
|
|
1163
1166
|
point: [255, 255, 255, 255]
|
|
1164
1167
|
}, Ge = {
|
|
1165
1168
|
styles: {
|
|
1166
1169
|
colors: {
|
|
1167
|
-
editing:
|
|
1168
|
-
finished:
|
|
1169
|
-
point:
|
|
1170
|
+
editing: xe.editing,
|
|
1171
|
+
finished: xe.finished,
|
|
1172
|
+
point: xe.point
|
|
1170
1173
|
}
|
|
1171
1174
|
}
|
|
1172
1175
|
}, R = {
|
|
@@ -1177,7 +1180,7 @@ const ve = "mapMeasureLayer", ws = {
|
|
|
1177
1180
|
mile: "mile",
|
|
1178
1181
|
yard: "yard",
|
|
1179
1182
|
feet: "feet"
|
|
1180
|
-
},
|
|
1183
|
+
}, qe = {
|
|
1181
1184
|
"m-km": "m-km",
|
|
1182
1185
|
"ft-mi": "ft-mi",
|
|
1183
1186
|
...R
|
|
@@ -1245,7 +1248,7 @@ const ve = "mapMeasureLayer", ws = {
|
|
|
1245
1248
|
},
|
|
1246
1249
|
buffer: {
|
|
1247
1250
|
value: "buffer",
|
|
1248
|
-
mode:
|
|
1251
|
+
mode: ws
|
|
1249
1252
|
},
|
|
1250
1253
|
area: {
|
|
1251
1254
|
value: "area",
|
|
@@ -1281,10 +1284,10 @@ function qs({
|
|
|
1281
1284
|
}), p = j((b) => {
|
|
1282
1285
|
var P;
|
|
1283
1286
|
return (P = b.data[e]) == null ? void 0 : P.modeSelected;
|
|
1284
|
-
}), d = _e((b) => b.setLayer), u =
|
|
1287
|
+
}), d = _e((b) => b.setLayer), u = w((b) => b.addLayers), g = w((b) => b.removeLayers), f = w(tt((b) => {
|
|
1285
1288
|
var P;
|
|
1286
1289
|
return (P = b.maps[e]) == null ? void 0 : P.layers.filter((C) => !xs.includes(C));
|
|
1287
|
-
})), M =
|
|
1290
|
+
})), M = w((b) => b.getDeckInstance), h = Ee({}), y = de(() => rt({
|
|
1288
1291
|
values: l
|
|
1289
1292
|
}), [l]), T = de(() => ({
|
|
1290
1293
|
type: "FeatureCollection",
|
|
@@ -1294,7 +1297,7 @@ function qs({
|
|
|
1294
1297
|
properties: b.properties,
|
|
1295
1298
|
id: b.id
|
|
1296
1299
|
}))
|
|
1297
|
-
}), [y]), S = de(() => y.filter((b) => b.properties.visible).map((b) => b.id), [y]), [v, L] = fe(T), [E,
|
|
1300
|
+
}), [y]), S = de(() => y.filter((b) => b.properties.visible).map((b) => b.id), [y]), [v, L] = fe(T), [E, F] = fe([]), O = $(() => {
|
|
1298
1301
|
const b = {
|
|
1299
1302
|
...T,
|
|
1300
1303
|
features: T.features.filter((P) => {
|
|
@@ -1312,7 +1315,7 @@ function qs({
|
|
|
1312
1315
|
g(e, [Te]);
|
|
1313
1316
|
}), [u, e, g]);
|
|
1314
1317
|
const U = $(() => {
|
|
1315
|
-
O(),
|
|
1318
|
+
O(), F([]), a(e, !1);
|
|
1316
1319
|
}, [e, O, a]), V = $(({
|
|
1317
1320
|
editType: b,
|
|
1318
1321
|
updatedData: P
|
|
@@ -1352,7 +1355,7 @@ function qs({
|
|
|
1352
1355
|
},
|
|
1353
1356
|
onClick: (G) => {
|
|
1354
1357
|
const I = G;
|
|
1355
|
-
I.isGuide ||
|
|
1358
|
+
I.isGuide || F([I.index]);
|
|
1356
1359
|
}
|
|
1357
1360
|
},
|
|
1358
1361
|
getLineColor: (G) => E[0] === G.properties.index ? P : x,
|
|
@@ -1362,7 +1365,7 @@ function qs({
|
|
|
1362
1365
|
outline: P
|
|
1363
1366
|
},
|
|
1364
1367
|
onEdit: V,
|
|
1365
|
-
mode: b ? c : qt
|
|
1368
|
+
mode: b ? c : new qt()
|
|
1366
1369
|
});
|
|
1367
1370
|
d(Te, N);
|
|
1368
1371
|
}, [v, r, s.mask, S, c, V, E, d, t.colors.editing, t.colors.finished]), Y(() => {
|
|
@@ -1461,7 +1464,7 @@ function $s({
|
|
|
1461
1464
|
}
|
|
1462
1465
|
}
|
|
1463
1466
|
}
|
|
1464
|
-
}), c = Me(
|
|
1467
|
+
}), c = Me(Fs, {
|
|
1465
1468
|
_subLayerProps: {
|
|
1466
1469
|
guides: {
|
|
1467
1470
|
getLineColor: r,
|
|
@@ -1473,7 +1476,7 @@ function $s({
|
|
|
1473
1476
|
});
|
|
1474
1477
|
return Me(c, m);
|
|
1475
1478
|
}
|
|
1476
|
-
const Vs = (o) =>
|
|
1479
|
+
const Vs = (o) => Ve()((e) => ({
|
|
1477
1480
|
measurements: o.reduce((n, s) => {
|
|
1478
1481
|
const {
|
|
1479
1482
|
mapId: i,
|
|
@@ -1485,7 +1488,7 @@ const Vs = (o) => $e()((e) => ({
|
|
|
1485
1488
|
locale: p = "en",
|
|
1486
1489
|
positions: d = [],
|
|
1487
1490
|
clearLayerOnStart: u = !1,
|
|
1488
|
-
unit: g =
|
|
1491
|
+
unit: g = qe["m-km"],
|
|
1489
1492
|
enabled: f = !1
|
|
1490
1493
|
} = s;
|
|
1491
1494
|
return n[i] = {
|
|
@@ -1590,7 +1593,7 @@ const Vs = (o) => $e()((e) => ({
|
|
|
1590
1593
|
}
|
|
1591
1594
|
}));
|
|
1592
1595
|
}
|
|
1593
|
-
})), ct =
|
|
1596
|
+
})), ct = Ue({});
|
|
1594
1597
|
function js(o) {
|
|
1595
1598
|
const e = k(5), {
|
|
1596
1599
|
children: t,
|
|
@@ -1603,10 +1606,10 @@ function js(o) {
|
|
|
1603
1606
|
return e[2] !== t || e[3] !== i ? (r = /* @__PURE__ */ H(ct.Provider, { value: i, children: t }), e[2] = t, e[3] = i, e[4] = r) : r = e[4], r;
|
|
1604
1607
|
}
|
|
1605
1608
|
function q(o) {
|
|
1606
|
-
const e =
|
|
1609
|
+
const e = $e(ct);
|
|
1607
1610
|
if (!Object.keys(e).length)
|
|
1608
1611
|
throw new Error("Missing MeasurementToolsProvider in the tree");
|
|
1609
|
-
return
|
|
1612
|
+
return je(e, o);
|
|
1610
1613
|
}
|
|
1611
1614
|
function ut(o) {
|
|
1612
1615
|
const e = k(74), {
|
|
@@ -1641,9 +1644,9 @@ function ut(o) {
|
|
|
1641
1644
|
y(!!_), v(t, _);
|
|
1642
1645
|
}, e[18] = v, e[19] = t, e[20] = y, e[21] = L) : L = e[21];
|
|
1643
1646
|
const E = L;
|
|
1644
|
-
let
|
|
1645
|
-
e[22] !== t ? (
|
|
1646
|
-
const O = q(
|
|
1647
|
+
let F;
|
|
1648
|
+
e[22] !== t ? (F = (_) => _.measurements[t].finished, e[22] = t, e[23] = F) : F = e[23];
|
|
1649
|
+
const O = q(F), D = q(Qs);
|
|
1647
1650
|
let U;
|
|
1648
1651
|
e[24] !== D || e[25] !== t ? (U = (_) => D(t, _), e[24] = D, e[25] = t, e[26] = U) : U = e[26];
|
|
1649
1652
|
const V = U;
|
|
@@ -1759,7 +1762,7 @@ function zs(o) {
|
|
|
1759
1762
|
positions: v,
|
|
1760
1763
|
setPositions: L,
|
|
1761
1764
|
unit: E,
|
|
1762
|
-
setUnit:
|
|
1765
|
+
setUnit: F,
|
|
1763
1766
|
clearLayer: O,
|
|
1764
1767
|
toggleLayer: D
|
|
1765
1768
|
} = ut(i);
|
|
@@ -1781,7 +1784,7 @@ function zs(o) {
|
|
|
1781
1784
|
}, e[13] = D, e[14] = O, e[15] = c, e[16] = f, e[17] = b) : b = e[17];
|
|
1782
1785
|
const P = b, C = !!c;
|
|
1783
1786
|
let A;
|
|
1784
|
-
return e[18] !== s || e[19] !== O || e[20] !== l || e[21] !== u || e[22] !== f || e[23] !== h || e[24] !== t || e[25] !== T || e[26] !== p || e[27] !== r || e[28] !== v || e[29] !== m || e[30] !== g || e[31] !== M || e[32] !== y || e[33] !== d || e[34] !== L || e[35] !==
|
|
1787
|
+
return e[18] !== s || e[19] !== O || e[20] !== l || e[21] !== u || e[22] !== f || e[23] !== h || e[24] !== t || e[25] !== T || e[26] !== p || e[27] !== r || e[28] !== v || e[29] !== m || e[30] !== g || e[31] !== M || e[32] !== y || e[33] !== d || e[34] !== L || e[35] !== F || e[36] !== C || e[37] !== n || e[38] !== P || e[39] !== E || e[40] !== a ? (A = s({
|
|
1785
1788
|
mapId: t,
|
|
1786
1789
|
distance: l,
|
|
1787
1790
|
enabled: u,
|
|
@@ -1805,11 +1808,11 @@ function zs(o) {
|
|
|
1805
1808
|
setFinished: M,
|
|
1806
1809
|
setLocale: y,
|
|
1807
1810
|
setPositions: L,
|
|
1808
|
-
setUnit:
|
|
1811
|
+
setUnit: F,
|
|
1809
1812
|
setEnabled: g,
|
|
1810
1813
|
toggleLayer: P,
|
|
1811
1814
|
clearLayer: O
|
|
1812
|
-
}), e[18] = s, e[19] = O, e[20] = l, e[21] = u, e[22] = f, e[23] = h, e[24] = t, e[25] = T, e[26] = p, e[27] = r, e[28] = v, e[29] = m, e[30] = g, e[31] = M, e[32] = y, e[33] = d, e[34] = L, e[35] =
|
|
1815
|
+
}), e[18] = s, e[19] = O, e[20] = l, e[21] = u, e[22] = f, e[23] = h, e[24] = t, e[25] = T, e[26] = p, e[27] = r, e[28] = v, e[29] = m, e[30] = g, e[31] = M, e[32] = y, e[33] = d, e[34] = L, e[35] = F, e[36] = C, e[37] = n, e[38] = P, e[39] = E, e[40] = a, e[41] = A) : A = e[41], A;
|
|
1813
1816
|
}
|
|
1814
1817
|
const Ws = [ve];
|
|
1815
1818
|
function Ys({
|
|
@@ -1835,16 +1838,16 @@ function Ys({
|
|
|
1835
1838
|
modeInstance: u
|
|
1836
1839
|
} = ut({
|
|
1837
1840
|
mapId: e
|
|
1838
|
-
}), g = _e((v) => v.setLayer), f =
|
|
1841
|
+
}), g = _e((v) => v.setLayer), f = w((v) => v.addLayers), M = w((v) => v.removeLayers), h = w(tt((v) => {
|
|
1839
1842
|
var L;
|
|
1840
1843
|
return (L = v.maps[e]) == null ? void 0 : L.layers.filter((E) => !Ws.includes(E));
|
|
1841
|
-
})), y =
|
|
1844
|
+
})), y = w((v) => v.getDeckInstance), T = Ee({});
|
|
1842
1845
|
Y(() => (a && f(e, [ve]), () => {
|
|
1843
1846
|
M(e, [ve]);
|
|
1844
1847
|
}), [f, r, e, M, a]), Y(() => {
|
|
1845
1848
|
h == null || h.forEach((v) => {
|
|
1846
|
-
var
|
|
1847
|
-
const L = (
|
|
1849
|
+
var F;
|
|
1850
|
+
const L = (F = y(e)) == null ? void 0 : F.props.layers.find((O) => O.props.id === v);
|
|
1848
1851
|
a && (T.current[v] = L == null ? void 0 : L.props.pickable);
|
|
1849
1852
|
const E = !a && (T.current[v] ?? (L == null ? void 0 : L.props.pickable));
|
|
1850
1853
|
g(v, {
|
|
@@ -1893,7 +1896,7 @@ function Xs(o) {
|
|
|
1893
1896
|
e[0] !== t ? (n = (m) => m.maps[t], e[0] = t, e[1] = n) : n = e[1];
|
|
1894
1897
|
const {
|
|
1895
1898
|
layers: s
|
|
1896
|
-
} =
|
|
1899
|
+
} = w(n), i = _e(en);
|
|
1897
1900
|
let r, a;
|
|
1898
1901
|
if (e[2] !== i || e[3] !== s) {
|
|
1899
1902
|
let m;
|
|
@@ -1924,7 +1927,7 @@ function zn({
|
|
|
1924
1927
|
basemap: s,
|
|
1925
1928
|
instanceRef: i,
|
|
1926
1929
|
overlayRef: r
|
|
1927
|
-
} =
|
|
1930
|
+
} = w((S) => S.maps[o]), a = Ee(null), l = w((S) => S.viewStates[o]), m = w((S) => S.setViewState), c = w((S) => S.setLoad), p = w((S) => S.setLayersLoad), d = w((S) => S.updateViewPort), u = Xs({
|
|
1928
1931
|
mapId: o
|
|
1929
1932
|
}), g = de(() => dt(u), [u]), f = $((S) => {
|
|
1930
1933
|
const v = m;
|
|
@@ -1938,8 +1941,8 @@ function zn({
|
|
|
1938
1941
|
}, [o, t, m, d]), M = $((S) => {
|
|
1939
1942
|
c(o, S), e == null || e(S), d(o);
|
|
1940
1943
|
}, [o, e, c, d]), h = $((S) => {
|
|
1941
|
-
var E,
|
|
1942
|
-
const v = (
|
|
1944
|
+
var E, F, O;
|
|
1945
|
+
const v = (F = (E = i == null ? void 0 : i.current) == null ? void 0 : E.deck) == null ? void 0 : F.props.layers, L = !!(v != null && v.every((D) => D == null ? void 0 : D.isLoaded));
|
|
1943
1946
|
p(o, L), (O = n.onAfterRender) == null || O.call(n, S);
|
|
1944
1947
|
}, [o, i, n, p]), y = n.onDragEnd, T = $((...S) => {
|
|
1945
1948
|
d(o), y && y(...S);
|
|
@@ -2400,13 +2403,13 @@ function io(o, e) {
|
|
|
2400
2403
|
function ro({
|
|
2401
2404
|
mapId: o
|
|
2402
2405
|
}) {
|
|
2403
|
-
const [e, t] = fe(void 0), [n, s] = fe(!1), i =
|
|
2406
|
+
const [e, t] = fe(void 0), [n, s] = fe(!1), i = w((f) => {
|
|
2404
2407
|
var M;
|
|
2405
2408
|
return (M = f.maps[o]) == null ? void 0 : M.basemap;
|
|
2406
|
-
}), r =
|
|
2409
|
+
}), r = w((f) => f.getDeckInstance), a = w((f) => f.getOverlayInstance), l = w((f) => {
|
|
2407
2410
|
var M;
|
|
2408
2411
|
return (M = f.maps[o]) == null ? void 0 : M.areLayersLoaded;
|
|
2409
|
-
}), c =
|
|
2412
|
+
}), c = w((f) => {
|
|
2410
2413
|
var M;
|
|
2411
2414
|
return (M = f.maps[o]) == null ? void 0 : M.isLoaded;
|
|
2412
2415
|
}) && l, {
|
|
@@ -2473,7 +2476,7 @@ function yn(o) {
|
|
|
2473
2476
|
} = o;
|
|
2474
2477
|
let n;
|
|
2475
2478
|
e[0] !== t ? (n = (r) => r.viewports[t], e[0] = t, e[1] = n) : n = e[1];
|
|
2476
|
-
const s =
|
|
2479
|
+
const s = w(n);
|
|
2477
2480
|
let i;
|
|
2478
2481
|
e: {
|
|
2479
2482
|
if (!s) {
|
|
@@ -2602,10 +2605,10 @@ function uo(o) {
|
|
|
2602
2605
|
zoom: i,
|
|
2603
2606
|
maxZoom: r,
|
|
2604
2607
|
minZoom: a
|
|
2605
|
-
} =
|
|
2608
|
+
} = w(s);
|
|
2606
2609
|
let l;
|
|
2607
2610
|
e[2] !== n ? (l = (y) => y.maps[n].areLayersLoaded, e[2] = n, e[3] = l) : l = e[3];
|
|
2608
|
-
const m =
|
|
2611
|
+
const m = w(l), c = w(En), p = w(Pn), d = !m;
|
|
2609
2612
|
let u;
|
|
2610
2613
|
e[4] !== n || e[5] !== c ? (u = (y) => c(n, y), e[4] = n, e[5] = c, e[6] = u) : u = e[6];
|
|
2611
2614
|
const g = u;
|
|
@@ -2636,21 +2639,21 @@ export {
|
|
|
2636
2639
|
Wn as CategoriesModel,
|
|
2637
2640
|
us as CustomCompositeEditMode,
|
|
2638
2641
|
Cs as CustomMeasureAreaMode,
|
|
2639
|
-
|
|
2642
|
+
ws as CustomMeasureBufferMode,
|
|
2640
2643
|
lt as CustomMeasureDistanceMode,
|
|
2641
|
-
|
|
2644
|
+
Be as DEFAULT_LASSO_TOOLS_COLORS,
|
|
2642
2645
|
ds as DEFAULT_LASSO_TOOLS_LAYER_PROPS,
|
|
2643
|
-
|
|
2646
|
+
Re as DEFAULT_LASSO_TOOLS_MODES,
|
|
2644
2647
|
Ae as DEFAULT_LASSO_TOOLS_PROPS,
|
|
2645
2648
|
Pe as DEFAULT_MASK_LAYER_PROPS,
|
|
2646
2649
|
Rs as DEFAULT_MEASUREMENT_TOOLS_MODES,
|
|
2647
2650
|
Ds as DEFAULT_MEASUREMENT_TOOLS_UNITS,
|
|
2648
|
-
|
|
2651
|
+
xe as DEFAULT_MEASURE_COLORS,
|
|
2649
2652
|
ns as DeckGLComponent,
|
|
2650
2653
|
K as EditableEditType,
|
|
2651
2654
|
Yn as FeaturesModel,
|
|
2652
2655
|
Xn as FormulaModel,
|
|
2653
|
-
|
|
2656
|
+
Fe as GmapsBasemap,
|
|
2654
2657
|
Jn as HistogramModel,
|
|
2655
2658
|
Le as INTL_UNITS,
|
|
2656
2659
|
qs as LassoTools,
|
|
@@ -2663,7 +2666,7 @@ export {
|
|
|
2663
2666
|
ze as MEASUREMENT_TOOLS_UNITS_DISTANCE,
|
|
2664
2667
|
Q as MEASUREMENT_TOOLS_UNITS_DISTANCE_VALUES,
|
|
2665
2668
|
zn as MapComponent,
|
|
2666
|
-
|
|
2669
|
+
qe as MapMeasurementUnitAuto,
|
|
2667
2670
|
Os as MapMeasurementUnitTurf,
|
|
2668
2671
|
Ss as MapProvider,
|
|
2669
2672
|
oo as MapsProvider,
|
|
@@ -2701,7 +2704,7 @@ export {
|
|
|
2701
2704
|
Xs as useLayers,
|
|
2702
2705
|
io as useLegend,
|
|
2703
2706
|
ro as useMapScreenshot,
|
|
2704
|
-
|
|
2707
|
+
w as useMapStore,
|
|
2705
2708
|
q as useMeasurementToolsState,
|
|
2706
2709
|
fn as useRange,
|
|
2707
2710
|
mn as useScatter,
|