@map-colonies/react-components 4.1.3 → 4.2.0
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.
|
@@ -34,7 +34,7 @@ import Wn from "@material-ui/core/CssBaseline";
|
|
|
34
34
|
import Un from "@material-ui/core/ScopedCssBaseline";
|
|
35
35
|
import { createPortal as jn } from "react-dom";
|
|
36
36
|
import { Viewer as Kn, Cesium3DTileset as qn, GeoJsonDataSource as Yn, ImageryLayer as Xn, Entity as Zn, EntityDescription as Bt, PolygonGraphics as Jn, RectangleGraphics as Qn, CustomDataSource as ei, PolylineGraphics as ti } from "resium";
|
|
37
|
-
import * as
|
|
37
|
+
import * as p from "cesium";
|
|
38
38
|
import { ScreenSpaceEventType as ni, Cartesian3 as ge, Math as le, WebMercatorProjection as ii, EventHelper as ri, EllipsoidGeodesic as oi, Cartesian2 as Se, SceneMode as ve, Cartographic as Ge, UrlTemplateImageryProvider as nt, WebMapServiceImageryProvider as it, WebMapTileServiceImageryProvider as rt, Event as si, SingleTileImageryProvider as ai, Rectangle as be, Viewer as li, Matrix4 as ci, OpenStreetMapImageryProvider as di, Color as ui, PolygonHierarchy as hi, PolylineDashMaterialProperty as mi, ConstantProperty as pi, ConstantPositionProperty as gi, BoundingSphere as fi, Ellipsoid as yi, GeographicTilingScheme as vi, Resource as Ei, EllipsoidTerrainProvider as Ci, CesiumTerrainProvider as wi, VerticalOrigin as bi, LabelStyle as Ti } from "cesium";
|
|
39
39
|
import { Math as Vs, sampleTerrainMostDetailed as zs } from "cesium";
|
|
40
40
|
import { get as Q, isNumber as Ne, isEmpty as Je, isArray as _i, find as mt } from "lodash";
|
|
@@ -118,7 +118,7 @@ const Oi = 2, Ri = 0.5, Ni = Ie(
|
|
|
118
118
|
})
|
|
119
119
|
), Bi = (e) => {
|
|
120
120
|
var U, x, $, R;
|
|
121
|
-
const n = Ni(), t = Ot(), i = zt(t), [o, r] = A(null), [d, u] = A(null), [
|
|
121
|
+
const n = Ni(), t = Ot(), i = zt(t), [o, r] = A(null), [d, u] = A(null), [m, E] = A(J.DATE_RANGE_PICKER.dateFormat), w = e.controlsLayout ?? J.DATE_RANGE_PICKER.controlsLayout, M = e.disableFuture ?? J.DATE_RANGE_PICKER.disableFuture, _ = ((U = e.local) == null ? void 0 : U.startPlaceHolderText) ?? J.DATE_RANGE_PICKER.local.startPlaceHolderText, k = ((x = e.local) == null ? void 0 : x.endPlaceHolderText) ?? J.DATE_RANGE_PICKER.local.endPlaceHolderText, H = (($ = e.local) == null ? void 0 : $.setText) ?? J.DATE_RANGE_PICKER.local.setText, K = (((R = e.local) == null ? void 0 : R.calendarLocale) ?? J.DATE_RANGE_PICKER.local.calendarLocale) === ce.HE ? Dt : It;
|
|
122
122
|
O(() => {
|
|
123
123
|
r(e.from ?? null);
|
|
124
124
|
}, [e.from]), O(() => {
|
|
@@ -139,8 +139,8 @@ const Oi = 2, Ri = 0.5, Ni = Ie(
|
|
|
139
139
|
{
|
|
140
140
|
className: `${n.container} drpContainer`,
|
|
141
141
|
display: "flex",
|
|
142
|
-
flexDirection:
|
|
143
|
-
width:
|
|
142
|
+
flexDirection: w,
|
|
143
|
+
width: w === "column" ? e.contentWidth : "unset",
|
|
144
144
|
children: /* @__PURE__ */ B(At, { utils: kt, locale: K, children: [
|
|
145
145
|
/* @__PURE__ */ l(
|
|
146
146
|
Ye,
|
|
@@ -150,7 +150,7 @@ const Oi = 2, Ri = 0.5, Ni = Ie(
|
|
|
150
150
|
onChange: (V) => r(V),
|
|
151
151
|
value: o,
|
|
152
152
|
disableFuture: M,
|
|
153
|
-
format:
|
|
153
|
+
format: m,
|
|
154
154
|
maxDate: e.maxDate,
|
|
155
155
|
minDate: e.minDate
|
|
156
156
|
}
|
|
@@ -164,7 +164,7 @@ const Oi = 2, Ri = 0.5, Ni = Ie(
|
|
|
164
164
|
onChange: (V) => u(V),
|
|
165
165
|
value: d,
|
|
166
166
|
disableFuture: M,
|
|
167
|
-
format:
|
|
167
|
+
format: m,
|
|
168
168
|
maxDate: e.maxDate,
|
|
169
169
|
minDate: e.minDate
|
|
170
170
|
}
|
|
@@ -188,12 +188,12 @@ const Oi = 2, Ri = 0.5, Ni = Ie(
|
|
|
188
188
|
};
|
|
189
189
|
const Qo = (e) => {
|
|
190
190
|
var x, $;
|
|
191
|
-
const [n, t] = A(null), [i, o] = A(null), [r, d] = A(J.DATE_RANGE_PICKER.dateFormat), [u,
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
R.currentTarget.tagName === "I" ?
|
|
191
|
+
const [n, t] = A(null), [i, o] = A(null), [r, d] = A(J.DATE_RANGE_PICKER.dateFormat), [u, m] = fe.useState(null), E = (R) => {
|
|
192
|
+
m(R.currentTarget);
|
|
193
|
+
}, w = (R) => {
|
|
194
|
+
R.currentTarget.tagName === "I" ? m(R.currentTarget.previousElementSibling) : m(R.currentTarget);
|
|
195
195
|
}, M = () => {
|
|
196
|
-
|
|
196
|
+
m(null);
|
|
197
197
|
}, _ = Boolean(u), k = e.controlsLayout ?? "column";
|
|
198
198
|
O(() => {
|
|
199
199
|
t(e.from ?? null);
|
|
@@ -211,11 +211,11 @@ const Qo = (e) => {
|
|
|
211
211
|
readOnly: !0,
|
|
212
212
|
style: { width: e.width },
|
|
213
213
|
value: U,
|
|
214
|
-
onClick:
|
|
214
|
+
onClick: w,
|
|
215
215
|
trailingIcon: {
|
|
216
216
|
icon: "date_range",
|
|
217
217
|
tabIndex: 0,
|
|
218
|
-
onClick:
|
|
218
|
+
onClick: w
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
),
|
|
@@ -248,16 +248,16 @@ const Qo = (e) => {
|
|
|
248
248
|
endTimeLabel: r = "",
|
|
249
249
|
endTimeWrapperClassName: d = "",
|
|
250
250
|
timeRangeInputsWrapperClassName: u = "",
|
|
251
|
-
startTimeInputClassName:
|
|
251
|
+
startTimeInputClassName: m = "",
|
|
252
252
|
startTimeLabel: E = "",
|
|
253
|
-
startTimeWrapperClassName:
|
|
253
|
+
startTimeWrapperClassName: w = ""
|
|
254
254
|
}) => /* @__PURE__ */ B("div", { className: `timeRangeWrapper ${u}`, children: [
|
|
255
|
-
/* @__PURE__ */ l("div", { className: `startTimeWrapper ${
|
|
255
|
+
/* @__PURE__ */ l("div", { className: `startTimeWrapper ${w}`, children: /* @__PURE__ */ l(
|
|
256
256
|
Re,
|
|
257
257
|
{
|
|
258
258
|
label: E,
|
|
259
259
|
disabled: n === null,
|
|
260
|
-
className: `timeRangeInput ${
|
|
260
|
+
className: `timeRangeInput ${m}`,
|
|
261
261
|
name: "start-time",
|
|
262
262
|
type: "time",
|
|
263
263
|
value: we(n).format("HH:mm"),
|
|
@@ -306,30 +306,30 @@ const Qo = (e) => {
|
|
|
306
306
|
}, setEndDate: n = () => {
|
|
307
307
|
}, shortcuts: t, dateRange: i, onShortcut: o }) => {
|
|
308
308
|
const [r, d] = A(), u = Fe(
|
|
309
|
-
() => t.map((
|
|
309
|
+
() => t.map((m) => m instanceof Function ? m() : m),
|
|
310
310
|
[t]
|
|
311
311
|
);
|
|
312
312
|
return O(() => {
|
|
313
|
-
for (const
|
|
314
|
-
const E = i.startDate && i.endDate && dt(
|
|
315
|
-
r ?
|
|
313
|
+
for (const m of u) {
|
|
314
|
+
const E = i.startDate && i.endDate && dt(m.startDate, i.startDate) && dt(m.endDate, i.endDate);
|
|
315
|
+
r ? m.id === r && (E || d(void 0)) : E && d(m.id);
|
|
316
316
|
}
|
|
317
|
-
}, [i, r, u]), /* @__PURE__ */ l("div", { className: "shortcutsContainer", children: u.map((
|
|
318
|
-
const
|
|
319
|
-
e(
|
|
317
|
+
}, [i, r, u]), /* @__PURE__ */ l("div", { className: "shortcutsContainer", children: u.map((m, E) => {
|
|
318
|
+
const w = () => {
|
|
319
|
+
e(m.startDate), n(m.endDate);
|
|
320
320
|
};
|
|
321
321
|
return /* @__PURE__ */ l(
|
|
322
322
|
Me,
|
|
323
323
|
{
|
|
324
324
|
type: "button",
|
|
325
|
-
className: `shortcut ${r ===
|
|
325
|
+
className: `shortcut ${r === m.id ? "selected" : ""}`,
|
|
326
326
|
onClick: (M) => {
|
|
327
|
-
|
|
327
|
+
w(), o == null || o({ startDate: m.startDate, endDate: m.endDate });
|
|
328
328
|
},
|
|
329
329
|
outlined: !0,
|
|
330
|
-
children:
|
|
330
|
+
children: m.label
|
|
331
331
|
},
|
|
332
|
-
|
|
332
|
+
m.id + E
|
|
333
333
|
);
|
|
334
334
|
}) });
|
|
335
335
|
}, ts = fe.forwardRef((e, n) => {
|
|
@@ -349,26 +349,26 @@ const Qo = (e) => {
|
|
|
349
349
|
selectsRange: r,
|
|
350
350
|
onChange: d,
|
|
351
351
|
inputName: u,
|
|
352
|
-
showMonthYearDropdown:
|
|
352
|
+
showMonthYearDropdown: m,
|
|
353
353
|
// withTimeRange,
|
|
354
354
|
withShortcuts: E,
|
|
355
|
-
locale:
|
|
355
|
+
locale: w = "en"
|
|
356
356
|
} = e, [M, _] = A(null), [k, H] = A(null), [j, K] = A(!1), F = r ? { startDate: M, endDate: k } : M;
|
|
357
357
|
O(() => {
|
|
358
|
-
|
|
359
|
-
}, [
|
|
358
|
+
w === "he" && In("he", An);
|
|
359
|
+
}, [w]), O(() => {
|
|
360
360
|
var x, $;
|
|
361
361
|
((x = e.startDate) == null ? void 0 : x.toString()) !== (M == null ? void 0 : M.toString()) && _(e.startDate), (($ = e.endDate) == null ? void 0 : $.toString()) !== (k == null ? void 0 : k.toString()) && H(e.endDate);
|
|
362
362
|
}, [e.startDate, e.endDate, M, k]);
|
|
363
363
|
const Y = Fe(() => {
|
|
364
|
-
let x = "pickerContainer" + (
|
|
364
|
+
let x = "pickerContainer" + (w === "he" ? " pickerContainer-rtl" : "");
|
|
365
365
|
return E && r && (x += " pickerContainer-withShortcuts"), x;
|
|
366
|
-
}, [
|
|
366
|
+
}, [w, E, r]), U = m ? {
|
|
367
367
|
showMonthDropdown: !0,
|
|
368
368
|
showYearDropdown: !0,
|
|
369
369
|
dropdownMode: "select"
|
|
370
370
|
} : {};
|
|
371
|
-
return /* @__PURE__ */ l("div", { className: Y, style: { direction:
|
|
371
|
+
return /* @__PURE__ */ l("div", { className: Y, style: { direction: w === "he" ? "rtl" : "ltr" }, children: /* @__PURE__ */ l(
|
|
372
372
|
Dn,
|
|
373
373
|
{
|
|
374
374
|
...e,
|
|
@@ -408,19 +408,19 @@ const ns = (e) => {
|
|
|
408
408
|
format: r = J.DATE_PICKER.dateFormat,
|
|
409
409
|
variant: d = J.DATE_PICKER.variant,
|
|
410
410
|
disableFuture: u = J.DATE_PICKER.disableFuture,
|
|
411
|
-
local:
|
|
411
|
+
local: m,
|
|
412
412
|
onChange: E,
|
|
413
|
-
showTime:
|
|
413
|
+
showTime: w = J.DATE_PICKER.showTime,
|
|
414
414
|
value: M,
|
|
415
415
|
..._
|
|
416
|
-
} = e, { placeHolderText: k = J.DATE_PICKER.local.placeHolderText, calendarLocale: H } =
|
|
416
|
+
} = e, { placeHolderText: k = J.DATE_PICKER.local.placeHolderText, calendarLocale: H } = m ?? {
|
|
417
417
|
placeHolderText: J.DATE_PICKER.local.placeHolderText,
|
|
418
418
|
calendarLocale: ce.EN
|
|
419
419
|
}, j = H === ce.HE ? Dt : It, K = (F) => {
|
|
420
420
|
o(F), E(F);
|
|
421
421
|
};
|
|
422
422
|
return /* @__PURE__ */ l(xt, { theme: t, children: /* @__PURE__ */ B(At, { utils: kt, locale: j, children: [
|
|
423
|
-
|
|
423
|
+
w && /* @__PURE__ */ l(
|
|
424
424
|
Ye,
|
|
425
425
|
{
|
|
426
426
|
variant: d,
|
|
@@ -432,7 +432,7 @@ const ns = (e) => {
|
|
|
432
432
|
..._
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
|
-
!
|
|
435
|
+
!w && /* @__PURE__ */ l(
|
|
436
436
|
ln,
|
|
437
437
|
{
|
|
438
438
|
variant: d,
|
|
@@ -456,13 +456,13 @@ const ns = (e) => {
|
|
|
456
456
|
}
|
|
457
457
|
})
|
|
458
458
|
), $i = (e) => {
|
|
459
|
-
const n = zi(), [t, i] = fe.useState(null), { isSelectionEnabled: o, onCancelDraw: r, onStartDraw: d, onReset: u } = e,
|
|
460
|
-
i(
|
|
459
|
+
const n = zi(), [t, i] = fe.useState(null), { isSelectionEnabled: o, onCancelDraw: r, onStartDraw: d, onReset: u } = e, m = (w) => {
|
|
460
|
+
i(w.currentTarget);
|
|
461
461
|
}, E = () => {
|
|
462
462
|
i(null);
|
|
463
463
|
};
|
|
464
464
|
return o ? /* @__PURE__ */ l(Ze, { content: "Cancel the ongoing draw", align: "bottomLeft", children: /* @__PURE__ */ l(Me, { className: n.drawingButton, raised: !0, onClick: r, children: "Cancel Draw" }) }) : /* @__PURE__ */ B(ae, { position: "relative", children: [
|
|
465
|
-
/* @__PURE__ */ l(Ze, { content: "draw an Area of interest to limit the search", align: "bottomLeft", children: /* @__PURE__ */ l(Me, { className: n.drawingButton, raised: !0, onClick:
|
|
465
|
+
/* @__PURE__ */ l(Ze, { content: "draw an Area of interest to limit the search", align: "bottomLeft", children: /* @__PURE__ */ l(Me, { className: n.drawingButton, raised: !0, onClick: m, children: "Draw AOI" }) }),
|
|
466
466
|
/* @__PURE__ */ B(
|
|
467
467
|
wn,
|
|
468
468
|
{
|
|
@@ -531,9 +531,9 @@ const et = 5, tt = 2, $t = Pe(null), Wi = $t.Provider, pt = 35, gt = 32, Ui = 10
|
|
|
531
531
|
}, [r, e.center, e.projection]), O(() => {
|
|
532
532
|
r.getView().setZoom(e.zoom ?? Ui);
|
|
533
533
|
}, [r, e.zoom, e.projection]);
|
|
534
|
-
const d = (u,
|
|
535
|
-
|
|
536
|
-
|
|
534
|
+
const d = (u, m) => {
|
|
535
|
+
m.getControls().forEach((w) => {
|
|
536
|
+
w instanceof u && m.removeControl(w);
|
|
537
537
|
});
|
|
538
538
|
};
|
|
539
539
|
return O(() => {
|
|
@@ -613,8 +613,8 @@ const et = 5, tt = 2, $t = Pe(null), Wi = $t.Provider, pt = 35, gt = 32, Ui = 10
|
|
|
613
613
|
const o = new Vn(i);
|
|
614
614
|
t.addInteraction(o);
|
|
615
615
|
const r = (d) => {
|
|
616
|
-
const
|
|
617
|
-
n == null || n(
|
|
616
|
+
const m = new Rt().writeGeometryObject(d.feature.getGeometry());
|
|
617
|
+
n == null || n(m);
|
|
618
618
|
};
|
|
619
619
|
return o.on("drawend", r), () => {
|
|
620
620
|
o.un("drawend", r), t.removeInteraction(o);
|
|
@@ -658,7 +658,7 @@ const ar = (e) => {
|
|
|
658
658
|
}
|
|
659
659
|
})
|
|
660
660
|
), is = (e) => {
|
|
661
|
-
var
|
|
661
|
+
var m;
|
|
662
662
|
const [n, t] = A(), [i, o] = A(), r = cr(), d = (E) => {
|
|
663
663
|
o(E), t(void 0), e.handlePolygonSelected(E);
|
|
664
664
|
}, u = () => {
|
|
@@ -676,7 +676,7 @@ const ar = (e) => {
|
|
|
676
676
|
isSelectionEnabled: n !== void 0
|
|
677
677
|
}
|
|
678
678
|
),
|
|
679
|
-
(
|
|
679
|
+
(m = e.filters) == null ? void 0 : m.map((E, w) => /* @__PURE__ */ l("div", { className: r.filtersMargin, children: E }, w))
|
|
680
680
|
] }),
|
|
681
681
|
/* @__PURE__ */ l(Xe, { color: "red", className: `${r.contentContainer}`, children: e.children })
|
|
682
682
|
] }),
|
|
@@ -684,8 +684,8 @@ const ar = (e) => {
|
|
|
684
684
|
] });
|
|
685
685
|
};
|
|
686
686
|
function dr(e) {
|
|
687
|
-
const { headCells: n, order: t, orderBy: i, onRequestSort: o, isCollapseable: r } = e, d = (u) => (
|
|
688
|
-
o(
|
|
687
|
+
const { headCells: n, order: t, orderBy: i, onRequestSort: o, isCollapseable: r } = e, d = (u) => (m) => {
|
|
688
|
+
o(m, u);
|
|
689
689
|
};
|
|
690
690
|
return /* @__PURE__ */ l($n, { children: /* @__PURE__ */ B(Oe, { children: [
|
|
691
691
|
r && /* @__PURE__ */ l(Te, {}),
|
|
@@ -721,7 +721,7 @@ const ur = Nt(
|
|
|
721
721
|
"KeyboardArrowUp"
|
|
722
722
|
);
|
|
723
723
|
function mr(e) {
|
|
724
|
-
const { cellsMetadata: n, isRowSelected: t, item: i, onRowSelected: o, rowIndex: r, isCollapseable: d, collapsedElement: u } = e, [
|
|
724
|
+
const { cellsMetadata: n, isRowSelected: t, item: i, onRowSelected: o, rowIndex: r, isCollapseable: d, collapsedElement: u } = e, [m, E] = A(!1), w = n.length;
|
|
725
725
|
return /* @__PURE__ */ B(oe, { children: [
|
|
726
726
|
/* @__PURE__ */ B(Oe, { hover: !0, selected: t, onClick: () => {
|
|
727
727
|
o == null || o(r);
|
|
@@ -732,9 +732,9 @@ function mr(e) {
|
|
|
732
732
|
"aria-label": "expand row",
|
|
733
733
|
size: "small",
|
|
734
734
|
onClick: (_) => {
|
|
735
|
-
_.stopPropagation(), E(!
|
|
735
|
+
_.stopPropagation(), E(!m);
|
|
736
736
|
},
|
|
737
|
-
children:
|
|
737
|
+
children: m ? /* @__PURE__ */ l(hr, {}) : /* @__PURE__ */ l(ur, {})
|
|
738
738
|
}
|
|
739
739
|
) }),
|
|
740
740
|
n.map((_) => /* @__PURE__ */ l(
|
|
@@ -747,7 +747,7 @@ function mr(e) {
|
|
|
747
747
|
_.id + r.toString()
|
|
748
748
|
))
|
|
749
749
|
] }),
|
|
750
|
-
d && /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */ l(Te, { style: { paddingBottom: 0, paddingTop: 0 }, colSpan:
|
|
750
|
+
d && /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */ l(Te, { style: { paddingBottom: 0, paddingTop: 0 }, colSpan: w + 1, children: /* @__PURE__ */ l(pn, { in: m, unmountOnExit: !0, timeout: "auto", children: u == null ? void 0 : u(i) }) }) })
|
|
751
751
|
] });
|
|
752
752
|
}
|
|
753
753
|
function rs(e) {
|
|
@@ -755,9 +755,9 @@ function rs(e) {
|
|
|
755
755
|
cellsMetadata: r,
|
|
756
756
|
items: d,
|
|
757
757
|
onRequestSort: u,
|
|
758
|
-
onRowSelected:
|
|
758
|
+
onRowSelected: m,
|
|
759
759
|
isCollapseable: E,
|
|
760
|
-
collapsedElement:
|
|
760
|
+
collapsedElement: w,
|
|
761
761
|
isDense: M,
|
|
762
762
|
page: _,
|
|
763
763
|
rowsPerPage: k,
|
|
@@ -788,9 +788,9 @@ function rs(e) {
|
|
|
788
788
|
rowIndex: U,
|
|
789
789
|
isCollapseable: E,
|
|
790
790
|
cellsMetadata: r,
|
|
791
|
-
collapsedElement:
|
|
791
|
+
collapsedElement: w,
|
|
792
792
|
isRowSelected: !1,
|
|
793
|
-
onRowSelected:
|
|
793
|
+
onRowSelected: m
|
|
794
794
|
},
|
|
795
795
|
U
|
|
796
796
|
)),
|
|
@@ -837,22 +837,22 @@ const gr = (e) => {
|
|
|
837
837
|
if (d) {
|
|
838
838
|
const u = r.cartesianToCartographic(d);
|
|
839
839
|
if (t.current) {
|
|
840
|
-
let
|
|
840
|
+
let m = "";
|
|
841
841
|
switch (e.projection) {
|
|
842
842
|
case he.WEB_MERCATOR: {
|
|
843
|
-
const
|
|
844
|
-
|
|
843
|
+
const w = new ii(r).project(u);
|
|
844
|
+
m = `Mercator: ${w.y.toFixed(tt)}m, ${w.x.toFixed(
|
|
845
845
|
tt
|
|
846
846
|
)}m`, t.current.style.width = "220px";
|
|
847
847
|
break;
|
|
848
848
|
}
|
|
849
849
|
case he.WGS84: {
|
|
850
850
|
const E = le.toDegrees(u.longitude).toFixed(et);
|
|
851
|
-
|
|
851
|
+
m = `WGS84: ${le.toDegrees(u.latitude).toFixed(et)}°N ${E}°E`, t.current.style.width = "200px";
|
|
852
852
|
break;
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
t.current.innerHTML =
|
|
855
|
+
t.current.innerHTML = m;
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
858
|
}, [i, t, n, e.projection]), /* @__PURE__ */ l("div", { className: "trackerPosition", ref: t });
|
|
@@ -895,11 +895,11 @@ const Ke = [
|
|
|
895
895
|
barWidth: void 0,
|
|
896
896
|
distanceLabel: void 0,
|
|
897
897
|
lastLegendUpdate: n.lastLegendUpdate
|
|
898
|
-
}, u = new oi(),
|
|
899
|
-
if (
|
|
898
|
+
}, u = new oi(), m = new Date().getTime();
|
|
899
|
+
if (m < d.lastLegendUpdate + 250)
|
|
900
900
|
return;
|
|
901
|
-
d.lastLegendUpdate =
|
|
902
|
-
const E = e.scene.canvas.clientWidth,
|
|
901
|
+
d.lastLegendUpdate = m;
|
|
902
|
+
const E = e.scene.canvas.clientWidth, w = e.scene.canvas.clientHeight, M = e.scene.camera.getPickRay(new Se(E / 2 | 0, w - 1)), _ = e.scene.camera.getPickRay(new Se(1 + E / 2 | 0, w - 1)), k = e.scene.globe, H = k.pick(M, e.scene), j = k.pick(_, e.scene);
|
|
903
903
|
if (!H || !j)
|
|
904
904
|
return;
|
|
905
905
|
const K = k.ellipsoid.cartesianToCartographic(H), F = k.ellipsoid.cartesianToCartographic(j);
|
|
@@ -920,16 +920,16 @@ const Ke = [
|
|
|
920
920
|
lastLegendUpdate: -1
|
|
921
921
|
});
|
|
922
922
|
O(() => {
|
|
923
|
-
const r = (
|
|
923
|
+
const r = (m) => {
|
|
924
924
|
fr(n, t, i, e.locale);
|
|
925
|
-
}, d = new ri(), u = (
|
|
925
|
+
}, d = new ri(), u = (m) => {
|
|
926
926
|
n.scene.globe.tilesLoaded && (r(new MouseEvent("mouse")), d.removeAll());
|
|
927
927
|
};
|
|
928
928
|
return d.add(n.scene.globe.tileLoadProgressEvent, u), n.camera.moveEnd.addEventListener(r), () => {
|
|
929
929
|
try {
|
|
930
930
|
Q(n, "_cesiumWidget") != null && n.camera.moveEnd.removeEventListener(r);
|
|
931
|
-
} catch (
|
|
932
|
-
console.log('CESIUM camera "moveEnd" remove listener failed',
|
|
931
|
+
} catch (m) {
|
|
932
|
+
console.log('CESIUM camera "moveEnd" remove listener failed', m);
|
|
933
933
|
}
|
|
934
934
|
};
|
|
935
935
|
}, [n, e.locale, t]);
|
|
@@ -969,9 +969,9 @@ const yt = (e, n) => {
|
|
|
969
969
|
if (d === null)
|
|
970
970
|
break;
|
|
971
971
|
if (d !== o) {
|
|
972
|
-
let u = r,
|
|
973
|
-
for (;
|
|
974
|
-
r = u + (
|
|
972
|
+
let u = r, m = r + i;
|
|
973
|
+
for (; m - u > e; )
|
|
974
|
+
r = u + (m - u) / 2, yt(r, n) === d ? u = r : m = r;
|
|
975
975
|
t.push({
|
|
976
976
|
level: d,
|
|
977
977
|
height: Math.round(r)
|
|
@@ -984,23 +984,23 @@ const yt = (e, n) => {
|
|
|
984
984
|
return O(() => {
|
|
985
985
|
const r = () => {
|
|
986
986
|
const d = n.camera, u = 0.5;
|
|
987
|
-
let
|
|
987
|
+
let m = 0;
|
|
988
988
|
switch (n.scene.mode) {
|
|
989
989
|
case ne.SCENE3D:
|
|
990
|
-
|
|
990
|
+
m = n.scene.mapProjection.ellipsoid.cartesianToCartographic(d.positionWC).height;
|
|
991
991
|
break;
|
|
992
992
|
case ne.SCENE2D:
|
|
993
|
-
|
|
993
|
+
m = (d.frustum.right - d.frustum.left) * u;
|
|
994
994
|
break;
|
|
995
995
|
case ne.COLUMBUS_VIEW:
|
|
996
|
-
|
|
996
|
+
m = d.position.z;
|
|
997
997
|
break;
|
|
998
998
|
default:
|
|
999
|
-
|
|
999
|
+
m = 0;
|
|
1000
1000
|
break;
|
|
1001
1001
|
}
|
|
1002
1002
|
if (o.length > 0) {
|
|
1003
|
-
const E = o.reduce((
|
|
1003
|
+
const E = o.reduce((w, M) => Math.abs(M.height - m) < Math.abs(w.height - m) ? M : w);
|
|
1004
1004
|
i(E.level);
|
|
1005
1005
|
}
|
|
1006
1006
|
};
|
|
@@ -1061,13 +1061,13 @@ const br = Ie(
|
|
|
1061
1061
|
), Tr = (e) => {
|
|
1062
1062
|
const n = me(), { baseMaps: t } = e, [i, o] = A(" "), [r, d] = A(), u = br();
|
|
1063
1063
|
O(() => {
|
|
1064
|
-
const E = t == null ? void 0 : t.maps.find((
|
|
1064
|
+
const E = t == null ? void 0 : t.maps.find((w) => w.isCurrent);
|
|
1065
1065
|
E && (d(E), o(E.title !== void 0 ? E.title : " "));
|
|
1066
1066
|
}, [t]);
|
|
1067
|
-
const
|
|
1068
|
-
var
|
|
1067
|
+
const m = (E) => {
|
|
1068
|
+
var w, M;
|
|
1069
1069
|
if (t) {
|
|
1070
|
-
(
|
|
1070
|
+
(w = n.layersManager) == null || w.removeBaseMapLayers();
|
|
1071
1071
|
const _ = t.maps.find((k) => k.id === E);
|
|
1072
1072
|
_ && ((M = n.layersManager) == null || M.setBaseMapLayers(_), d(_), t.maps.forEach((k) => {
|
|
1073
1073
|
k.isCurrent = _ === k;
|
|
@@ -1089,22 +1089,22 @@ const br = Ie(
|
|
|
1089
1089
|
o((r == null ? void 0 : r.title) !== void 0 ? r.title : " ");
|
|
1090
1090
|
},
|
|
1091
1091
|
onClick: () => {
|
|
1092
|
-
|
|
1092
|
+
m(E.id);
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
) }, E.id)) })
|
|
1096
1096
|
] });
|
|
1097
1097
|
};
|
|
1098
1098
|
const qe = "ic_settings_24px", _r = (e) => {
|
|
1099
|
-
const [n, t] = A(!1), { sceneModes: i, baseMaps: o, locale: r } = e, d = Ee(null), u = Q(r, "MAP_SETTINGS_DIALOG_TITLE") ?? "Map Settings",
|
|
1099
|
+
const [n, t] = A(!1), { sceneModes: i, baseMaps: o, locale: r } = e, d = Ee(null), u = Q(r, "MAP_SETTINGS_DIALOG_TITLE") ?? "Map Settings", m = Q(r, "MAP_SETTINGS_SCENE_MODE_TITLE") ?? "Scene Mode", E = Q(r, "MAP_SETTINGS_BASE_MAP_TITLE") ?? "Base Map";
|
|
1100
1100
|
return O(() => {
|
|
1101
|
-
const
|
|
1101
|
+
const w = (M) => {
|
|
1102
1102
|
var H;
|
|
1103
1103
|
const _ = M.target, k = Q(d, "current");
|
|
1104
|
-
k && !k.contains(_) && _.id !== qe && ((H = _.parentElement) == null ? void 0 : H.id) !== qe && (document.removeEventListener("click",
|
|
1104
|
+
k && !k.contains(_) && _.id !== qe && ((H = _.parentElement) == null ? void 0 : H.id) !== qe && (document.removeEventListener("click", w, !1), t(!1));
|
|
1105
1105
|
};
|
|
1106
|
-
return document.addEventListener("click",
|
|
1107
|
-
document.removeEventListener("click",
|
|
1106
|
+
return document.addEventListener("click", w, !1), () => {
|
|
1107
|
+
document.removeEventListener("click", w, !1);
|
|
1108
1108
|
};
|
|
1109
1109
|
}), /* @__PURE__ */ B(oe, { children: [
|
|
1110
1110
|
/* @__PURE__ */ l(
|
|
@@ -1126,7 +1126,7 @@ const qe = "ic_settings_24px", _r = (e) => {
|
|
|
1126
1126
|
children: [
|
|
1127
1127
|
/* @__PURE__ */ l(Tn, { children: u }),
|
|
1128
1128
|
/* @__PURE__ */ B(_n, { children: [
|
|
1129
|
-
/* @__PURE__ */ l("h4", { className: "sectionLabel", children:
|
|
1129
|
+
/* @__PURE__ */ l("h4", { className: "sectionLabel", children: m }),
|
|
1130
1130
|
/* @__PURE__ */ l(ae, { className: "mapScenesContainer", children: /* @__PURE__ */ l(wr, { sceneModes: i }) }),
|
|
1131
1131
|
/* @__PURE__ */ l(ae, { className: "baseMapsContainer", children: o && /* @__PURE__ */ B(oe, { children: [
|
|
1132
1132
|
/* @__PURE__ */ l("h4", { className: "sectionLabel", children: E }),
|
|
@@ -1233,26 +1233,26 @@ const Sr = /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", enabl
|
|
|
1233
1233
|
console.error("Could not determine image transparency. Error => ", o), i(o);
|
|
1234
1234
|
}
|
|
1235
1235
|
})), xe = (e, n) => {
|
|
1236
|
-
const { west: t, east: i, north: o, south: r } = e, { west: d, east: u, north:
|
|
1237
|
-
return t >= d && i <= u && o <=
|
|
1236
|
+
const { west: t, east: i, north: o, south: r } = e, { west: d, east: u, north: m, south: E } = n;
|
|
1237
|
+
return t >= d && i <= u && o <= m && r >= E;
|
|
1238
1238
|
}, Ve = 3, Be = "hasTransparency";
|
|
1239
1239
|
function st(e, n, t, i, o) {
|
|
1240
1240
|
return setTimeout(() => {
|
|
1241
1241
|
var u;
|
|
1242
1242
|
const r = (u = this.layerListInstance.find(
|
|
1243
1243
|
/* eslint-disable */
|
|
1244
|
-
(
|
|
1245
|
-
var E,
|
|
1246
|
-
return ((E =
|
|
1244
|
+
(m) => {
|
|
1245
|
+
var E, w;
|
|
1246
|
+
return ((E = m._imageryProvider._resource) == null ? void 0 : E._url) === ((w = this._resource) == null ? void 0 : w._url);
|
|
1247
1247
|
}
|
|
1248
1248
|
/* eslint-enable */
|
|
1249
1249
|
)) == null ? void 0 : u.meta, d = Q(r, Be) === !0;
|
|
1250
|
-
this.tileTransparencyCheckedCounter < Ve && !d && kr(o == null ? void 0 : o.url, this).then((
|
|
1250
|
+
this.tileTransparencyCheckedCounter < Ve && !d && kr(o == null ? void 0 : o.url, this).then((m) => {
|
|
1251
1251
|
var E;
|
|
1252
1252
|
(E = this.mapViewer.layersManager) == null || E.addMetaToLayer(
|
|
1253
|
-
{ [Be]:
|
|
1253
|
+
{ [Be]: m },
|
|
1254
1254
|
/* eslint-disable */
|
|
1255
|
-
(
|
|
1255
|
+
(w) => w._imageryProvider._resource._url === this._resource._url
|
|
1256
1256
|
);
|
|
1257
1257
|
});
|
|
1258
1258
|
}, 0), e(n, t, i, o);
|
|
@@ -1421,19 +1421,19 @@ class Rr {
|
|
|
1421
1421
|
let i;
|
|
1422
1422
|
return t && (i = (o = this.mapViewer.imageryLayers.pickImageryLayers(t, this.mapViewer.scene)) == null ? void 0 : o.filter((r) => !Q(r.meta, "parentBasetMapId"))), i;
|
|
1423
1423
|
}
|
|
1424
|
-
findLayerByPOI(n, t) {
|
|
1424
|
+
findLayerByPOI(n, t, i = !0) {
|
|
1425
1425
|
if (this.layerManagerFootprintMetaFieldPath) {
|
|
1426
|
-
const
|
|
1427
|
-
return this.layers.filter((
|
|
1428
|
-
const
|
|
1429
|
-
return
|
|
1426
|
+
const o = Ir(this.mapViewer, n, t);
|
|
1427
|
+
return this.layers.filter((u) => !Q(u.meta, "parentBasetMapId")).filter((u) => {
|
|
1428
|
+
const m = Q(u.meta, this.layerManagerFootprintMetaFieldPath);
|
|
1429
|
+
return m !== void 0 ? Si(o.geometry, {
|
|
1430
1430
|
type: "Feature",
|
|
1431
1431
|
properties: {},
|
|
1432
|
-
geometry:
|
|
1433
|
-
}) &&
|
|
1434
|
-
}).sort((
|
|
1435
|
-
var
|
|
1436
|
-
return ((
|
|
1432
|
+
geometry: m
|
|
1433
|
+
}) && (i ? u.show : !0) : (console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint", u.meta), !1);
|
|
1434
|
+
}).sort((u, m) => {
|
|
1435
|
+
var E, w;
|
|
1436
|
+
return ((E = m.meta) == null ? void 0 : E.zIndex) - ((w = u.meta) == null ? void 0 : w.zIndex);
|
|
1437
1437
|
});
|
|
1438
1438
|
} else
|
|
1439
1439
|
return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"), [];
|
|
@@ -1468,8 +1468,8 @@ class Rr {
|
|
|
1468
1468
|
this.layers.forEach((u) => {
|
|
1469
1469
|
var E;
|
|
1470
1470
|
if (!Q(u.meta, "parentBasetMapId")) {
|
|
1471
|
-
const
|
|
1472
|
-
u.meta.zIndex =
|
|
1471
|
+
const w = (E = u.meta) == null ? void 0 : E.zIndex;
|
|
1472
|
+
u.meta.zIndex = w >= r && w <= d && w !== t ? w + o : w === t ? i : w;
|
|
1473
1473
|
}
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
@@ -1489,11 +1489,11 @@ class Rr {
|
|
|
1489
1489
|
r.meta = { ...r.meta, relevantToExtent: !0 };
|
|
1490
1490
|
continue;
|
|
1491
1491
|
}
|
|
1492
|
-
const
|
|
1493
|
-
if (r !==
|
|
1492
|
+
const m = this.layers[u], E = ((t = m.meta) == null ? void 0 : t[Be]) === !0;
|
|
1493
|
+
if (r !== m)
|
|
1494
1494
|
if (d instanceof be) {
|
|
1495
1495
|
if (xe(i, r.rectangle))
|
|
1496
|
-
if (xe(i,
|
|
1496
|
+
if (xe(i, m.rectangle) && !E) {
|
|
1497
1497
|
r.meta = {
|
|
1498
1498
|
...r.meta ?? {},
|
|
1499
1499
|
relevantToExtent: !1
|
|
@@ -1504,11 +1504,11 @@ class Rr {
|
|
|
1504
1504
|
...r.meta ?? {},
|
|
1505
1505
|
relevantToExtent: !0
|
|
1506
1506
|
};
|
|
1507
|
-
if (xe(i,
|
|
1507
|
+
if (xe(i, m.rectangle) && !E) {
|
|
1508
1508
|
r.meta = { ...r.meta ?? {}, relevantToExtent: !1 };
|
|
1509
1509
|
break;
|
|
1510
1510
|
}
|
|
1511
|
-
if (xe(r.rectangle,
|
|
1511
|
+
if (xe(r.rectangle, m.rectangle)) {
|
|
1512
1512
|
if (r.meta = {
|
|
1513
1513
|
...r.meta ?? {},
|
|
1514
1514
|
relevantToExtent: E
|
|
@@ -1550,8 +1550,8 @@ const Zt = Pe(null), Br = Zt.Provider, me = () => {
|
|
|
1550
1550
|
throw new Error("map context is null, please check the provider");
|
|
1551
1551
|
return e;
|
|
1552
1552
|
}, ls = (e) => {
|
|
1553
|
-
var S, T,
|
|
1554
|
-
const n = Ee(null), [t, i] = A(), [o, r] = A(), [d, u] = A(), [
|
|
1553
|
+
var S, T, b, L, P, W, q, N;
|
|
1554
|
+
const n = Ee(null), [t, i] = A(), [o, r] = A(), [d, u] = A(), [m, E] = A(), [w, M] = A(), [_, k] = A(), H = Ee(), [j, K] = A(), [F, Y] = A([]), [U, x] = A(), [$, R] = A(!1), V = Ee(), [X, s] = A(void 0), [a, y] = A(!1), [c, f] = A(), h = {
|
|
1555
1555
|
fullscreenButton: !0,
|
|
1556
1556
|
timeline: !1,
|
|
1557
1557
|
animation: !1,
|
|
@@ -1694,12 +1694,12 @@ const Zt = Pe(null), Br = Zt.Provider, me = () => {
|
|
|
1694
1694
|
] }),
|
|
1695
1695
|
/* @__PURE__ */ B(ae, { className: "toolsContainer", children: [
|
|
1696
1696
|
d === !0 ? /* @__PURE__ */ l(gr, { projection: o }) : /* @__PURE__ */ l(oe, {}),
|
|
1697
|
-
|
|
1698
|
-
|
|
1697
|
+
m === !0 ? /* @__PURE__ */ l(Er, { locale: _ }) : /* @__PURE__ */ l(oe, {}),
|
|
1698
|
+
w === !0 ? /* @__PURE__ */ l(yr, { locale: _ }) : /* @__PURE__ */ l(oe, {})
|
|
1699
1699
|
] })
|
|
1700
1700
|
] }),
|
|
1701
1701
|
document.querySelector(".cesium-viewer")
|
|
1702
|
-
), [U, _, t, o, j, d,
|
|
1702
|
+
), [U, _, t, o, j, d, w, a]);
|
|
1703
1703
|
return /* @__PURE__ */ l(Kn, { className: "viewer", full: !0, ref: n, ...h, children: /* @__PURE__ */ B(Br, { value: t, children: [
|
|
1704
1704
|
/* @__PURE__ */ l(
|
|
1705
1705
|
Dr,
|
|
@@ -1708,14 +1708,14 @@ const Zt = Pe(null), Br = Zt.Provider, me = () => {
|
|
|
1708
1708
|
isOpen: a,
|
|
1709
1709
|
toggleSidebar: () => y(!a),
|
|
1710
1710
|
noLegendsText: (T = e.legends) == null ? void 0 : T.emptyText,
|
|
1711
|
-
legends: ((
|
|
1711
|
+
legends: ((b = e.legends) == null ? void 0 : b.legendsList) ?? F,
|
|
1712
1712
|
actionsTexts: (L = e.legends) == null ? void 0 : L.actionsTexts
|
|
1713
1713
|
}
|
|
1714
1714
|
),
|
|
1715
1715
|
e.children,
|
|
1716
1716
|
C(),
|
|
1717
1717
|
e.imageryContextMenu && $ && X && c && fe.cloneElement(e.imageryContextMenu, {
|
|
1718
|
-
data: (P = t == null ? void 0 : t.layersManager) == null ? void 0 : P.findLayerByPOI(X.x, X.y),
|
|
1718
|
+
data: (P = t == null ? void 0 : t.layersManager) == null ? void 0 : P.findLayerByPOI(X.x, X.y, !1),
|
|
1719
1719
|
position: {
|
|
1720
1720
|
x: X.x,
|
|
1721
1721
|
y: X.y
|
|
@@ -1750,8 +1750,8 @@ const Zt = Pe(null), Br = Zt.Provider, me = () => {
|
|
|
1750
1750
|
i.globe.depthTestAgainstTerrain = !0;
|
|
1751
1751
|
const o = Ge.fromCartesian(t.boundingSphere.center), r = e.heightFromGround ?? Fr;
|
|
1752
1752
|
if (r) {
|
|
1753
|
-
const d = ge.fromRadians(o.longitude, o.latitude, o.height), u = ge.fromRadians(o.longitude, o.latitude, o.height + r),
|
|
1754
|
-
t.modelMatrix = ci.fromTranslation(
|
|
1753
|
+
const d = ge.fromRadians(o.longitude, o.latitude, o.height), u = ge.fromRadians(o.longitude, o.latitude, o.height + r), m = ge.subtract(u, d, new ge());
|
|
1754
|
+
t.modelMatrix = ci.fromTranslation(m);
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
@@ -1798,8 +1798,8 @@ const Zt = Pe(null), Br = Zt.Provider, me = () => {
|
|
|
1798
1798
|
return /* @__PURE__ */ l(ze, { ...t, imageryProvider: new di(n) });
|
|
1799
1799
|
}, Hr = (e) => /* @__PURE__ */ l(Zn, { ...e }), gs = (e) => /* @__PURE__ */ l(Bt, { ...e }), Gr = (e) => /* @__PURE__ */ l(Bt, { ...e }), Vr = (e) => /* @__PURE__ */ l(Jn, { ...e }), zr = (e) => /* @__PURE__ */ l(Qn, { ...e }), $r = (e) => /* @__PURE__ */ l(ei, { ...e }), Wr = (e) => /* @__PURE__ */ l(ti, { ...e });
|
|
1800
1800
|
var ye = function() {
|
|
1801
|
-
var e =
|
|
1802
|
-
function i(s, a = new
|
|
1801
|
+
var e = p.Ellipsoid.WGS84, n, t = p.Material.fromType(p.Material.ColorType);
|
|
1802
|
+
function i(s, a = new p.Color(1, 1, 0, 0.5), y = new p.Color(1, 1, 1, 1)) {
|
|
1803
1803
|
this._scene = s.scene, t.uniforms.color = a, n = y, this._tooltip = {
|
|
1804
1804
|
setVisible: () => {
|
|
1805
1805
|
},
|
|
@@ -1808,7 +1808,7 @@ var ye = function() {
|
|
|
1808
1808
|
}, this._surfaces = [], this.initialiseHandlers(), this.enhancePrimitives();
|
|
1809
1809
|
}
|
|
1810
1810
|
i.prototype.initialiseHandlers = function() {
|
|
1811
|
-
var s = this._scene, a = this, y = new
|
|
1811
|
+
var s = this._scene, a = this, y = new p.ScreenSpaceEventHandler(s.canvas);
|
|
1812
1812
|
function c(h, v) {
|
|
1813
1813
|
if (a._handlersMuted != !0) {
|
|
1814
1814
|
var g = s.pick(v);
|
|
@@ -1817,20 +1817,20 @@ var ye = function() {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
y.setInputAction(function(h) {
|
|
1819
1819
|
c("leftClick", h.position);
|
|
1820
|
-
},
|
|
1820
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), y.setInputAction(function(h) {
|
|
1821
1821
|
c("leftDoubleClick", h.position);
|
|
1822
|
-
},
|
|
1822
|
+
}, p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
1823
1823
|
var f;
|
|
1824
1824
|
y.setInputAction(function(h) {
|
|
1825
1825
|
if (a._handlersMuted != !0) {
|
|
1826
1826
|
var v = s.pick(h.endPosition);
|
|
1827
1827
|
f && (!v || f != v.primitive) && (!(f.isDestroyed && f.isDestroyed()) && f.mouseOut(h.endPosition), f = null), v && v.primitive && (v = v.primitive, v.mouseOut && (f = v), v.mouseMove && v.mouseMove(h.endPosition));
|
|
1828
1828
|
}
|
|
1829
|
-
},
|
|
1829
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE), y.setInputAction(function(h) {
|
|
1830
1830
|
c("leftUp", h.position);
|
|
1831
|
-
},
|
|
1831
|
+
}, p.ScreenSpaceEventType.LEFT_UP), y.setInputAction(function(h) {
|
|
1832
1832
|
c("leftDown", h.position);
|
|
1833
|
-
},
|
|
1833
|
+
}, p.ScreenSpaceEventType.LEFT_DOWN);
|
|
1834
1834
|
}, i.prototype.setListener = function(s, a, y) {
|
|
1835
1835
|
s[a] = y;
|
|
1836
1836
|
}, i.prototype.muteHandlers = function(s) {
|
|
@@ -1858,25 +1858,25 @@ var ye = function() {
|
|
|
1858
1858
|
this._editedSurface && !this._editedSurface.isDestroyed() && this._editedSurface.setEditMode(!1), this._editedSurface = s;
|
|
1859
1859
|
};
|
|
1860
1860
|
var o = {
|
|
1861
|
-
ellipsoid:
|
|
1861
|
+
ellipsoid: p.Ellipsoid.WGS84,
|
|
1862
1862
|
textureRotationAngle: 0,
|
|
1863
1863
|
height: 0,
|
|
1864
1864
|
asynchronous: !0,
|
|
1865
1865
|
show: !0,
|
|
1866
1866
|
debugShowBoundingVolume: !1
|
|
1867
1867
|
}, r = R(o, {
|
|
1868
|
-
appearance: new
|
|
1868
|
+
appearance: new p.EllipsoidSurfaceAppearance({
|
|
1869
1869
|
aboveGround: !1
|
|
1870
1870
|
}),
|
|
1871
1871
|
material: t,
|
|
1872
1872
|
granularity: Math.PI / 180
|
|
1873
|
-
}), d = R(o, {}), u = R(o, {}),
|
|
1873
|
+
}), d = R(o, {}), u = R(o, {}), m = R(o, {}), E = R(r, {
|
|
1874
1874
|
rotation: 0
|
|
1875
|
-
}),
|
|
1875
|
+
}), w = R(o, {
|
|
1876
1876
|
width: 5,
|
|
1877
1877
|
geodesic: !0,
|
|
1878
1878
|
granularity: 1e4,
|
|
1879
|
-
appearance: new
|
|
1879
|
+
appearance: new p.PolylineMaterialAppearance({
|
|
1880
1880
|
aboveGround: !1
|
|
1881
1881
|
}),
|
|
1882
1882
|
material: t
|
|
@@ -1890,33 +1890,33 @@ var ye = function() {
|
|
|
1890
1890
|
}, s.prototype.getAttribute = function(a) {
|
|
1891
1891
|
return this[a];
|
|
1892
1892
|
}, s.prototype.update = function(a, y, c) {
|
|
1893
|
-
if (!
|
|
1894
|
-
throw new
|
|
1895
|
-
if (!
|
|
1896
|
-
throw new
|
|
1893
|
+
if (!p.defined(this.ellipsoid))
|
|
1894
|
+
throw new p.DeveloperError("this.ellipsoid must be defined.");
|
|
1895
|
+
if (!p.defined(this.appearance))
|
|
1896
|
+
throw new p.DeveloperError("this.material must be defined.");
|
|
1897
1897
|
if (this.granularity < 0)
|
|
1898
|
-
throw new
|
|
1899
|
-
if (this.show && !(!this._createPrimitive && !
|
|
1898
|
+
throw new p.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");
|
|
1899
|
+
if (this.show && !(!this._createPrimitive && !p.defined(this._primitive))) {
|
|
1900
1900
|
if (this._createPrimitive || this._ellipsoid !== this.ellipsoid || this._granularity !== this.granularity || this._height !== this.height || this._textureRotationAngle !== this.textureRotationAngle || this._id !== this.id) {
|
|
1901
1901
|
var f = this.getGeometry();
|
|
1902
1902
|
if (!f)
|
|
1903
1903
|
return;
|
|
1904
|
-
this._createPrimitive = !1, this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._textureRotationAngle = this.textureRotationAngle, this._id = this.id, this._primitive = this._primitive && this._primitive.destroy(), this._primitive = new
|
|
1905
|
-
geometryInstances: new
|
|
1904
|
+
this._createPrimitive = !1, this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._textureRotationAngle = this.textureRotationAngle, this._id = this.id, this._primitive = this._primitive && this._primitive.destroy(), this._primitive = new p.Primitive({
|
|
1905
|
+
geometryInstances: new p.GeometryInstance({
|
|
1906
1906
|
geometry: f,
|
|
1907
1907
|
id: this.id,
|
|
1908
1908
|
pickPrimitive: this
|
|
1909
1909
|
}),
|
|
1910
1910
|
appearance: this.appearance,
|
|
1911
1911
|
asynchronous: this.asynchronous
|
|
1912
|
-
}), this._outlinePolygon = this._outlinePolygon && this._outlinePolygon.destroy(), this.strokeColor && this.getOutlineGeometry && (this._outlinePolygon = new
|
|
1913
|
-
geometryInstances: new
|
|
1912
|
+
}), this._outlinePolygon = this._outlinePolygon && this._outlinePolygon.destroy(), this.strokeColor && this.getOutlineGeometry && (this._outlinePolygon = new p.Primitive({
|
|
1913
|
+
geometryInstances: new p.GeometryInstance({
|
|
1914
1914
|
geometry: this.getOutlineGeometry(),
|
|
1915
1915
|
attributes: {
|
|
1916
|
-
color:
|
|
1916
|
+
color: p.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)
|
|
1917
1917
|
}
|
|
1918
1918
|
}),
|
|
1919
|
-
appearance: new
|
|
1919
|
+
appearance: new p.PerInstanceColorAppearance({
|
|
1920
1920
|
flat: !0,
|
|
1921
1921
|
renderState: {
|
|
1922
1922
|
depthTest: {
|
|
@@ -1935,15 +1935,15 @@ var ye = function() {
|
|
|
1935
1935
|
}, s.prototype.isDestroyed = function() {
|
|
1936
1936
|
return !1;
|
|
1937
1937
|
}, s.prototype.destroy = function() {
|
|
1938
|
-
return this._primitive = this._primitive && this._primitive.destroy(),
|
|
1938
|
+
return this._primitive = this._primitive && this._primitive.destroy(), p.destroyObject(this);
|
|
1939
1939
|
}, s.prototype.setStrokeStyle = function(a, y) {
|
|
1940
1940
|
(!this.strokeColor || !this.strokeColor.equals(a) || this.strokeWidth != y) && (this._createPrimitive = !0, this.strokeColor = a, this.strokeWidth = y);
|
|
1941
1941
|
}, s;
|
|
1942
1942
|
}();
|
|
1943
1943
|
i.ExtentPrimitive = function() {
|
|
1944
1944
|
function s(a) {
|
|
1945
|
-
if (!
|
|
1946
|
-
throw new
|
|
1945
|
+
if (!p.defined(a.extent))
|
|
1946
|
+
throw new p.DeveloperError("Extent is required");
|
|
1947
1947
|
a = R(a, r), this.initialiseOptions(a), this.setExtent(a.extent);
|
|
1948
1948
|
}
|
|
1949
1949
|
return s.prototype = new M(), s.prototype.setExtent = function(a) {
|
|
@@ -1951,17 +1951,17 @@ var ye = function() {
|
|
|
1951
1951
|
}, s.prototype.getExtent = function() {
|
|
1952
1952
|
return this.getAttribute("extent");
|
|
1953
1953
|
}, s.prototype.getGeometry = function() {
|
|
1954
|
-
if (
|
|
1955
|
-
return new
|
|
1954
|
+
if (p.defined(this.extent))
|
|
1955
|
+
return new p.RectangleGeometry({
|
|
1956
1956
|
rectangle: this.extent,
|
|
1957
1957
|
height: this.height,
|
|
1958
|
-
vertexFormat:
|
|
1958
|
+
vertexFormat: p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
1959
1959
|
stRotation: this.textureRotationAngle,
|
|
1960
1960
|
ellipsoid: this.ellipsoid,
|
|
1961
1961
|
granularity: this.granularity
|
|
1962
1962
|
});
|
|
1963
1963
|
}, s.prototype.getOutlineGeometry = function() {
|
|
1964
|
-
return new
|
|
1964
|
+
return new p.RectangleOutlineGeometry({
|
|
1965
1965
|
rectangle: this.extent
|
|
1966
1966
|
});
|
|
1967
1967
|
}, s;
|
|
@@ -1974,24 +1974,24 @@ var ye = function() {
|
|
|
1974
1974
|
}, s.prototype.getPositions = function() {
|
|
1975
1975
|
return this.getAttribute("positions");
|
|
1976
1976
|
}, s.prototype.getGeometry = function() {
|
|
1977
|
-
if (!(!
|
|
1978
|
-
return
|
|
1977
|
+
if (!(!p.defined(this.positions) || this.positions.length < 3))
|
|
1978
|
+
return p.PolygonGeometry.fromPositions({
|
|
1979
1979
|
positions: this.positions,
|
|
1980
1980
|
height: this.height,
|
|
1981
|
-
vertexFormat:
|
|
1981
|
+
vertexFormat: p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
1982
1982
|
stRotation: this.textureRotationAngle,
|
|
1983
1983
|
ellipsoid: this.ellipsoid,
|
|
1984
1984
|
granularity: this.granularity
|
|
1985
1985
|
});
|
|
1986
1986
|
}, s.prototype.getOutlineGeometry = function() {
|
|
1987
|
-
return
|
|
1987
|
+
return p.PolygonOutlineGeometry.fromPositions({
|
|
1988
1988
|
positions: this.getPositions()
|
|
1989
1989
|
});
|
|
1990
1990
|
}, s;
|
|
1991
1991
|
}(), i.CirclePrimitive = function() {
|
|
1992
1992
|
function s(a) {
|
|
1993
|
-
if (!(
|
|
1994
|
-
throw new
|
|
1993
|
+
if (!(p.defined(a.center) && p.defined(a.radius)))
|
|
1994
|
+
throw new p.DeveloperError("Center and radius are required");
|
|
1995
1995
|
a = R(a, r), this.initialiseOptions(a), this.setRadius(a.radius);
|
|
1996
1996
|
}
|
|
1997
1997
|
return s.prototype = new M(), s.prototype.setCenter = function(a) {
|
|
@@ -2003,26 +2003,26 @@ var ye = function() {
|
|
|
2003
2003
|
}, s.prototype.getRadius = function() {
|
|
2004
2004
|
return this.getAttribute("radius");
|
|
2005
2005
|
}, s.prototype.getGeometry = function() {
|
|
2006
|
-
if (
|
|
2007
|
-
return new
|
|
2006
|
+
if (p.defined(this.center) && p.defined(this.radius))
|
|
2007
|
+
return new p.CircleGeometry({
|
|
2008
2008
|
center: this.center,
|
|
2009
2009
|
radius: this.radius,
|
|
2010
2010
|
height: this.height,
|
|
2011
|
-
vertexFormat:
|
|
2011
|
+
vertexFormat: p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
2012
2012
|
stRotation: this.textureRotationAngle,
|
|
2013
2013
|
ellipsoid: this.ellipsoid,
|
|
2014
2014
|
granularity: this.granularity
|
|
2015
2015
|
});
|
|
2016
2016
|
}, s.prototype.getOutlineGeometry = function() {
|
|
2017
|
-
return new
|
|
2017
|
+
return new p.CircleOutlineGeometry({
|
|
2018
2018
|
center: this.getCenter(),
|
|
2019
2019
|
radius: this.getRadius()
|
|
2020
2020
|
});
|
|
2021
2021
|
}, s;
|
|
2022
2022
|
}(), i.EllipsePrimitive = function() {
|
|
2023
2023
|
function s(a) {
|
|
2024
|
-
if (!(
|
|
2025
|
-
throw new
|
|
2024
|
+
if (!(p.defined(a.center) && p.defined(a.semiMajorAxis) && p.defined(a.semiMinorAxis)))
|
|
2025
|
+
throw new p.DeveloperError("Center and semi major and semi minor axis are required");
|
|
2026
2026
|
a = R(a, E), this.initialiseOptions(a);
|
|
2027
2027
|
}
|
|
2028
2028
|
return s.prototype = new M(), s.prototype.setCenter = function(a) {
|
|
@@ -2042,20 +2042,20 @@ var ye = function() {
|
|
|
2042
2042
|
}, s.prototype.getRotation = function() {
|
|
2043
2043
|
return this.getAttribute("rotation");
|
|
2044
2044
|
}, s.prototype.getGeometry = function() {
|
|
2045
|
-
if (
|
|
2046
|
-
return new
|
|
2045
|
+
if (p.defined(this.center) && p.defined(this.semiMajorAxis) && p.defined(this.semiMinorAxis))
|
|
2046
|
+
return new p.EllipseGeometry({
|
|
2047
2047
|
ellipsoid: this.ellipsoid,
|
|
2048
2048
|
center: this.center,
|
|
2049
2049
|
semiMajorAxis: this.semiMajorAxis,
|
|
2050
2050
|
semiMinorAxis: this.semiMinorAxis,
|
|
2051
2051
|
rotation: this.rotation,
|
|
2052
2052
|
height: this.height,
|
|
2053
|
-
vertexFormat:
|
|
2053
|
+
vertexFormat: p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
2054
2054
|
stRotation: this.textureRotationAngle,
|
|
2055
2055
|
granularity: this.granularity
|
|
2056
2056
|
});
|
|
2057
2057
|
}, s.prototype.getOutlineGeometry = function() {
|
|
2058
|
-
return new
|
|
2058
|
+
return new p.EllipseOutlineGeometry({
|
|
2059
2059
|
center: this.getCenter(),
|
|
2060
2060
|
semiMajorAxis: this.getSemiMajorAxis(),
|
|
2061
2061
|
semiMinorAxis: this.getSemiMinorAxis(),
|
|
@@ -2064,7 +2064,7 @@ var ye = function() {
|
|
|
2064
2064
|
}, s;
|
|
2065
2065
|
}(), i.PolylinePrimitive = function() {
|
|
2066
2066
|
function s(a) {
|
|
2067
|
-
a = R(a,
|
|
2067
|
+
a = R(a, w), this.initialiseOptions(a);
|
|
2068
2068
|
}
|
|
2069
2069
|
return s.prototype = new M(), s.prototype.setPositions = function(a) {
|
|
2070
2070
|
this.setAttribute("positions", a);
|
|
@@ -2079,12 +2079,12 @@ var ye = function() {
|
|
|
2079
2079
|
}, s.prototype.getGeodesic = function(a) {
|
|
2080
2080
|
return this.getAttribute("geodesic");
|
|
2081
2081
|
}, s.prototype.getGeometry = function() {
|
|
2082
|
-
if (!(!
|
|
2083
|
-
return new
|
|
2082
|
+
if (!(!p.defined(this.positions) || this.positions.length < 2))
|
|
2083
|
+
return new p.PolylineGeometry({
|
|
2084
2084
|
positions: this.positions,
|
|
2085
2085
|
height: this.height,
|
|
2086
2086
|
width: this.width < 1 ? 1 : this.width,
|
|
2087
|
-
vertexFormat:
|
|
2087
|
+
vertexFormat: p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
2088
2088
|
ellipsoid: this.ellipsoid
|
|
2089
2089
|
});
|
|
2090
2090
|
}, s;
|
|
@@ -2107,16 +2107,16 @@ var ye = function() {
|
|
|
2107
2107
|
return c.addBillboards(s, y), c;
|
|
2108
2108
|
}, i.BillboardGroup = function(s, a) {
|
|
2109
2109
|
this._drawHelper = s, this._scene = s._scene, this._options = R(a, _);
|
|
2110
|
-
var y = new
|
|
2110
|
+
var y = new p.BillboardCollection();
|
|
2111
2111
|
this._scene.primitives.add(y), this._billboards = y, this._orderedBillboards = [];
|
|
2112
2112
|
}, i.BillboardGroup.prototype.createBillboard = function(s, a) {
|
|
2113
2113
|
var y = this._billboards.add({
|
|
2114
2114
|
show: !0,
|
|
2115
2115
|
position: s,
|
|
2116
|
-
pixelOffset: new
|
|
2117
|
-
eyeOffset: new
|
|
2118
|
-
horizontalOrigin:
|
|
2119
|
-
verticalOrigin:
|
|
2116
|
+
pixelOffset: new p.Cartesian2(this._options.shiftX, this._options.shiftY),
|
|
2117
|
+
eyeOffset: new p.Cartesian3(0, 0, 0),
|
|
2118
|
+
horizontalOrigin: p.HorizontalOrigin.CENTER,
|
|
2119
|
+
verticalOrigin: p.VerticalOrigin.CENTER,
|
|
2120
2120
|
scale: 1,
|
|
2121
2121
|
image: this._options.iconUrl,
|
|
2122
2122
|
color: n
|
|
@@ -2140,15 +2140,15 @@ var ye = function() {
|
|
|
2140
2140
|
a.dragHandlers.onDrag && a.dragHandlers.onDrag(v(), L);
|
|
2141
2141
|
}
|
|
2142
2142
|
function T(L) {
|
|
2143
|
-
|
|
2143
|
+
b.destroy(), h(!0), a.dragHandlers.onDragEnd && a.dragHandlers.onDragEnd(v(), L);
|
|
2144
2144
|
}
|
|
2145
|
-
var
|
|
2146
|
-
|
|
2145
|
+
var b = new p.ScreenSpaceEventHandler(c._scene.canvas);
|
|
2146
|
+
b.setInputAction(function(L) {
|
|
2147
2147
|
var P = c._scene.camera.pickEllipsoid(L.endPosition, e);
|
|
2148
2148
|
P ? S(P) : T(P);
|
|
2149
|
-
},
|
|
2149
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE), b.setInputAction(function(L) {
|
|
2150
2150
|
T(c._scene.camera.pickEllipsoid(L.position, e));
|
|
2151
|
-
},
|
|
2151
|
+
}, p.ScreenSpaceEventType.LEFT_UP), h(!1), a.dragHandlers.onDragStart && a.dragHandlers.onDragStart(v(), c._scene.camera.pickEllipsoid(C, e));
|
|
2152
2152
|
});
|
|
2153
2153
|
}
|
|
2154
2154
|
a.onDoubleClick && V(y, "leftDoubleClick", function(g) {
|
|
@@ -2189,13 +2189,13 @@ var ye = function() {
|
|
|
2189
2189
|
});
|
|
2190
2190
|
var y = this, c = this._scene;
|
|
2191
2191
|
c.primitives;
|
|
2192
|
-
var f = this._tooltip, h = new i.BillboardGroup(this, a), v = new
|
|
2192
|
+
var f = this._tooltip, h = new i.BillboardGroup(this, a), v = new p.ScreenSpaceEventHandler(c.canvas);
|
|
2193
2193
|
v.setInputAction(function(g) {
|
|
2194
2194
|
if (g.position != null) {
|
|
2195
2195
|
var C = c.camera.pickEllipsoid(g.position, e);
|
|
2196
2196
|
C && (h.addBillboard(C), y.stopDrawing(), a.callback(C));
|
|
2197
2197
|
}
|
|
2198
|
-
},
|
|
2198
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), v.setInputAction(function(g) {
|
|
2199
2199
|
var C = g.endPosition;
|
|
2200
2200
|
if (C != null) {
|
|
2201
2201
|
var S = c.camera.pickEllipsoid(C, e);
|
|
@@ -2204,12 +2204,12 @@ var ye = function() {
|
|
|
2204
2204
|
"<p>Click to add your marker. Position is: </p>" + U(e.cartesianToCartographic(S))
|
|
2205
2205
|
) : f.showAt(C, "<p>Click on the globe to add your marker.</p>");
|
|
2206
2206
|
}
|
|
2207
|
-
},
|
|
2207
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE);
|
|
2208
2208
|
}, i.prototype.startDrawingPolygon = function(a) {
|
|
2209
2209
|
var a = R(a, r);
|
|
2210
2210
|
this.startDrawingPolyshape(!0, a);
|
|
2211
2211
|
}, i.prototype.startDrawingPolyline = function(a) {
|
|
2212
|
-
var a = R(a,
|
|
2212
|
+
var a = R(a, w);
|
|
2213
2213
|
this.startDrawingPolyshape(!1, a);
|
|
2214
2214
|
}, i.prototype.startDrawingPolyshape = function(s, a) {
|
|
2215
2215
|
this.startDrawing(function() {
|
|
@@ -2217,14 +2217,14 @@ var ye = function() {
|
|
|
2217
2217
|
});
|
|
2218
2218
|
var y = this, c = this._scene, f = c.primitives, h = this._tooltip, v = s ? 3 : 2, g;
|
|
2219
2219
|
s ? g = new ye.PolygonPrimitive(a) : g = new ye.PolylinePrimitive(a), g.asynchronous = !1, f.add(g);
|
|
2220
|
-
var C = [], S = new i.BillboardGroup(this, _), T = new
|
|
2221
|
-
K(c), T.setInputAction(function(
|
|
2222
|
-
if (
|
|
2223
|
-
var L = c.camera.pickEllipsoid(
|
|
2220
|
+
var C = [], S = new i.BillboardGroup(this, _), T = new p.ScreenSpaceEventHandler(c.canvas);
|
|
2221
|
+
K(c), T.setInputAction(function(b) {
|
|
2222
|
+
if (b.position != null) {
|
|
2223
|
+
var L = c.camera.pickEllipsoid(b.position, e);
|
|
2224
2224
|
L && (C.length == 0 && (C.push(L.clone()), S.addBillboard(C[0])), C.length >= v && (g.positions = C, g._createPrimitive = !0), C.push(L), S.addBillboard(L));
|
|
2225
2225
|
}
|
|
2226
|
-
},
|
|
2227
|
-
var L =
|
|
2226
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), T.setInputAction(function(b) {
|
|
2227
|
+
var L = b.endPosition;
|
|
2228
2228
|
if (L != null)
|
|
2229
2229
|
if (C.length == 0)
|
|
2230
2230
|
h.showAt(L, "<p>Click to add first point</p>");
|
|
@@ -2235,22 +2235,22 @@ var ye = function() {
|
|
|
2235
2235
|
"<p>Click to add new point (" + C.length + ")</p>" + (C.length > v ? "<p>Double click to finish drawing</p>" : "")
|
|
2236
2236
|
));
|
|
2237
2237
|
}
|
|
2238
|
-
},
|
|
2239
|
-
var L =
|
|
2238
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE), T.setInputAction(function(b) {
|
|
2239
|
+
var L = b.position;
|
|
2240
2240
|
if (L != null) {
|
|
2241
2241
|
if (C.length < v + 2)
|
|
2242
2242
|
return;
|
|
2243
2243
|
var P = c.camera.pickEllipsoid(L, e);
|
|
2244
2244
|
P && (F(c), y.stopDrawing(), typeof a.callback == "function" && (C.length - 1, a.callback(C)));
|
|
2245
2245
|
}
|
|
2246
|
-
},
|
|
2246
|
+
}, p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
2247
2247
|
};
|
|
2248
2248
|
function j(s) {
|
|
2249
2249
|
return e.cartographicArrayToCartesianArray([
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2250
|
+
p.Rectangle.northwest(s),
|
|
2251
|
+
p.Rectangle.northeast(s),
|
|
2252
|
+
p.Rectangle.southeast(s),
|
|
2253
|
+
p.Rectangle.southwest(s)
|
|
2254
2254
|
]);
|
|
2255
2255
|
}
|
|
2256
2256
|
function K(s) {
|
|
@@ -2264,19 +2264,19 @@ var ye = function() {
|
|
|
2264
2264
|
this.startDrawing(function() {
|
|
2265
2265
|
g != null && f.remove(g), C != null && C.remove(), S.destroy(), h.setVisible(!1), F(c);
|
|
2266
2266
|
});
|
|
2267
|
-
var y = this, c = this._scene, f = this._scene.primitives, h = this._tooltip, v = null, g = null, C = null, S = new
|
|
2267
|
+
var y = this, c = this._scene, f = this._scene.primitives, h = this._tooltip, v = null, g = null, C = null, S = new p.ScreenSpaceEventHandler(c.canvas);
|
|
2268
2268
|
K(c);
|
|
2269
|
-
function T(
|
|
2269
|
+
function T(b) {
|
|
2270
2270
|
g == null && (g = new ye.ExtentPrimitive({
|
|
2271
|
-
extent:
|
|
2271
|
+
extent: b,
|
|
2272
2272
|
material: a.material
|
|
2273
|
-
}), g.asynchronous = !1, f.add(g)), g.setExtent(
|
|
2274
|
-
var L = j(
|
|
2273
|
+
}), g.asynchronous = !1, f.add(g)), g.setExtent(b);
|
|
2274
|
+
var L = j(b);
|
|
2275
2275
|
C == null ? (C = new i.BillboardGroup(y, _), C.addBillboards(L)) : C.updateBillboardsPositions(L);
|
|
2276
2276
|
}
|
|
2277
|
-
S.setInputAction(function(
|
|
2278
|
-
if (
|
|
2279
|
-
var L = c.camera.pickEllipsoid(
|
|
2277
|
+
S.setInputAction(function(b) {
|
|
2278
|
+
if (b.position != null) {
|
|
2279
|
+
var L = c.camera.pickEllipsoid(b.position, e);
|
|
2280
2280
|
if (L)
|
|
2281
2281
|
if (g == null) {
|
|
2282
2282
|
v = e.cartesianToCartographic(L);
|
|
@@ -2285,8 +2285,8 @@ var ye = function() {
|
|
|
2285
2285
|
} else
|
|
2286
2286
|
y.stopDrawing(), typeof a.callback == "function" && a.callback(Y(v, e.cartesianToCartographic(L)));
|
|
2287
2287
|
}
|
|
2288
|
-
},
|
|
2289
|
-
var L =
|
|
2288
|
+
}, p.ScreenSpaceEventType.LEFT_DOWN), S.setInputAction(function(b) {
|
|
2289
|
+
var L = b.endPosition;
|
|
2290
2290
|
if (L != null)
|
|
2291
2291
|
if (g == null)
|
|
2292
2292
|
h.showAt(L, "<p>Click to start drawing rectangle</p>");
|
|
@@ -2297,13 +2297,13 @@ var ye = function() {
|
|
|
2297
2297
|
T(W), h.showAt(L, "<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>");
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
|
-
},
|
|
2300
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE);
|
|
2301
2301
|
}, i.prototype.startDrawingCircle = function(a) {
|
|
2302
2302
|
var a = R(a, r);
|
|
2303
2303
|
this.startDrawing(function() {
|
|
2304
2304
|
v != null && f.remove(v), g.remove(), C.destroy(), h.setVisible(!1);
|
|
2305
2305
|
});
|
|
2306
|
-
var y = this, c = this._scene, f = this._scene.primitives, h = this._tooltip, v = null, g = null, C = new
|
|
2306
|
+
var y = this, c = this._scene, f = this._scene.primitives, h = this._tooltip, v = null, g = null, C = new p.ScreenSpaceEventHandler(c.canvas);
|
|
2307
2307
|
C.setInputAction(function(S) {
|
|
2308
2308
|
if (S.position != null) {
|
|
2309
2309
|
var T = c.camera.pickEllipsoid(S.position, e);
|
|
@@ -2314,19 +2314,19 @@ var ye = function() {
|
|
|
2314
2314
|
material: a.material
|
|
2315
2315
|
}), f.add(v), g = new i.BillboardGroup(y, _), g.addBillboards([T])) : (typeof a.callback == "function" && a.callback(v.getCenter(), v.getRadius()), y.stopDrawing()));
|
|
2316
2316
|
}
|
|
2317
|
-
},
|
|
2317
|
+
}, p.ScreenSpaceEventType.LEFT_DOWN), C.setInputAction(function(S) {
|
|
2318
2318
|
var T = S.endPosition;
|
|
2319
2319
|
if (T != null)
|
|
2320
2320
|
if (v == null)
|
|
2321
2321
|
h.showAt(T, "<p>Click to start drawing the circle</p>");
|
|
2322
2322
|
else {
|
|
2323
|
-
var
|
|
2324
|
-
|
|
2323
|
+
var b = c.camera.pickEllipsoid(T, e);
|
|
2324
|
+
b && (v.setRadius(p.Cartesian3.distance(v.getCenter(), b)), g.updateBillboardsPositions(b), h.showAt(T, "<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"));
|
|
2325
2325
|
}
|
|
2326
|
-
},
|
|
2326
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE);
|
|
2327
2327
|
}, i.prototype.enhancePrimitives = function() {
|
|
2328
2328
|
var s = this;
|
|
2329
|
-
|
|
2329
|
+
p.Billboard.prototype.setEditable = function() {
|
|
2330
2330
|
if (this._editable)
|
|
2331
2331
|
return;
|
|
2332
2332
|
this._editable = !0;
|
|
@@ -2341,17 +2341,17 @@ var ye = function() {
|
|
|
2341
2341
|
function C(T) {
|
|
2342
2342
|
S.destroy(), h(!0), f.executeListeners({ name: "dragEnd", positions: T });
|
|
2343
2343
|
}
|
|
2344
|
-
var S = new
|
|
2344
|
+
var S = new p.ScreenSpaceEventHandler(s._scene.canvas);
|
|
2345
2345
|
S.setInputAction(function(T) {
|
|
2346
|
-
var
|
|
2347
|
-
|
|
2348
|
-
},
|
|
2346
|
+
var b = s._scene.camera.pickEllipsoid(T.endPosition, e);
|
|
2347
|
+
b ? g(b) : C(b);
|
|
2348
|
+
}, p.ScreenSpaceEventType.MOUSE_MOVE), S.setInputAction(function(T) {
|
|
2349
2349
|
C(s._scene.camera.pickEllipsoid(T.position, e));
|
|
2350
|
-
},
|
|
2350
|
+
}, p.ScreenSpaceEventType.LEFT_UP), h(!1);
|
|
2351
2351
|
}), X(c);
|
|
2352
2352
|
};
|
|
2353
2353
|
function a(c) {
|
|
2354
|
-
s._scene, !(this._highlighted && this._highlighted == c) && this._editMode !== !0 && (this._highlighted = c, c ? (s.setHighlighted(this), this._strokeColor = this.strokeColor, this.setStrokeStyle(
|
|
2354
|
+
s._scene, !(this._highlighted && this._highlighted == c) && this._editMode !== !0 && (this._highlighted = c, c ? (s.setHighlighted(this), this._strokeColor = this.strokeColor, this.setStrokeStyle(p.Color.fromCssColorString("white"), this.strokeWidth)) : this._strokeColor ? this.setStrokeStyle(this._strokeColor, this.strokeWidth) : this.setStrokeStyle(void 0, void 0));
|
|
2355
2355
|
}
|
|
2356
2356
|
function y(c) {
|
|
2357
2357
|
if (this._editMode != c)
|
|
@@ -2370,7 +2370,7 @@ var ye = function() {
|
|
|
2370
2370
|
}, q = function(N) {
|
|
2371
2371
|
var D = h.positions;
|
|
2372
2372
|
return e.cartographicToCartesian(
|
|
2373
|
-
new
|
|
2373
|
+
new p.EllipsoidGeodesic(
|
|
2374
2374
|
e.cartesianToCartographic(D[N]),
|
|
2375
2375
|
e.cartesianToCartographic(D[N < D.length - 1 ? N + 1 : 0])
|
|
2376
2376
|
).interpolateUsingFraction(0.5)
|
|
@@ -2394,7 +2394,7 @@ var ye = function() {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
};
|
|
2396
2396
|
v.addBillboards(h.positions, C), this._markers = v;
|
|
2397
|
-
for (var S = [], T = 0,
|
|
2397
|
+
for (var S = [], T = 0, b = h.positions.length + (this.isPolygon ? 0 : -1); T < b; T++)
|
|
2398
2398
|
S.push(q(T));
|
|
2399
2399
|
var L = {
|
|
2400
2400
|
dragHandlers: {
|
|
@@ -2412,10 +2412,10 @@ var ye = function() {
|
|
|
2412
2412
|
return "Drag to create a new point";
|
|
2413
2413
|
}
|
|
2414
2414
|
};
|
|
2415
|
-
g.addBillboards(S, L), this._editMarkers = g, this._globeClickhandler = new
|
|
2415
|
+
g.addBillboards(S, L), this._editMarkers = g, this._globeClickhandler = new p.ScreenSpaceEventHandler(f.canvas), this._globeClickhandler.setInputAction(function(N) {
|
|
2416
2416
|
var D = f.pick(N.position);
|
|
2417
2417
|
D && D.primitive || h.setEditMode(!1);
|
|
2418
|
-
},
|
|
2418
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), v.setOnTop(), g.setOnTop();
|
|
2419
2419
|
}
|
|
2420
2420
|
this._editMode = !0;
|
|
2421
2421
|
} else
|
|
@@ -2429,7 +2429,7 @@ var ye = function() {
|
|
|
2429
2429
|
c.setHighlighted = function(h) {
|
|
2430
2430
|
this._editMode !== !0 && (h ? (s.setHighlighted(this), this.setWidth(f * 2)) : this.setWidth(f));
|
|
2431
2431
|
}, c.getExtent = function() {
|
|
2432
|
-
return
|
|
2432
|
+
return p.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions));
|
|
2433
2433
|
}, X(c), c.setEditMode(!1);
|
|
2434
2434
|
}
|
|
2435
2435
|
}, ye.PolygonPrimitive.prototype.setEditable = function() {
|
|
@@ -2451,8 +2451,8 @@ var ye = function() {
|
|
|
2451
2451
|
var v = new i.BillboardGroup(s, k), g = {
|
|
2452
2452
|
dragHandlers: {
|
|
2453
2453
|
onDrag: function(S, T) {
|
|
2454
|
-
var
|
|
2455
|
-
c.setExtent(Y(e.cartesianToCartographic(
|
|
2454
|
+
var b = v.getBillboard((S + 2) % 4).position;
|
|
2455
|
+
c.setExtent(Y(e.cartesianToCartographic(b), e.cartesianToCartographic(T))), v.updateBillboardsPositions(j(c.extent));
|
|
2456
2456
|
},
|
|
2457
2457
|
onDragEnd: function(S, T) {
|
|
2458
2458
|
C();
|
|
@@ -2462,10 +2462,10 @@ var ye = function() {
|
|
|
2462
2462
|
return "Drag to change the corners of this extent";
|
|
2463
2463
|
}
|
|
2464
2464
|
};
|
|
2465
|
-
v.addBillboards(j(c.extent), g), this._markers = v, this._globeClickhandler = new
|
|
2465
|
+
v.addBillboards(j(c.extent), g), this._markers = v, this._globeClickhandler = new p.ScreenSpaceEventHandler(f.canvas), this._globeClickhandler.setInputAction(function(S) {
|
|
2466
2466
|
var T = f.pick(S.position);
|
|
2467
2467
|
T && !T.isDestroyed() && T.primitive || c.setEditMode(!1);
|
|
2468
|
-
},
|
|
2468
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), v.setOnTop();
|
|
2469
2469
|
}
|
|
2470
2470
|
this._editMode = !0;
|
|
2471
2471
|
} else
|
|
@@ -2482,7 +2482,7 @@ var ye = function() {
|
|
|
2482
2482
|
var v = this;
|
|
2483
2483
|
if (this._markers == null) {
|
|
2484
2484
|
let S = function() {
|
|
2485
|
-
return
|
|
2485
|
+
return p.EllipseOutlineGeometry(
|
|
2486
2486
|
e,
|
|
2487
2487
|
c.getCenter(),
|
|
2488
2488
|
c.getSemiMajorAxis(),
|
|
@@ -2501,11 +2501,11 @@ var ye = function() {
|
|
|
2501
2501
|
};
|
|
2502
2502
|
var g = new i.BillboardGroup(s, k), C = {
|
|
2503
2503
|
dragHandlers: {
|
|
2504
|
-
onDrag: function(
|
|
2505
|
-
var P =
|
|
2506
|
-
|
|
2504
|
+
onDrag: function(b, L) {
|
|
2505
|
+
var P = p.Cartesian3.distance(c.getCenter(), L);
|
|
2506
|
+
b % 2 == 0 ? c.setSemiMajorAxis(P) : c.setSemiMinorAxis(P), g.updateBillboardsPositions(S());
|
|
2507
2507
|
},
|
|
2508
|
-
onDragEnd: function(
|
|
2508
|
+
onDragEnd: function(b, L) {
|
|
2509
2509
|
T();
|
|
2510
2510
|
}
|
|
2511
2511
|
},
|
|
@@ -2513,10 +2513,10 @@ var ye = function() {
|
|
|
2513
2513
|
return "Drag to change the excentricity and radius";
|
|
2514
2514
|
}
|
|
2515
2515
|
};
|
|
2516
|
-
g.addBillboards(S(), C), this._markers = g, this._globeClickhandler = new
|
|
2517
|
-
var L = f.pick(
|
|
2516
|
+
g.addBillboards(S(), C), this._markers = g, this._globeClickhandler = new p.ScreenSpaceEventHandler(f.canvas), this._globeClickhandler.setInputAction(function(b) {
|
|
2517
|
+
var L = f.pick(b.position);
|
|
2518
2518
|
L && L.primitive || v.setEditMode(!1);
|
|
2519
|
-
},
|
|
2519
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), g.setOnTop();
|
|
2520
2520
|
}
|
|
2521
2521
|
this._editMode = !0;
|
|
2522
2522
|
} else
|
|
@@ -2524,15 +2524,15 @@ var ye = function() {
|
|
|
2524
2524
|
}, c.setHighlighted = a, X(c), c.setEditMode(!1);
|
|
2525
2525
|
}
|
|
2526
2526
|
}, i.CirclePrimitive.prototype.getCircleCartesianCoordinates = function(c) {
|
|
2527
|
-
for (var f =
|
|
2528
|
-
new
|
|
2527
|
+
for (var f = p.CircleOutlineGeometry.createGeometry(
|
|
2528
|
+
new p.CircleOutlineGeometry({
|
|
2529
2529
|
ellipsoid: e,
|
|
2530
2530
|
center: this.getCenter(),
|
|
2531
2531
|
radius: this.getRadius(),
|
|
2532
2532
|
granularity: c
|
|
2533
2533
|
})
|
|
2534
2534
|
), h = 0, v, g = []; h < f.attributes.position.values.length; h += 3)
|
|
2535
|
-
v = f.attributes.position.values, g.push(new
|
|
2535
|
+
v = f.attributes.position.values, g.push(new p.Cartesian3(v[h], v[h + 1], v[h + 2]));
|
|
2536
2536
|
return g;
|
|
2537
2537
|
}, i.CirclePrimitive.prototype.setEditable = function() {
|
|
2538
2538
|
if (!this.setEditMode) {
|
|
@@ -2544,7 +2544,7 @@ var ye = function() {
|
|
|
2544
2544
|
var v = this;
|
|
2545
2545
|
if (this._markers == null) {
|
|
2546
2546
|
let S = function() {
|
|
2547
|
-
return v.getCircleCartesianCoordinates(
|
|
2547
|
+
return v.getCircleCartesianCoordinates(p.Math.PI_OVER_TWO);
|
|
2548
2548
|
}, T = function() {
|
|
2549
2549
|
c.executeListeners({
|
|
2550
2550
|
name: "onEdited",
|
|
@@ -2554,10 +2554,10 @@ var ye = function() {
|
|
|
2554
2554
|
};
|
|
2555
2555
|
var g = new i.BillboardGroup(s, k), C = {
|
|
2556
2556
|
dragHandlers: {
|
|
2557
|
-
onDrag: function(
|
|
2558
|
-
c.setRadius(
|
|
2557
|
+
onDrag: function(b, L) {
|
|
2558
|
+
c.setRadius(p.Cartesian3.distance(c.getCenter(), L)), g.updateBillboardsPositions(S());
|
|
2559
2559
|
},
|
|
2560
|
-
onDragEnd: function(
|
|
2560
|
+
onDragEnd: function(b, L) {
|
|
2561
2561
|
T();
|
|
2562
2562
|
}
|
|
2563
2563
|
},
|
|
@@ -2565,10 +2565,10 @@ var ye = function() {
|
|
|
2565
2565
|
return "Drag to change the radius";
|
|
2566
2566
|
}
|
|
2567
2567
|
};
|
|
2568
|
-
g.addBillboards(S(), C), this._markers = g, this._globeClickhandler = new
|
|
2569
|
-
var L = f.pick(
|
|
2568
|
+
g.addBillboards(S(), C), this._markers = g, this._globeClickhandler = new p.ScreenSpaceEventHandler(f.canvas), this._globeClickhandler.setInputAction(function(b) {
|
|
2569
|
+
var L = f.pick(b.position);
|
|
2570
2570
|
L && L.primitive || v.setEditMode(!1);
|
|
2571
|
-
},
|
|
2571
|
+
}, p.ScreenSpaceEventType.LEFT_CLICK), g.setOnTop();
|
|
2572
2572
|
}
|
|
2573
2573
|
this._editMode = !0;
|
|
2574
2574
|
} else
|
|
@@ -2578,8 +2578,8 @@ var ye = function() {
|
|
|
2578
2578
|
};
|
|
2579
2579
|
}, i.DrawHelperWidget = function() {
|
|
2580
2580
|
function s(a, y) {
|
|
2581
|
-
if (!
|
|
2582
|
-
throw new
|
|
2581
|
+
if (!p.defined(y.container))
|
|
2582
|
+
throw new p.DeveloperError("Container is required");
|
|
2583
2583
|
var c = {
|
|
2584
2584
|
markerIcon: "./assets/img/glyphicons_242_google_maps.png",
|
|
2585
2585
|
polylineIcon: "./assets/img/glyphicons_097_vector_path_line.png",
|
|
@@ -2587,17 +2587,17 @@ var ye = function() {
|
|
|
2587
2587
|
circleIcon: "./assets/img/glyphicons_095_vector_path_circle.png",
|
|
2588
2588
|
extentIcon: "./assets/img/glyphicons_094_vector_path_square.png",
|
|
2589
2589
|
clearIcon: "./assets/img/glyphicons_067_cleaning.png",
|
|
2590
|
-
polylineDrawingOptions:
|
|
2590
|
+
polylineDrawingOptions: w,
|
|
2591
2591
|
polygonDrawingOptions: d,
|
|
2592
2592
|
extentDrawingOptions: u,
|
|
2593
|
-
circleDrawingOptions:
|
|
2593
|
+
circleDrawingOptions: m
|
|
2594
2594
|
};
|
|
2595
2595
|
$(y, c);
|
|
2596
2596
|
var f = this, h = document.createElement("DIV");
|
|
2597
2597
|
h.className = "toolbar", y.container.appendChild(h);
|
|
2598
|
-
function v(S, T,
|
|
2598
|
+
function v(S, T, b, L) {
|
|
2599
2599
|
var P = document.createElement("DIV");
|
|
2600
|
-
P.className = "button", P.title =
|
|
2600
|
+
P.className = "button", P.title = b, h.appendChild(P), P.onclick = L;
|
|
2601
2601
|
var W = document.createElement("SPAN");
|
|
2602
2602
|
P.appendChild(W);
|
|
2603
2603
|
var q = document.createElement("IMG");
|
|
@@ -2658,9 +2658,9 @@ var ye = function() {
|
|
|
2658
2658
|
return a = R(a, { container: s }), new i.DrawHelperWidget(this, a);
|
|
2659
2659
|
};
|
|
2660
2660
|
function Y(s, a) {
|
|
2661
|
-
var y = new
|
|
2661
|
+
var y = new p.Rectangle();
|
|
2662
2662
|
y.west = Math.min(s.longitude, a.longitude), y.east = Math.max(s.longitude, a.longitude), y.south = Math.min(s.latitude, a.latitude), y.north = Math.max(s.latitude, a.latitude);
|
|
2663
|
-
var c =
|
|
2663
|
+
var c = p.Math.EPSILON7;
|
|
2664
2664
|
return y.east - y.west < c && (y.east += c * 2), y.north - y.south < c && (y.north += c * 2), y;
|
|
2665
2665
|
}
|
|
2666
2666
|
function U(s, a) {
|
|
@@ -2760,15 +2760,15 @@ const Ur = 2, jr = (e, n) => {
|
|
|
2760
2760
|
class fs extends ui {
|
|
2761
2761
|
}
|
|
2762
2762
|
const ys = (e) => {
|
|
2763
|
-
const { drawState: n, drawingMaterial: t, drawingVertexColor: i, material: o, hollow: r, outlineWidth: d } = e, u = me(), [
|
|
2763
|
+
const { drawState: n, drawingMaterial: t, drawingVertexColor: i, material: o, hollow: r, outlineWidth: d } = e, u = me(), [m, E] = A();
|
|
2764
2764
|
O(() => {
|
|
2765
2765
|
E(
|
|
2766
2766
|
// eslint-disable-next-line
|
|
2767
2767
|
new ye(u, t, i)
|
|
2768
2768
|
);
|
|
2769
2769
|
}, []), O(() => {
|
|
2770
|
-
if (
|
|
2771
|
-
const M =
|
|
2770
|
+
if (m) {
|
|
2771
|
+
const M = m;
|
|
2772
2772
|
if (n.drawing)
|
|
2773
2773
|
switch (n.type) {
|
|
2774
2774
|
case re.POLYGON:
|
|
@@ -2799,8 +2799,8 @@ const ys = (e) => {
|
|
|
2799
2799
|
else
|
|
2800
2800
|
M.stopDrawing(), u.scene.globe.depthTestAgainstTerrain = !0;
|
|
2801
2801
|
}
|
|
2802
|
-
}, [n,
|
|
2803
|
-
const
|
|
2802
|
+
}, [n, m]);
|
|
2803
|
+
const w = (M) => {
|
|
2804
2804
|
let _ = M.coordinates !== void 0 ? M.coordinates : jr(M.type, M.geojson);
|
|
2805
2805
|
if (r !== !0)
|
|
2806
2806
|
switch (M.type) {
|
|
@@ -2833,7 +2833,7 @@ const ys = (e) => {
|
|
|
2833
2833
|
] }),
|
|
2834
2834
|
/* @__PURE__ */ l("p", { children: "This is description of drawed entity" })
|
|
2835
2835
|
] }),
|
|
2836
|
-
|
|
2836
|
+
w(M)
|
|
2837
2837
|
] }, M.id)) });
|
|
2838
2838
|
};
|
|
2839
2839
|
class vs extends mi {
|
|
@@ -2890,15 +2890,15 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
2890
2890
|
const { options: f } = e, { caret: h } = r;
|
|
2891
2891
|
Y(n, h, f);
|
|
2892
2892
|
}, [e]);
|
|
2893
|
-
const
|
|
2893
|
+
const m = (f, h, v) => {
|
|
2894
2894
|
const { trigger: g, matchAny: C, regex: S } = e, T = new RegExp(S);
|
|
2895
|
-
let
|
|
2896
|
-
Array.isArray(
|
|
2895
|
+
let b = g;
|
|
2896
|
+
Array.isArray(b) || (b = new Array(g)), b.sort();
|
|
2897
2897
|
const L = {};
|
|
2898
|
-
Array.isArray(v) &&
|
|
2898
|
+
Array.isArray(v) && b.forEach((q) => {
|
|
2899
2899
|
L[q] = v;
|
|
2900
2900
|
});
|
|
2901
|
-
const P = E(
|
|
2901
|
+
const P = E(b, T);
|
|
2902
2902
|
let W = {};
|
|
2903
2903
|
for (let q = 0; q < P.length; q++) {
|
|
2904
2904
|
const { triggerStr: N, triggerMatch: D, triggerLength: I } = P[q];
|
|
@@ -2907,7 +2907,7 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
2907
2907
|
let ee = -1;
|
|
2908
2908
|
if (I > 0) {
|
|
2909
2909
|
const se = D ? z : z - I + 1;
|
|
2910
|
-
if (se < 0 || (
|
|
2910
|
+
if (se < 0 || (w(N, f, se) && (ee = se + I), !ie && ee < 0))
|
|
2911
2911
|
break;
|
|
2912
2912
|
} else {
|
|
2913
2913
|
if (ie && z > 0)
|
|
@@ -2938,22 +2938,22 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
2938
2938
|
triggerStr: g,
|
|
2939
2939
|
triggerMatch: g.match(h),
|
|
2940
2940
|
triggerLength: g.length
|
|
2941
|
-
})),
|
|
2942
|
-
const { onChange: h, options: v, spaceRemovers: g, spacer: C, value: S } = e, T = n,
|
|
2943
|
-
if (
|
|
2941
|
+
})), w = (f, h, v) => !f || !f.length || h.substr(v, f.length) === f, M = (f) => {
|
|
2942
|
+
const { onChange: h, options: v, spaceRemovers: g, spacer: C, value: S } = e, T = n, b = f.target.value, L = Mi(_(f.target)).end;
|
|
2943
|
+
if (b.length || F({
|
|
2944
2944
|
...r,
|
|
2945
2945
|
helperVisible: !1
|
|
2946
|
-
}), t(
|
|
2946
|
+
}), t(b), F({
|
|
2947
2947
|
...r,
|
|
2948
2948
|
caret: L,
|
|
2949
2949
|
value: f.target.value
|
|
2950
|
-
}), !
|
|
2950
|
+
}), !b.length || !L)
|
|
2951
2951
|
return h(f.target.value);
|
|
2952
|
-
if (i && g.length &&
|
|
2953
|
-
for (let P = 0; P < Math.max(T.length,
|
|
2954
|
-
if (T[P] !==
|
|
2955
|
-
if (P >= 2 &&
|
|
2956
|
-
const W = `${
|
|
2952
|
+
if (i && g.length && b.length > 2 && C.length) {
|
|
2953
|
+
for (let P = 0; P < Math.max(T.length, b.length); ++P)
|
|
2954
|
+
if (T[P] !== b[P]) {
|
|
2955
|
+
if (P >= 2 && b[P - 1] === C && g.indexOf(b[P - 2]) === -1 && g.indexOf(b[P]) !== -1 && !Je(m(b.substring(0, P - 2), L - 3, v))) {
|
|
2956
|
+
const W = `${b.slice(0, P - 1)}${b.slice(P, P + 1)}${b.slice(P - 1, P)}${b.slice(P + 1)}`;
|
|
2957
2957
|
return K(P + 1), u.current !== null && (u.current.value = W), S || F({
|
|
2958
2958
|
...r,
|
|
2959
2959
|
value: W
|
|
@@ -2963,7 +2963,7 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
2963
2963
|
}
|
|
2964
2964
|
o(!1);
|
|
2965
2965
|
}
|
|
2966
|
-
return Y(
|
|
2966
|
+
return Y(b, L, v), h(f.target.value);
|
|
2967
2967
|
}, _ = (f) => {
|
|
2968
2968
|
if (f !== void 0)
|
|
2969
2969
|
if (f.children.length > 0) {
|
|
@@ -3013,7 +3013,7 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
3013
3013
|
helperVisible: !1
|
|
3014
3014
|
});
|
|
3015
3015
|
}, j = (f) => {
|
|
3016
|
-
const { spacer: h, onSelect: v, changeOnSelect: g } = e, { matchStart: C, matchLength: S, options: T, trigger:
|
|
3016
|
+
const { spacer: h, onSelect: v, changeOnSelect: g } = e, { matchStart: C, matchLength: S, options: T, trigger: b } = r, L = T[f], P = n, W = P.substring(0, C - b.length), q = P.substring(C + S), N = { target: u.current }, D = g(b, L);
|
|
3017
3017
|
N.target !== null && (N.target.value = `${W}${D}${h}${q}`), M(N), N.target !== null && v(N.target.value), U(), K(W.length + D.length + 1), o(!0);
|
|
3018
3018
|
}, K = (f) => {
|
|
3019
3019
|
F({
|
|
@@ -3035,11 +3035,11 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
3035
3035
|
const C = _(g);
|
|
3036
3036
|
if (C === void 0)
|
|
3037
3037
|
return;
|
|
3038
|
-
const S = g.getBoundingClientRect(), T =
|
|
3038
|
+
const S = g.getBoundingClientRect(), T = m(f, h, v);
|
|
3039
3039
|
if (Object.keys(T).length > 0 && C !== null) {
|
|
3040
|
-
const
|
|
3040
|
+
const b = Li(C, h), L = C.getBoundingClientRect(), { minChars: P, onRequestOptions: W, requestOnlyIfNoOptions: q, mode: N } = e;
|
|
3041
3041
|
let D, I, z, de = "unset";
|
|
3042
|
-
N === "assist" ? (D = g === C ?
|
|
3042
|
+
N === "assist" ? (D = g === C ? b.top + C.offsetTop : b.top + S.top, I = Math.min(b.left + C.offsetLeft - no, C.offsetLeft + L.width - io)) : (D = S.top + g.offsetHeight, I = g.offsetLeft, z = g.offsetLeft - g.offsetWidth, de = `${S.width}px`), T.matchLength >= P && (T.options.length > 1 || T.options.length === 1 && T.options[0].length !== T.matchLength) ? F({
|
|
3043
3043
|
...r,
|
|
3044
3044
|
value: f,
|
|
3045
3045
|
helperVisible: !0,
|
|
@@ -3060,7 +3060,7 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
3060
3060
|
});
|
|
3061
3061
|
}, 100);
|
|
3062
3062
|
}, x = () => {
|
|
3063
|
-
const { helperVisible: f, left: h, right: v, matchStart: g, matchLength: C, options: S, selection: T, top:
|
|
3063
|
+
const { helperVisible: f, left: h, right: v, matchStart: g, matchLength: C, options: S, selection: T, top: b, value: L, width: P } = r;
|
|
3064
3064
|
if (!f)
|
|
3065
3065
|
return null;
|
|
3066
3066
|
const { maxOptions: W, offsetX: q, offsetY: N, direction: D } = e;
|
|
@@ -3095,7 +3095,7 @@ const Xr = 38, Zr = 40, Jr = 13, Qr = 14, eo = 27, to = 9, no = 10, io = 100, ro
|
|
|
3095
3095
|
ie
|
|
3096
3096
|
);
|
|
3097
3097
|
}), de = D === "ltr" ? { left: h + q } : { right: v + q };
|
|
3098
|
-
return /* @__PURE__ */ l("ul", { className: "react-autocomplete-input", style: { ...de, top:
|
|
3098
|
+
return /* @__PURE__ */ l("ul", { className: "react-autocomplete-input", style: { ...de, top: b + N, width: P }, children: z });
|
|
3099
3099
|
}, { Component: $, ComponentProps: R, defaultValue: V, disabled: X, onBlur: s, value: a, ...y } = e, c = Object.assign({}, y);
|
|
3100
3100
|
return Object.keys(e).forEach((f) => {
|
|
3101
3101
|
delete c[f];
|
|
@@ -3276,9 +3276,9 @@ const Ns = fe.memo(
|
|
|
3276
3276
|
files: r,
|
|
3277
3277
|
folderChain: d,
|
|
3278
3278
|
onFileAction: u,
|
|
3279
|
-
...
|
|
3279
|
+
...m
|
|
3280
3280
|
}, E) => {
|
|
3281
|
-
const
|
|
3281
|
+
const w = pe(
|
|
3282
3282
|
(V) => null,
|
|
3283
3283
|
// file.thumbnailUrl ? `https://chonky.io${file.thumbnailUrl}` : null,
|
|
3284
3284
|
[]
|
|
@@ -3315,13 +3315,13 @@ const Ns = fe.memo(
|
|
|
3315
3315
|
onFileAction: (V) => {
|
|
3316
3316
|
typeof u == "function" && u(V);
|
|
3317
3317
|
},
|
|
3318
|
-
thumbnailGenerator:
|
|
3318
|
+
thumbnailGenerator: w,
|
|
3319
3319
|
defaultFileViewActionId: j,
|
|
3320
3320
|
disableDragAndDrop: F,
|
|
3321
3321
|
fileActions: U,
|
|
3322
3322
|
darkMode: k,
|
|
3323
3323
|
i18n: $,
|
|
3324
|
-
...
|
|
3324
|
+
...m
|
|
3325
3325
|
}
|
|
3326
3326
|
)
|
|
3327
3327
|
}
|