@gisfun/maplibre-gl-components 0.15.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +1960 -0
- package/dist/ControlGrid-DN5md8hp.cjs +19636 -0
- package/dist/ControlGrid-rVNG7B9O.js +170422 -0
- package/dist/DuckDBConverter-B98M0DFs.cjs +23 -0
- package/dist/DuckDBConverter-RPq48-t0.js +434 -0
- package/dist/ShapefileConverter-AjbEjEyq.cjs +1 -0
- package/dist/ShapefileConverter-trvt8J3z.js +125 -0
- package/dist/decoder-CLokFc0V.js +8 -0
- package/dist/decoder-D9LU4bUo.cjs +1 -0
- package/dist/deflate-BA1jZeSX.js +10 -0
- package/dist/deflate-DEdCz12a.cjs +1 -0
- package/dist/geojson-BQSVgKFt.cjs +1 -0
- package/dist/geojson-BSUuDj5k.js +2551 -0
- package/dist/geotiff-De1w1lBy.cjs +8 -0
- package/dist/geotiff-o_Fq1Na4.js +3108 -0
- package/dist/index-8ZZtuDTp.js +705 -0
- package/dist/index-B-Nr9y7J.cjs +84 -0
- package/dist/index-B5NoFrpY.js +8892 -0
- package/dist/index-Bi1MMPUx.js +4163 -0
- package/dist/index-C9fk_HKR.js +167 -0
- package/dist/index-CBBRBJvR.cjs +274 -0
- package/dist/index-CZxPF1qt.js +4 -0
- package/dist/index-CiDPSJ9T.cjs +1 -0
- package/dist/index-CjM_nbxd.cjs +107 -0
- package/dist/index-DQXdX5y1.js +4666 -0
- package/dist/index-Dh1kpCb6.cjs +1 -0
- package/dist/index-IrsIiQNM.cjs +4 -0
- package/dist/index.cjs +3819 -0
- package/dist/index.mjs +19580 -0
- package/dist/jpeg-CF9OGQg_.js +533 -0
- package/dist/jpeg-JSQOxGHy.cjs +1 -0
- package/dist/lerc-7LlQoT6u.js +1032 -0
- package/dist/lerc-BIsodce9.cjs +1 -0
- package/dist/lzw-BZniWIYG.js +84 -0
- package/dist/lzw-BhML-BvT.cjs +1 -0
- package/dist/main-dist-Bymiy5aM.cjs +2 -0
- package/dist/main-dist-Cv8AKwrY.js +629 -0
- package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +129 -0
- package/dist/maplibre-geoman.es-CFgM2ajb.js +22827 -0
- package/dist/maplibre-gl-components.css +1 -0
- package/dist/packbits-B9b7gX2c.cjs +1 -0
- package/dist/packbits-DWY5O-FG.js +24 -0
- package/dist/pako.esm-Bx5X36Wo.js +1074 -0
- package/dist/pako.esm-DZC2QrbJ.cjs +1 -0
- package/dist/raw-C3ARbSFo.cjs +1 -0
- package/dist/raw-DUslI1gr.js +9 -0
- package/dist/react.cjs +1 -0
- package/dist/react.mjs +1306 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/adapters/AddVectorAdapter.d.ts +66 -0
- package/dist/types/lib/adapters/AddVectorAdapter.d.ts.map +1 -0
- package/dist/types/lib/adapters/CogLayerAdapter.d.ts +126 -0
- package/dist/types/lib/adapters/CogLayerAdapter.d.ts.map +1 -0
- package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts +78 -0
- package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts.map +1 -0
- package/dist/types/lib/adapters/StacLayerAdapter.d.ts +71 -0
- package/dist/types/lib/adapters/StacLayerAdapter.d.ts.map +1 -0
- package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts +72 -0
- package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts.map +1 -0
- package/dist/types/lib/adapters/index.d.ts +7 -0
- package/dist/types/lib/adapters/index.d.ts.map +1 -0
- package/dist/types/lib/addControlGrid.d.ts +80 -0
- package/dist/types/lib/addControlGrid.d.ts.map +1 -0
- package/dist/types/lib/colormaps/diverging.d.ts +30 -0
- package/dist/types/lib/colormaps/diverging.d.ts.map +1 -0
- package/dist/types/lib/colormaps/index.d.ts +32 -0
- package/dist/types/lib/colormaps/index.d.ts.map +1 -0
- package/dist/types/lib/colormaps/misc.d.ts +38 -0
- package/dist/types/lib/colormaps/misc.d.ts.map +1 -0
- package/dist/types/lib/colormaps/sequential.d.ts +22 -0
- package/dist/types/lib/colormaps/sequential.d.ts.map +1 -0
- package/dist/types/lib/converters/DuckDBConverter.d.ts +112 -0
- package/dist/types/lib/converters/DuckDBConverter.d.ts.map +1 -0
- package/dist/types/lib/converters/ShapefileConverter.d.ts +56 -0
- package/dist/types/lib/converters/ShapefileConverter.d.ts.map +1 -0
- package/dist/types/lib/converters/index.d.ts +8 -0
- package/dist/types/lib/converters/index.d.ts.map +1 -0
- package/dist/types/lib/converters/types.d.ts +75 -0
- package/dist/types/lib/converters/types.d.ts.map +1 -0
- package/dist/types/lib/core/AddVector.d.ts +116 -0
- package/dist/types/lib/core/AddVector.d.ts.map +1 -0
- package/dist/types/lib/core/Basemap.d.ts +206 -0
- package/dist/types/lib/core/Basemap.d.ts.map +1 -0
- package/dist/types/lib/core/BasemapReact.d.ts +32 -0
- package/dist/types/lib/core/BasemapReact.d.ts.map +1 -0
- package/dist/types/lib/core/BookmarkControl.d.ts +180 -0
- package/dist/types/lib/core/BookmarkControl.d.ts.map +1 -0
- package/dist/types/lib/core/ChoroplethControl.d.ts +105 -0
- package/dist/types/lib/core/ChoroplethControl.d.ts.map +1 -0
- package/dist/types/lib/core/CogLayer.d.ts +139 -0
- package/dist/types/lib/core/CogLayer.d.ts.map +1 -0
- package/dist/types/lib/core/CogLayerReact.d.ts +32 -0
- package/dist/types/lib/core/CogLayerReact.d.ts.map +1 -0
- package/dist/types/lib/core/Colorbar.d.ts +133 -0
- package/dist/types/lib/core/Colorbar.d.ts.map +1 -0
- package/dist/types/lib/core/ColorbarGuiControl.d.ts +79 -0
- package/dist/types/lib/core/ColorbarGuiControl.d.ts.map +1 -0
- package/dist/types/lib/core/ColorbarReact.d.ts +34 -0
- package/dist/types/lib/core/ColorbarReact.d.ts.map +1 -0
- package/dist/types/lib/core/ControlGrid.d.ts +125 -0
- package/dist/types/lib/core/ControlGrid.d.ts.map +1 -0
- package/dist/types/lib/core/ControlGridReact.d.ts +32 -0
- package/dist/types/lib/core/ControlGridReact.d.ts.map +1 -0
- package/dist/types/lib/core/HtmlControl.d.ts +140 -0
- package/dist/types/lib/core/HtmlControl.d.ts.map +1 -0
- package/dist/types/lib/core/HtmlControlReact.d.ts +32 -0
- package/dist/types/lib/core/HtmlControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/HtmlGuiControl.d.ts +68 -0
- package/dist/types/lib/core/HtmlGuiControl.d.ts.map +1 -0
- package/dist/types/lib/core/InspectControl.d.ts +202 -0
- package/dist/types/lib/core/InspectControl.d.ts.map +1 -0
- package/dist/types/lib/core/InspectControlReact.d.ts +32 -0
- package/dist/types/lib/core/InspectControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/Legend.d.ts +142 -0
- package/dist/types/lib/core/Legend.d.ts.map +1 -0
- package/dist/types/lib/core/LegendGuiControl.d.ts +69 -0
- package/dist/types/lib/core/LegendGuiControl.d.ts.map +1 -0
- package/dist/types/lib/core/LegendReact.d.ts +34 -0
- package/dist/types/lib/core/LegendReact.d.ts.map +1 -0
- package/dist/types/lib/core/MeasureControl.d.ts +211 -0
- package/dist/types/lib/core/MeasureControl.d.ts.map +1 -0
- package/dist/types/lib/core/MinimapControl.d.ts +77 -0
- package/dist/types/lib/core/MinimapControl.d.ts.map +1 -0
- package/dist/types/lib/core/MinimapControlReact.d.ts +32 -0
- package/dist/types/lib/core/MinimapControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/PMTilesLayer.d.ts +119 -0
- package/dist/types/lib/core/PMTilesLayer.d.ts.map +1 -0
- package/dist/types/lib/core/PrintControl.d.ts +226 -0
- package/dist/types/lib/core/PrintControl.d.ts.map +1 -0
- package/dist/types/lib/core/SearchControl.d.ts +172 -0
- package/dist/types/lib/core/SearchControl.d.ts.map +1 -0
- package/dist/types/lib/core/SearchControlReact.d.ts +32 -0
- package/dist/types/lib/core/SearchControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/StacLayer.d.ts +107 -0
- package/dist/types/lib/core/StacLayer.d.ts.map +1 -0
- package/dist/types/lib/core/StacSearch.d.ts +109 -0
- package/dist/types/lib/core/StacSearch.d.ts.map +1 -0
- package/dist/types/lib/core/Terrain.d.ts +165 -0
- package/dist/types/lib/core/Terrain.d.ts.map +1 -0
- package/dist/types/lib/core/TerrainReact.d.ts +32 -0
- package/dist/types/lib/core/TerrainReact.d.ts.map +1 -0
- package/dist/types/lib/core/VectorDataset.d.ts +228 -0
- package/dist/types/lib/core/VectorDataset.d.ts.map +1 -0
- package/dist/types/lib/core/VectorDatasetReact.d.ts +31 -0
- package/dist/types/lib/core/VectorDatasetReact.d.ts.map +1 -0
- package/dist/types/lib/core/ViewStateControl.d.ts +205 -0
- package/dist/types/lib/core/ViewStateControl.d.ts.map +1 -0
- package/dist/types/lib/core/ViewStateControlReact.d.ts +32 -0
- package/dist/types/lib/core/ViewStateControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/ZarrLayer.d.ts +110 -0
- package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -0
- package/dist/types/lib/core/types.d.ts +2793 -0
- package/dist/types/lib/core/types.d.ts.map +1 -0
- package/dist/types/lib/hooks/index.d.ts +13 -0
- package/dist/types/lib/hooks/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useBasemap.d.ts +43 -0
- package/dist/types/lib/hooks/useBasemap.d.ts.map +1 -0
- package/dist/types/lib/hooks/useCogLayer.d.ts +44 -0
- package/dist/types/lib/hooks/useCogLayer.d.ts.map +1 -0
- package/dist/types/lib/hooks/useColorbar.d.ts +36 -0
- package/dist/types/lib/hooks/useColorbar.d.ts.map +1 -0
- package/dist/types/lib/hooks/useControlGrid.d.ts +41 -0
- package/dist/types/lib/hooks/useControlGrid.d.ts.map +1 -0
- package/dist/types/lib/hooks/useHtmlControl.d.ts +39 -0
- package/dist/types/lib/hooks/useHtmlControl.d.ts.map +1 -0
- package/dist/types/lib/hooks/useInspectControl.d.ts +49 -0
- package/dist/types/lib/hooks/useInspectControl.d.ts.map +1 -0
- package/dist/types/lib/hooks/useLegend.d.ts +41 -0
- package/dist/types/lib/hooks/useLegend.d.ts.map +1 -0
- package/dist/types/lib/hooks/useMinimapControl.d.ts +35 -0
- package/dist/types/lib/hooks/useMinimapControl.d.ts.map +1 -0
- package/dist/types/lib/hooks/useSearchControl.d.ts +43 -0
- package/dist/types/lib/hooks/useSearchControl.d.ts.map +1 -0
- package/dist/types/lib/hooks/useTerrain.d.ts +43 -0
- package/dist/types/lib/hooks/useTerrain.d.ts.map +1 -0
- package/dist/types/lib/hooks/useVectorDataset.d.ts +35 -0
- package/dist/types/lib/hooks/useVectorDataset.d.ts.map +1 -0
- package/dist/types/lib/hooks/useViewState.d.ts +43 -0
- package/dist/types/lib/hooks/useViewState.d.ts.map +1 -0
- package/dist/types/lib/utils/color.d.ts +47 -0
- package/dist/types/lib/utils/color.d.ts.map +1 -0
- package/dist/types/lib/utils/fileHelpers.d.ts +207 -0
- package/dist/types/lib/utils/fileHelpers.d.ts.map +1 -0
- package/dist/types/lib/utils/helpers.d.ts +48 -0
- package/dist/types/lib/utils/helpers.d.ts.map +1 -0
- package/dist/types/lib/utils/index.d.ts +4 -0
- package/dist/types/lib/utils/index.d.ts.map +1 -0
- package/dist/types/lib/utils/providers.d.ts +46 -0
- package/dist/types/lib/utils/providers.d.ts.map +1 -0
- package/dist/types/react.d.ts +15 -0
- package/dist/types/react.d.ts.map +1 -0
- package/dist/webimage-CBRffWZD.cjs +1 -0
- package/dist/webimage-ibSPOLHJ.js +19 -0
- package/package.json +137 -0
package/dist/react.mjs
ADDED
|
@@ -0,0 +1,1306 @@
|
|
|
1
|
+
import { useRef as R, useEffect as y, useState as k, useCallback as c } from "react";
|
|
2
|
+
import { k as W, L as U, H as _, B as $, a3 as G, Y as S, a6 as N, I as Z, a7 as q, C as P, j as Q, N as Y } from "./ControlGrid-rVNG7B9O.js";
|
|
3
|
+
function X({
|
|
4
|
+
map: o,
|
|
5
|
+
onStateChange: f,
|
|
6
|
+
position: e = "bottom-right",
|
|
7
|
+
...a
|
|
8
|
+
}) {
|
|
9
|
+
const l = R(null);
|
|
10
|
+
return y(() => {
|
|
11
|
+
if (!o) return;
|
|
12
|
+
const t = new W({ position: e, ...a });
|
|
13
|
+
return l.current = t, f && (t.on("update", (r) => {
|
|
14
|
+
f(r.state);
|
|
15
|
+
}), t.on("show", (r) => {
|
|
16
|
+
f(r.state);
|
|
17
|
+
}), t.on("hide", (r) => {
|
|
18
|
+
f(r.state);
|
|
19
|
+
})), o.addControl(t, e), () => {
|
|
20
|
+
o.hasControl(t) && o.removeControl(t), l.current = null;
|
|
21
|
+
};
|
|
22
|
+
}, [o, e, f]), y(() => {
|
|
23
|
+
if (l.current) {
|
|
24
|
+
const t = Object.fromEntries(
|
|
25
|
+
Object.entries(a).filter(([, r]) => r !== void 0)
|
|
26
|
+
);
|
|
27
|
+
Object.keys(t).length > 0 && l.current.update(t);
|
|
28
|
+
}
|
|
29
|
+
}, [
|
|
30
|
+
a.colormap,
|
|
31
|
+
a.colorStops,
|
|
32
|
+
a.vmin,
|
|
33
|
+
a.vmax,
|
|
34
|
+
a.label,
|
|
35
|
+
a.units,
|
|
36
|
+
a.visible,
|
|
37
|
+
a.orientation,
|
|
38
|
+
a.barThickness,
|
|
39
|
+
a.barLength,
|
|
40
|
+
a.backgroundColor,
|
|
41
|
+
a.opacity,
|
|
42
|
+
a.fontSize,
|
|
43
|
+
a.fontColor,
|
|
44
|
+
a.minzoom,
|
|
45
|
+
a.maxzoom
|
|
46
|
+
]), null;
|
|
47
|
+
}
|
|
48
|
+
function p({
|
|
49
|
+
map: o,
|
|
50
|
+
onStateChange: f,
|
|
51
|
+
position: e = "bottom-left",
|
|
52
|
+
...a
|
|
53
|
+
}) {
|
|
54
|
+
const l = R(null);
|
|
55
|
+
return y(() => {
|
|
56
|
+
if (!o) return;
|
|
57
|
+
const t = new U({ position: e, ...a });
|
|
58
|
+
if (l.current = t, f) {
|
|
59
|
+
const r = (s) => {
|
|
60
|
+
f(s.state);
|
|
61
|
+
};
|
|
62
|
+
t.on("update", r), t.on("show", r), t.on("hide", r), t.on("collapse", r), t.on("expand", r);
|
|
63
|
+
}
|
|
64
|
+
return o.addControl(t, e), () => {
|
|
65
|
+
o.hasControl(t) && o.removeControl(t), l.current = null;
|
|
66
|
+
};
|
|
67
|
+
}, [o]), y(() => {
|
|
68
|
+
if (l.current) {
|
|
69
|
+
const t = Object.fromEntries(
|
|
70
|
+
Object.entries(a).filter(([, r]) => r !== void 0)
|
|
71
|
+
);
|
|
72
|
+
Object.keys(t).length > 0 && l.current.update(t);
|
|
73
|
+
}
|
|
74
|
+
}, [
|
|
75
|
+
a.items,
|
|
76
|
+
a.title,
|
|
77
|
+
a.visible,
|
|
78
|
+
a.collapsed,
|
|
79
|
+
a.collapsible,
|
|
80
|
+
a.width,
|
|
81
|
+
a.maxHeight,
|
|
82
|
+
a.backgroundColor,
|
|
83
|
+
a.opacity,
|
|
84
|
+
a.fontSize,
|
|
85
|
+
a.fontColor,
|
|
86
|
+
a.swatchSize,
|
|
87
|
+
a.minzoom,
|
|
88
|
+
a.maxzoom
|
|
89
|
+
]), null;
|
|
90
|
+
}
|
|
91
|
+
function ee({
|
|
92
|
+
map: o,
|
|
93
|
+
onStateChange: f,
|
|
94
|
+
position: e = "top-left",
|
|
95
|
+
...a
|
|
96
|
+
}) {
|
|
97
|
+
const l = R(null);
|
|
98
|
+
return y(() => {
|
|
99
|
+
if (!o) return;
|
|
100
|
+
const t = new _({ position: e, ...a });
|
|
101
|
+
if (l.current = t, f) {
|
|
102
|
+
const r = (s) => {
|
|
103
|
+
f(s.state);
|
|
104
|
+
};
|
|
105
|
+
t.on("update", r), t.on("show", r), t.on("hide", r), t.on("expand", r), t.on("collapse", r);
|
|
106
|
+
}
|
|
107
|
+
return o.addControl(t, e), () => {
|
|
108
|
+
o.hasControl(t) && o.removeControl(t), l.current = null;
|
|
109
|
+
};
|
|
110
|
+
}, [o, e, f]), y(() => {
|
|
111
|
+
l.current && a.html !== void 0 && l.current.setHtml(a.html);
|
|
112
|
+
}, [a.html]), y(() => {
|
|
113
|
+
if (l.current) {
|
|
114
|
+
const t = {};
|
|
115
|
+
a.visible !== void 0 && (t.visible = a.visible), a.title !== void 0 && (t.title = a.title), a.collapsible !== void 0 && (t.collapsible = a.collapsible), a.collapsed !== void 0 && (t.collapsed = a.collapsed), a.backgroundColor !== void 0 && (t.backgroundColor = a.backgroundColor), a.padding !== void 0 && (t.padding = a.padding), a.borderRadius !== void 0 && (t.borderRadius = a.borderRadius), a.opacity !== void 0 && (t.opacity = a.opacity), a.maxWidth !== void 0 && (t.maxWidth = a.maxWidth), a.maxHeight !== void 0 && (t.maxHeight = a.maxHeight), a.fontSize !== void 0 && (t.fontSize = a.fontSize), a.fontColor !== void 0 && (t.fontColor = a.fontColor), a.minzoom !== void 0 && (t.minzoom = a.minzoom), a.maxzoom !== void 0 && (t.maxzoom = a.maxzoom), Object.keys(t).length > 0 && l.current.update(t);
|
|
116
|
+
}
|
|
117
|
+
}, [
|
|
118
|
+
a.visible,
|
|
119
|
+
a.title,
|
|
120
|
+
a.collapsible,
|
|
121
|
+
a.collapsed,
|
|
122
|
+
a.backgroundColor,
|
|
123
|
+
a.padding,
|
|
124
|
+
a.borderRadius,
|
|
125
|
+
a.opacity,
|
|
126
|
+
a.maxWidth,
|
|
127
|
+
a.maxHeight,
|
|
128
|
+
a.fontSize,
|
|
129
|
+
a.fontColor,
|
|
130
|
+
a.minzoom,
|
|
131
|
+
a.maxzoom
|
|
132
|
+
]), null;
|
|
133
|
+
}
|
|
134
|
+
function le({
|
|
135
|
+
map: o,
|
|
136
|
+
onBasemapChange: f,
|
|
137
|
+
onStateChange: e,
|
|
138
|
+
position: a = "top-right",
|
|
139
|
+
...l
|
|
140
|
+
}) {
|
|
141
|
+
const t = R(null);
|
|
142
|
+
return y(() => {
|
|
143
|
+
if (!o) return;
|
|
144
|
+
const r = new $({ position: a, ...l });
|
|
145
|
+
if (t.current = r, e) {
|
|
146
|
+
const s = (n) => {
|
|
147
|
+
e(n.state);
|
|
148
|
+
};
|
|
149
|
+
r.on("update", s), r.on("show", s), r.on("hide", s), r.on("collapse", s), r.on("expand", s);
|
|
150
|
+
}
|
|
151
|
+
if (f) {
|
|
152
|
+
const s = (n) => {
|
|
153
|
+
n.basemap && f(n.basemap);
|
|
154
|
+
};
|
|
155
|
+
r.on("basemapchange", s);
|
|
156
|
+
}
|
|
157
|
+
return o.addControl(r, a), () => {
|
|
158
|
+
o.hasControl(r) && o.removeControl(r), t.current = null;
|
|
159
|
+
};
|
|
160
|
+
}, [o]), y(() => {
|
|
161
|
+
if (t.current) {
|
|
162
|
+
const r = Object.fromEntries(
|
|
163
|
+
Object.entries(l).filter(([, s]) => s !== void 0)
|
|
164
|
+
);
|
|
165
|
+
Object.keys(r).length > 0 && t.current.update(r);
|
|
166
|
+
}
|
|
167
|
+
}, [
|
|
168
|
+
l.basemaps,
|
|
169
|
+
l.defaultBasemap,
|
|
170
|
+
l.visible,
|
|
171
|
+
l.collapsed,
|
|
172
|
+
l.collapsible,
|
|
173
|
+
l.displayMode,
|
|
174
|
+
l.showSearch,
|
|
175
|
+
l.filterGroups,
|
|
176
|
+
l.excludeGroups,
|
|
177
|
+
l.excludeBroken,
|
|
178
|
+
l.backgroundColor,
|
|
179
|
+
l.padding,
|
|
180
|
+
l.borderRadius,
|
|
181
|
+
l.opacity,
|
|
182
|
+
l.maxWidth,
|
|
183
|
+
l.maxHeight,
|
|
184
|
+
l.fontSize,
|
|
185
|
+
l.fontColor,
|
|
186
|
+
l.minzoom,
|
|
187
|
+
l.maxzoom
|
|
188
|
+
]), null;
|
|
189
|
+
}
|
|
190
|
+
function re({
|
|
191
|
+
map: o,
|
|
192
|
+
onTerrainChange: f,
|
|
193
|
+
onStateChange: e,
|
|
194
|
+
position: a = "top-right",
|
|
195
|
+
...l
|
|
196
|
+
}) {
|
|
197
|
+
const t = R(null);
|
|
198
|
+
return y(() => {
|
|
199
|
+
if (!o) return;
|
|
200
|
+
const r = new G({ position: a, ...l });
|
|
201
|
+
if (t.current = r, e) {
|
|
202
|
+
const s = (n) => {
|
|
203
|
+
e(n.state);
|
|
204
|
+
};
|
|
205
|
+
r.on("update", s), r.on("show", s), r.on("hide", s);
|
|
206
|
+
}
|
|
207
|
+
if (f) {
|
|
208
|
+
const s = (n) => {
|
|
209
|
+
f(n.state.enabled);
|
|
210
|
+
};
|
|
211
|
+
r.on("terrainchange", s);
|
|
212
|
+
}
|
|
213
|
+
return o.addControl(r, a), () => {
|
|
214
|
+
o.hasControl(r) && o.removeControl(r), t.current = null;
|
|
215
|
+
};
|
|
216
|
+
}, [o]), y(() => {
|
|
217
|
+
if (t.current) {
|
|
218
|
+
const r = Object.fromEntries(
|
|
219
|
+
Object.entries(l).filter(([, s]) => s !== void 0)
|
|
220
|
+
);
|
|
221
|
+
Object.keys(r).length > 0 && t.current.update(r);
|
|
222
|
+
}
|
|
223
|
+
}, [
|
|
224
|
+
l.enabled,
|
|
225
|
+
l.exaggeration,
|
|
226
|
+
l.hillshade,
|
|
227
|
+
l.hillshadeExaggeration,
|
|
228
|
+
l.visible,
|
|
229
|
+
l.backgroundColor,
|
|
230
|
+
l.borderRadius,
|
|
231
|
+
l.opacity,
|
|
232
|
+
l.minzoom,
|
|
233
|
+
l.maxzoom
|
|
234
|
+
]), null;
|
|
235
|
+
}
|
|
236
|
+
function te({
|
|
237
|
+
map: o,
|
|
238
|
+
onResultSelect: f,
|
|
239
|
+
onStateChange: e,
|
|
240
|
+
position: a = "top-right",
|
|
241
|
+
...l
|
|
242
|
+
}) {
|
|
243
|
+
const t = R(null);
|
|
244
|
+
return y(() => {
|
|
245
|
+
if (!o) return;
|
|
246
|
+
const r = new S({ position: a, ...l });
|
|
247
|
+
if (t.current = r, e) {
|
|
248
|
+
const s = (n) => {
|
|
249
|
+
e(n.state);
|
|
250
|
+
};
|
|
251
|
+
r.on("update", s), r.on("show", s), r.on("hide", s), r.on("expand", s), r.on("collapse", s), r.on("search", s), r.on("clear", s);
|
|
252
|
+
}
|
|
253
|
+
return f && r.on("resultselect", (s) => {
|
|
254
|
+
s.result && f(s.result);
|
|
255
|
+
}), o.addControl(r, a), () => {
|
|
256
|
+
o.hasControl(r) && o.removeControl(r), t.current = null;
|
|
257
|
+
};
|
|
258
|
+
}, [o, a, e, f]), y(() => {
|
|
259
|
+
if (t.current) {
|
|
260
|
+
const r = {};
|
|
261
|
+
l.visible !== void 0 && (r.visible = l.visible), l.collapsed !== void 0 && (r.collapsed = l.collapsed), l.placeholder !== void 0 && (r.placeholder = l.placeholder), l.maxResults !== void 0 && (r.maxResults = l.maxResults), l.flyToZoom !== void 0 && (r.flyToZoom = l.flyToZoom), l.showMarker !== void 0 && (r.showMarker = l.showMarker), l.markerColor !== void 0 && (r.markerColor = l.markerColor), l.backgroundColor !== void 0 && (r.backgroundColor = l.backgroundColor), l.borderRadius !== void 0 && (r.borderRadius = l.borderRadius), l.opacity !== void 0 && (r.opacity = l.opacity), l.width !== void 0 && (r.width = l.width), l.fontSize !== void 0 && (r.fontSize = l.fontSize), l.fontColor !== void 0 && (r.fontColor = l.fontColor), l.minzoom !== void 0 && (r.minzoom = l.minzoom), l.maxzoom !== void 0 && (r.maxzoom = l.maxzoom), Object.keys(r).length > 0 && t.current.update(r);
|
|
262
|
+
}
|
|
263
|
+
}, [
|
|
264
|
+
l.visible,
|
|
265
|
+
l.collapsed,
|
|
266
|
+
l.placeholder,
|
|
267
|
+
l.maxResults,
|
|
268
|
+
l.flyToZoom,
|
|
269
|
+
l.showMarker,
|
|
270
|
+
l.markerColor,
|
|
271
|
+
l.backgroundColor,
|
|
272
|
+
l.borderRadius,
|
|
273
|
+
l.opacity,
|
|
274
|
+
l.width,
|
|
275
|
+
l.fontSize,
|
|
276
|
+
l.fontColor,
|
|
277
|
+
l.minzoom,
|
|
278
|
+
l.maxzoom
|
|
279
|
+
]), null;
|
|
280
|
+
}
|
|
281
|
+
function ce({
|
|
282
|
+
map: o,
|
|
283
|
+
onDatasetLoad: f,
|
|
284
|
+
onError: e,
|
|
285
|
+
onStateChange: a,
|
|
286
|
+
position: l = "top-right",
|
|
287
|
+
...t
|
|
288
|
+
}) {
|
|
289
|
+
const r = R(null);
|
|
290
|
+
return y(() => {
|
|
291
|
+
if (!o) return;
|
|
292
|
+
const s = new N({ position: l, ...t });
|
|
293
|
+
if (r.current = s, a) {
|
|
294
|
+
const n = (b) => {
|
|
295
|
+
a(b.state);
|
|
296
|
+
};
|
|
297
|
+
s.on("update", n), s.on("show", n), s.on("hide", n);
|
|
298
|
+
}
|
|
299
|
+
if (f) {
|
|
300
|
+
const n = (b) => {
|
|
301
|
+
b.dataset && f(b.dataset);
|
|
302
|
+
};
|
|
303
|
+
s.on("load", n);
|
|
304
|
+
}
|
|
305
|
+
if (e) {
|
|
306
|
+
const n = (b) => {
|
|
307
|
+
b.error && e(b.error, b.filename);
|
|
308
|
+
};
|
|
309
|
+
s.on("error", n);
|
|
310
|
+
}
|
|
311
|
+
return o.addControl(s, l), () => {
|
|
312
|
+
o.hasControl(s) && o.removeControl(s), r.current = null;
|
|
313
|
+
};
|
|
314
|
+
}, [o]), y(() => {
|
|
315
|
+
if (r.current) {
|
|
316
|
+
const s = Object.fromEntries(
|
|
317
|
+
Object.entries(t).filter(([, n]) => n !== void 0)
|
|
318
|
+
);
|
|
319
|
+
Object.keys(s).length > 0 && r.current.update(s);
|
|
320
|
+
}
|
|
321
|
+
}, [
|
|
322
|
+
t.visible,
|
|
323
|
+
t.showDropZone,
|
|
324
|
+
t.fitBounds,
|
|
325
|
+
t.fitBoundsPadding,
|
|
326
|
+
t.backgroundColor,
|
|
327
|
+
t.borderRadius,
|
|
328
|
+
t.opacity,
|
|
329
|
+
t.minzoom,
|
|
330
|
+
t.maxzoom
|
|
331
|
+
]), null;
|
|
332
|
+
}
|
|
333
|
+
function se({
|
|
334
|
+
map: o,
|
|
335
|
+
onFeatureSelect: f,
|
|
336
|
+
onInspect: e,
|
|
337
|
+
onToggle: a,
|
|
338
|
+
onStateChange: l,
|
|
339
|
+
position: t = "top-right",
|
|
340
|
+
...r
|
|
341
|
+
}) {
|
|
342
|
+
const s = R(null);
|
|
343
|
+
return y(() => {
|
|
344
|
+
if (!o) return;
|
|
345
|
+
const n = new Z({ position: t, ...r });
|
|
346
|
+
if (s.current = n, l) {
|
|
347
|
+
const b = (C) => {
|
|
348
|
+
l(C.state);
|
|
349
|
+
};
|
|
350
|
+
n.on("update", b), n.on("show", b), n.on("hide", b), n.on("enable", b), n.on("disable", b), n.on("clear", b);
|
|
351
|
+
}
|
|
352
|
+
return f && n.on("featureselect", (b) => {
|
|
353
|
+
f(b.feature || null);
|
|
354
|
+
}), e && n.on(
|
|
355
|
+
"featureselect",
|
|
356
|
+
(b) => {
|
|
357
|
+
b.features && e(b.features);
|
|
358
|
+
}
|
|
359
|
+
), a && (n.on("enable", () => a(!0)), n.on("disable", () => a(!1))), o.addControl(n, t), () => {
|
|
360
|
+
o.hasControl(n) && o.removeControl(n), s.current = null;
|
|
361
|
+
};
|
|
362
|
+
}, [o, t, l, f, e, a]), y(() => {
|
|
363
|
+
if (s.current) {
|
|
364
|
+
const n = {};
|
|
365
|
+
r.visible !== void 0 && (n.visible = r.visible), r.enabled !== void 0 && (n.enabled = r.enabled), r.maxFeatures !== void 0 && (n.maxFeatures = r.maxFeatures), r.showGeometryType !== void 0 && (n.showGeometryType = r.showGeometryType), r.showLayerName !== void 0 && (n.showLayerName = r.showLayerName), r.maxWidth !== void 0 && (n.maxWidth = r.maxWidth), r.maxHeight !== void 0 && (n.maxHeight = r.maxHeight), r.backgroundColor !== void 0 && (n.backgroundColor = r.backgroundColor), r.borderRadius !== void 0 && (n.borderRadius = r.borderRadius), r.opacity !== void 0 && (n.opacity = r.opacity), r.fontSize !== void 0 && (n.fontSize = r.fontSize), r.fontColor !== void 0 && (n.fontColor = r.fontColor), r.minzoom !== void 0 && (n.minzoom = r.minzoom), r.maxzoom !== void 0 && (n.maxzoom = r.maxzoom), Object.keys(n).length > 0 && s.current.update(n);
|
|
366
|
+
}
|
|
367
|
+
}, [
|
|
368
|
+
r.visible,
|
|
369
|
+
r.enabled,
|
|
370
|
+
r.maxFeatures,
|
|
371
|
+
r.showGeometryType,
|
|
372
|
+
r.showLayerName,
|
|
373
|
+
r.maxWidth,
|
|
374
|
+
r.maxHeight,
|
|
375
|
+
r.backgroundColor,
|
|
376
|
+
r.borderRadius,
|
|
377
|
+
r.opacity,
|
|
378
|
+
r.fontSize,
|
|
379
|
+
r.fontColor,
|
|
380
|
+
r.minzoom,
|
|
381
|
+
r.maxzoom
|
|
382
|
+
]), null;
|
|
383
|
+
}
|
|
384
|
+
function ae({
|
|
385
|
+
map: o,
|
|
386
|
+
onBBoxDraw: f,
|
|
387
|
+
onDrawingToggle: e,
|
|
388
|
+
onStateChange: a,
|
|
389
|
+
position: l = "bottom-left",
|
|
390
|
+
...t
|
|
391
|
+
}) {
|
|
392
|
+
const r = R(null);
|
|
393
|
+
return y(() => {
|
|
394
|
+
if (!o) return;
|
|
395
|
+
const s = new q({ position: l, ...t });
|
|
396
|
+
if (r.current = s, a) {
|
|
397
|
+
const n = (b) => {
|
|
398
|
+
a(b.state);
|
|
399
|
+
};
|
|
400
|
+
s.on("update", n), s.on("show", n), s.on("hide", n), s.on("expand", n), s.on("collapse", n), s.on("viewchange", n);
|
|
401
|
+
}
|
|
402
|
+
return f && s.on(
|
|
403
|
+
"bboxdraw",
|
|
404
|
+
(n) => {
|
|
405
|
+
n.bbox && f(n.bbox);
|
|
406
|
+
}
|
|
407
|
+
), e && (s.on("drawstart", () => e(!0)), s.on("drawend", () => e(!1))), o.addControl(s, l), () => {
|
|
408
|
+
o.hasControl(s) && o.removeControl(s), r.current = null;
|
|
409
|
+
};
|
|
410
|
+
}, [o, l, a, f, e]), y(() => {
|
|
411
|
+
if (r.current) {
|
|
412
|
+
const s = {};
|
|
413
|
+
t.visible !== void 0 && (s.visible = t.visible), t.collapsed !== void 0 && (s.collapsed = t.collapsed), t.precision !== void 0 && (s.precision = t.precision), t.panelWidth !== void 0 && (s.panelWidth = t.panelWidth), t.backgroundColor !== void 0 && (s.backgroundColor = t.backgroundColor), t.borderRadius !== void 0 && (s.borderRadius = t.borderRadius), t.opacity !== void 0 && (s.opacity = t.opacity), t.fontSize !== void 0 && (s.fontSize = t.fontSize), t.fontColor !== void 0 && (s.fontColor = t.fontColor), t.minzoom !== void 0 && (s.minzoom = t.minzoom), t.maxzoom !== void 0 && (s.maxzoom = t.maxzoom), Object.keys(s).length > 0 && r.current.update(s);
|
|
414
|
+
}
|
|
415
|
+
}, [
|
|
416
|
+
t.visible,
|
|
417
|
+
t.collapsed,
|
|
418
|
+
t.precision,
|
|
419
|
+
t.panelWidth,
|
|
420
|
+
t.backgroundColor,
|
|
421
|
+
t.borderRadius,
|
|
422
|
+
t.opacity,
|
|
423
|
+
t.fontSize,
|
|
424
|
+
t.fontColor,
|
|
425
|
+
t.minzoom,
|
|
426
|
+
t.maxzoom
|
|
427
|
+
]), null;
|
|
428
|
+
}
|
|
429
|
+
function oe({
|
|
430
|
+
map: o,
|
|
431
|
+
onStateChange: f,
|
|
432
|
+
position: e = "top-right",
|
|
433
|
+
controls: a = [],
|
|
434
|
+
...l
|
|
435
|
+
}) {
|
|
436
|
+
const t = R(null);
|
|
437
|
+
return y(() => {
|
|
438
|
+
if (!o) return;
|
|
439
|
+
const r = new P({
|
|
440
|
+
position: e,
|
|
441
|
+
...l,
|
|
442
|
+
controls: []
|
|
443
|
+
// Sync via effect below to avoid duplicate mount
|
|
444
|
+
});
|
|
445
|
+
if (t.current = r, f) {
|
|
446
|
+
const s = (n) => {
|
|
447
|
+
f(n.state);
|
|
448
|
+
};
|
|
449
|
+
r.on("update", s), r.on("show", s), r.on("hide", s), r.on("expand", s), r.on("collapse", s);
|
|
450
|
+
}
|
|
451
|
+
return o.addControl(r, e), () => {
|
|
452
|
+
o.hasControl(r) && o.removeControl(r), t.current = null;
|
|
453
|
+
};
|
|
454
|
+
}, [o, e, f]), y(() => {
|
|
455
|
+
const r = t.current;
|
|
456
|
+
if (!r) return;
|
|
457
|
+
const s = r.getControls(), n = a;
|
|
458
|
+
for (const b of n)
|
|
459
|
+
s.includes(b) || r.addControl(b);
|
|
460
|
+
for (const b of s)
|
|
461
|
+
n.includes(b) || r.removeControl(b);
|
|
462
|
+
}, [a]), y(() => {
|
|
463
|
+
const r = t.current;
|
|
464
|
+
if (!r) return;
|
|
465
|
+
const s = {};
|
|
466
|
+
l.visible !== void 0 && (s.visible = l.visible), l.collapsed !== void 0 && (s.collapsed = l.collapsed), l.title !== void 0 && (s.title = l.title), l.rows !== void 0 && (s.rows = l.rows), l.columns !== void 0 && (s.columns = l.columns), l.showRowColumnControls !== void 0 && (s.showRowColumnControls = l.showRowColumnControls), l.collapsible !== void 0 && (s.collapsible = l.collapsible), l.backgroundColor !== void 0 && (s.backgroundColor = l.backgroundColor), l.padding !== void 0 && (s.padding = l.padding), l.borderRadius !== void 0 && (s.borderRadius = l.borderRadius), l.opacity !== void 0 && (s.opacity = l.opacity), l.gap !== void 0 && (s.gap = l.gap), l.minzoom !== void 0 && (s.minzoom = l.minzoom), l.maxzoom !== void 0 && (s.maxzoom = l.maxzoom), Object.keys(s).length > 0 && r.update(s);
|
|
467
|
+
}, [
|
|
468
|
+
l.visible,
|
|
469
|
+
l.collapsed,
|
|
470
|
+
l.title,
|
|
471
|
+
l.rows,
|
|
472
|
+
l.columns,
|
|
473
|
+
l.showRowColumnControls,
|
|
474
|
+
l.collapsible,
|
|
475
|
+
l.backgroundColor,
|
|
476
|
+
l.padding,
|
|
477
|
+
l.borderRadius,
|
|
478
|
+
l.opacity,
|
|
479
|
+
l.gap,
|
|
480
|
+
l.minzoom,
|
|
481
|
+
l.maxzoom
|
|
482
|
+
]), null;
|
|
483
|
+
}
|
|
484
|
+
function de({
|
|
485
|
+
map: o,
|
|
486
|
+
onLayerAdd: f,
|
|
487
|
+
onLayerRemove: e,
|
|
488
|
+
onLayerUpdate: a,
|
|
489
|
+
onError: l,
|
|
490
|
+
onStateChange: t,
|
|
491
|
+
position: r = "top-right",
|
|
492
|
+
...s
|
|
493
|
+
}) {
|
|
494
|
+
const n = R(null);
|
|
495
|
+
return y(() => {
|
|
496
|
+
if (!o) return;
|
|
497
|
+
const b = new Q({ position: r, ...s });
|
|
498
|
+
if (n.current = b, t) {
|
|
499
|
+
const C = (v) => {
|
|
500
|
+
t(v.state);
|
|
501
|
+
};
|
|
502
|
+
b.on("update", C), b.on("show", C), b.on("hide", C), b.on("expand", C), b.on("collapse", C);
|
|
503
|
+
}
|
|
504
|
+
return f && b.on("layeradd", (C) => {
|
|
505
|
+
C.url && f(C.url);
|
|
506
|
+
}), e && b.on("layerremove", () => {
|
|
507
|
+
e();
|
|
508
|
+
}), a && b.on("layerupdate", (C) => {
|
|
509
|
+
C.url && a(C.url);
|
|
510
|
+
}), l && b.on("error", (C) => {
|
|
511
|
+
C.error && l(C.error);
|
|
512
|
+
}), o.addControl(b, r), () => {
|
|
513
|
+
o.hasControl(b) && o.removeControl(b), n.current = null;
|
|
514
|
+
};
|
|
515
|
+
}, [o]), y(() => {
|
|
516
|
+
if (n.current) {
|
|
517
|
+
const b = Object.fromEntries(
|
|
518
|
+
Object.entries(s).filter(([, C]) => C !== void 0)
|
|
519
|
+
);
|
|
520
|
+
Object.keys(b).length > 0 && n.current.update(b);
|
|
521
|
+
}
|
|
522
|
+
}, [
|
|
523
|
+
s.visible,
|
|
524
|
+
s.collapsed,
|
|
525
|
+
s.backgroundColor,
|
|
526
|
+
s.borderRadius,
|
|
527
|
+
s.opacity,
|
|
528
|
+
s.panelWidth,
|
|
529
|
+
s.fontSize,
|
|
530
|
+
s.fontColor,
|
|
531
|
+
s.minzoom,
|
|
532
|
+
s.maxzoom
|
|
533
|
+
]), null;
|
|
534
|
+
}
|
|
535
|
+
function ne({
|
|
536
|
+
map: o,
|
|
537
|
+
onStateChange: f,
|
|
538
|
+
position: e = "bottom-left",
|
|
539
|
+
...a
|
|
540
|
+
}) {
|
|
541
|
+
const l = R(null);
|
|
542
|
+
return y(() => {
|
|
543
|
+
if (!o) return;
|
|
544
|
+
const t = new Y({ position: e, ...a });
|
|
545
|
+
if (l.current = t, f) {
|
|
546
|
+
const r = (s) => {
|
|
547
|
+
f(s.state);
|
|
548
|
+
};
|
|
549
|
+
t.on("show", r), t.on("hide", r), t.on("expand", r), t.on("collapse", r);
|
|
550
|
+
}
|
|
551
|
+
return o.addControl(t, e), () => {
|
|
552
|
+
o.hasControl(t) && o.removeControl(t), l.current = null;
|
|
553
|
+
};
|
|
554
|
+
}, [o]), null;
|
|
555
|
+
}
|
|
556
|
+
const T = {
|
|
557
|
+
visible: !0,
|
|
558
|
+
vmin: 0,
|
|
559
|
+
vmax: 1,
|
|
560
|
+
colormap: "viridis"
|
|
561
|
+
};
|
|
562
|
+
function ue(o) {
|
|
563
|
+
const [f, e] = k({
|
|
564
|
+
...T,
|
|
565
|
+
...o
|
|
566
|
+
}), a = c((g) => {
|
|
567
|
+
e((u) => ({ ...u, visible: g }));
|
|
568
|
+
}, []), l = c((g) => {
|
|
569
|
+
e((u) => ({ ...u, vmin: g }));
|
|
570
|
+
}, []), t = c((g) => {
|
|
571
|
+
e((u) => ({ ...u, vmax: g }));
|
|
572
|
+
}, []), r = c((g, u) => {
|
|
573
|
+
e((m) => ({ ...m, vmin: g, vmax: u }));
|
|
574
|
+
}, []), s = c((g) => {
|
|
575
|
+
e((u) => ({ ...u, colormap: g }));
|
|
576
|
+
}, []), n = c(() => {
|
|
577
|
+
e((g) => ({ ...g, visible: !0 }));
|
|
578
|
+
}, []), b = c(() => {
|
|
579
|
+
e((g) => ({ ...g, visible: !1 }));
|
|
580
|
+
}, []), C = c(() => {
|
|
581
|
+
e((g) => ({ ...g, visible: !g.visible }));
|
|
582
|
+
}, []), v = c(() => {
|
|
583
|
+
e({ ...T, ...o });
|
|
584
|
+
}, [o]);
|
|
585
|
+
return {
|
|
586
|
+
state: f,
|
|
587
|
+
setState: e,
|
|
588
|
+
setVisible: a,
|
|
589
|
+
setVmin: l,
|
|
590
|
+
setVmax: t,
|
|
591
|
+
setRange: r,
|
|
592
|
+
setColormap: s,
|
|
593
|
+
show: n,
|
|
594
|
+
hide: b,
|
|
595
|
+
toggle: C,
|
|
596
|
+
reset: v
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
const E = {
|
|
600
|
+
visible: !0,
|
|
601
|
+
collapsed: !1,
|
|
602
|
+
items: []
|
|
603
|
+
};
|
|
604
|
+
function ie(o) {
|
|
605
|
+
const [f, e] = k({
|
|
606
|
+
...E,
|
|
607
|
+
...o
|
|
608
|
+
}), a = c((x) => {
|
|
609
|
+
e((h) => ({ ...h, visible: x }));
|
|
610
|
+
}, []), l = c((x) => {
|
|
611
|
+
e((h) => ({ ...h, collapsed: x }));
|
|
612
|
+
}, []), t = c((x) => {
|
|
613
|
+
e((h) => ({ ...h, items: [...x] }));
|
|
614
|
+
}, []), r = c((x) => {
|
|
615
|
+
e((h) => ({ ...h, items: [...h.items, x] }));
|
|
616
|
+
}, []), s = c((x) => {
|
|
617
|
+
e((h) => ({
|
|
618
|
+
...h,
|
|
619
|
+
items: h.items.filter((i) => i.label !== x)
|
|
620
|
+
}));
|
|
621
|
+
}, []), n = c(
|
|
622
|
+
(x, h) => {
|
|
623
|
+
e((i) => ({
|
|
624
|
+
...i,
|
|
625
|
+
items: i.items.map(
|
|
626
|
+
(d) => d.label === x ? { ...d, ...h } : d
|
|
627
|
+
)
|
|
628
|
+
}));
|
|
629
|
+
},
|
|
630
|
+
[]
|
|
631
|
+
), b = c(() => {
|
|
632
|
+
e((x) => ({ ...x, visible: !0 }));
|
|
633
|
+
}, []), C = c(() => {
|
|
634
|
+
e((x) => ({ ...x, visible: !1 }));
|
|
635
|
+
}, []), v = c(() => {
|
|
636
|
+
e((x) => ({ ...x, collapsed: !1 }));
|
|
637
|
+
}, []), g = c(() => {
|
|
638
|
+
e((x) => ({ ...x, collapsed: !0 }));
|
|
639
|
+
}, []), u = c(() => {
|
|
640
|
+
e((x) => ({ ...x, collapsed: !x.collapsed }));
|
|
641
|
+
}, []), m = c(() => {
|
|
642
|
+
e((x) => ({ ...x, visible: !x.visible }));
|
|
643
|
+
}, []), z = c(() => {
|
|
644
|
+
e({ ...E, ...o });
|
|
645
|
+
}, [o]);
|
|
646
|
+
return {
|
|
647
|
+
state: f,
|
|
648
|
+
setState: e,
|
|
649
|
+
setVisible: a,
|
|
650
|
+
setCollapsed: l,
|
|
651
|
+
setItems: t,
|
|
652
|
+
addItem: r,
|
|
653
|
+
removeItem: s,
|
|
654
|
+
updateItem: n,
|
|
655
|
+
show: b,
|
|
656
|
+
hide: C,
|
|
657
|
+
expand: v,
|
|
658
|
+
collapse: g,
|
|
659
|
+
toggle: u,
|
|
660
|
+
toggleVisibility: m,
|
|
661
|
+
reset: z
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
const F = {
|
|
665
|
+
visible: !0,
|
|
666
|
+
collapsed: !1,
|
|
667
|
+
html: ""
|
|
668
|
+
};
|
|
669
|
+
function fe(o) {
|
|
670
|
+
const [f, e] = k({
|
|
671
|
+
...F,
|
|
672
|
+
...o
|
|
673
|
+
}), a = c((u) => {
|
|
674
|
+
e((m) => ({ ...m, visible: u }));
|
|
675
|
+
}, []), l = c((u) => {
|
|
676
|
+
e((m) => ({ ...m, html: u }));
|
|
677
|
+
}, []), t = c(() => {
|
|
678
|
+
e((u) => ({ ...u, visible: !0 }));
|
|
679
|
+
}, []), r = c(() => {
|
|
680
|
+
e((u) => ({ ...u, visible: !1 }));
|
|
681
|
+
}, []), s = c(() => {
|
|
682
|
+
e((u) => ({ ...u, visible: !u.visible }));
|
|
683
|
+
}, []), n = c((u) => {
|
|
684
|
+
e((m) => ({ ...m, collapsed: u }));
|
|
685
|
+
}, []), b = c(() => {
|
|
686
|
+
e((u) => ({ ...u, collapsed: !1 }));
|
|
687
|
+
}, []), C = c(() => {
|
|
688
|
+
e((u) => ({ ...u, collapsed: !0 }));
|
|
689
|
+
}, []), v = c(() => {
|
|
690
|
+
e((u) => ({ ...u, collapsed: !u.collapsed }));
|
|
691
|
+
}, []), g = c(() => {
|
|
692
|
+
e({ ...F, ...o });
|
|
693
|
+
}, [o]);
|
|
694
|
+
return {
|
|
695
|
+
state: f,
|
|
696
|
+
setState: e,
|
|
697
|
+
setVisible: a,
|
|
698
|
+
setHtml: l,
|
|
699
|
+
setCollapsed: n,
|
|
700
|
+
show: t,
|
|
701
|
+
hide: r,
|
|
702
|
+
expand: b,
|
|
703
|
+
collapse: C,
|
|
704
|
+
toggle: v,
|
|
705
|
+
toggleVisibility: s,
|
|
706
|
+
reset: g
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
const V = {
|
|
710
|
+
visible: !0,
|
|
711
|
+
collapsed: !0,
|
|
712
|
+
selectedBasemap: null,
|
|
713
|
+
searchText: "",
|
|
714
|
+
loading: !1,
|
|
715
|
+
error: null,
|
|
716
|
+
belowLabels: !1
|
|
717
|
+
};
|
|
718
|
+
function be(o) {
|
|
719
|
+
const [f, e] = k({
|
|
720
|
+
...V,
|
|
721
|
+
...o
|
|
722
|
+
}), a = c((i) => {
|
|
723
|
+
e((d) => ({ ...d, visible: i }));
|
|
724
|
+
}, []), l = c((i) => {
|
|
725
|
+
e((d) => ({ ...d, collapsed: i }));
|
|
726
|
+
}, []), t = c((i) => {
|
|
727
|
+
e((d) => ({ ...d, selectedBasemap: i }));
|
|
728
|
+
}, []), r = c((i) => {
|
|
729
|
+
e((d) => ({ ...d, searchText: i }));
|
|
730
|
+
}, []), s = c((i) => {
|
|
731
|
+
e((d) => ({ ...d, loading: i }));
|
|
732
|
+
}, []), n = c((i) => {
|
|
733
|
+
e((d) => ({ ...d, error: i }));
|
|
734
|
+
}, []), b = c((i) => {
|
|
735
|
+
e((d) => ({ ...d, belowLabels: i }));
|
|
736
|
+
}, []), C = c(() => {
|
|
737
|
+
e((i) => ({ ...i, visible: !0 }));
|
|
738
|
+
}, []), v = c(() => {
|
|
739
|
+
e((i) => ({ ...i, visible: !1 }));
|
|
740
|
+
}, []), g = c(() => {
|
|
741
|
+
e((i) => ({ ...i, collapsed: !1 }));
|
|
742
|
+
}, []), u = c(() => {
|
|
743
|
+
e((i) => ({ ...i, collapsed: !0 }));
|
|
744
|
+
}, []), m = c(() => {
|
|
745
|
+
e((i) => ({ ...i, collapsed: !i.collapsed }));
|
|
746
|
+
}, []), z = c(() => {
|
|
747
|
+
e((i) => ({ ...i, visible: !i.visible }));
|
|
748
|
+
}, []), x = c(() => {
|
|
749
|
+
e((i) => ({ ...i, searchText: "" }));
|
|
750
|
+
}, []), h = c(() => {
|
|
751
|
+
e({ ...V, ...o });
|
|
752
|
+
}, [o]);
|
|
753
|
+
return {
|
|
754
|
+
state: f,
|
|
755
|
+
setState: e,
|
|
756
|
+
setVisible: a,
|
|
757
|
+
setCollapsed: l,
|
|
758
|
+
setBasemap: t,
|
|
759
|
+
setSearch: r,
|
|
760
|
+
setLoading: s,
|
|
761
|
+
setError: n,
|
|
762
|
+
setBelowLabels: b,
|
|
763
|
+
show: C,
|
|
764
|
+
hide: v,
|
|
765
|
+
expand: g,
|
|
766
|
+
collapse: u,
|
|
767
|
+
toggle: m,
|
|
768
|
+
toggleVisibility: z,
|
|
769
|
+
clearSearch: x,
|
|
770
|
+
reset: h
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
const L = {
|
|
774
|
+
visible: !0,
|
|
775
|
+
enabled: !1,
|
|
776
|
+
exaggeration: 1,
|
|
777
|
+
hillshade: !0
|
|
778
|
+
};
|
|
779
|
+
function me(o) {
|
|
780
|
+
const [f, e] = k({
|
|
781
|
+
...L,
|
|
782
|
+
...o
|
|
783
|
+
}), a = c((h) => {
|
|
784
|
+
e((i) => ({ ...i, visible: h }));
|
|
785
|
+
}, []), l = c((h) => {
|
|
786
|
+
e((i) => ({ ...i, enabled: h }));
|
|
787
|
+
}, []), t = c((h) => {
|
|
788
|
+
const i = Math.max(0.1, Math.min(10, h));
|
|
789
|
+
e((d) => ({ ...d, exaggeration: i }));
|
|
790
|
+
}, []), r = c((h) => {
|
|
791
|
+
e((i) => ({ ...i, hillshade: h }));
|
|
792
|
+
}, []), s = c(() => {
|
|
793
|
+
e((h) => ({ ...h, enabled: !0 }));
|
|
794
|
+
}, []), n = c(() => {
|
|
795
|
+
e((h) => ({ ...h, enabled: !1 }));
|
|
796
|
+
}, []), b = c(() => {
|
|
797
|
+
e((h) => ({ ...h, enabled: !h.enabled }));
|
|
798
|
+
}, []), C = c(() => {
|
|
799
|
+
e((h) => ({ ...h, visible: !0 }));
|
|
800
|
+
}, []), v = c(() => {
|
|
801
|
+
e((h) => ({ ...h, visible: !1 }));
|
|
802
|
+
}, []), g = c(() => {
|
|
803
|
+
e((h) => ({ ...h, visible: !h.visible }));
|
|
804
|
+
}, []), u = c(() => {
|
|
805
|
+
e((h) => ({ ...h, hillshade: !0 }));
|
|
806
|
+
}, []), m = c(() => {
|
|
807
|
+
e((h) => ({ ...h, hillshade: !1 }));
|
|
808
|
+
}, []), z = c(() => {
|
|
809
|
+
e((h) => ({ ...h, hillshade: !h.hillshade }));
|
|
810
|
+
}, []), x = c(() => {
|
|
811
|
+
e({ ...L, ...o });
|
|
812
|
+
}, [o]);
|
|
813
|
+
return {
|
|
814
|
+
state: f,
|
|
815
|
+
setState: e,
|
|
816
|
+
setVisible: a,
|
|
817
|
+
setEnabled: l,
|
|
818
|
+
setExaggeration: t,
|
|
819
|
+
setHillshade: r,
|
|
820
|
+
enable: s,
|
|
821
|
+
disable: n,
|
|
822
|
+
toggle: b,
|
|
823
|
+
show: C,
|
|
824
|
+
hide: v,
|
|
825
|
+
toggleVisibility: g,
|
|
826
|
+
enableHillshade: u,
|
|
827
|
+
disableHillshade: m,
|
|
828
|
+
toggleHillshade: z,
|
|
829
|
+
reset: x
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
const O = {
|
|
833
|
+
visible: !0,
|
|
834
|
+
collapsed: !0,
|
|
835
|
+
query: "",
|
|
836
|
+
results: [],
|
|
837
|
+
loading: !1,
|
|
838
|
+
selectedResult: null,
|
|
839
|
+
error: null
|
|
840
|
+
};
|
|
841
|
+
function he(o) {
|
|
842
|
+
const [f, e] = k({
|
|
843
|
+
...O,
|
|
844
|
+
...o
|
|
845
|
+
}), a = c((i) => {
|
|
846
|
+
e((d) => ({ ...d, visible: i }));
|
|
847
|
+
}, []), l = c((i) => {
|
|
848
|
+
e((d) => ({ ...d, collapsed: i }));
|
|
849
|
+
}, []), t = c((i) => {
|
|
850
|
+
e((d) => ({ ...d, query: i }));
|
|
851
|
+
}, []), r = c((i) => {
|
|
852
|
+
e((d) => ({ ...d, results: i }));
|
|
853
|
+
}, []), s = c((i) => {
|
|
854
|
+
e((d) => ({ ...d, loading: i }));
|
|
855
|
+
}, []), n = c((i) => {
|
|
856
|
+
e((d) => ({ ...d, selectedResult: i }));
|
|
857
|
+
}, []), b = c((i) => {
|
|
858
|
+
e((d) => ({ ...d, error: i }));
|
|
859
|
+
}, []), C = c(() => {
|
|
860
|
+
e((i) => ({ ...i, visible: !0 }));
|
|
861
|
+
}, []), v = c(() => {
|
|
862
|
+
e((i) => ({ ...i, visible: !1 }));
|
|
863
|
+
}, []), g = c(() => {
|
|
864
|
+
e((i) => ({ ...i, visible: !i.visible }));
|
|
865
|
+
}, []), u = c(() => {
|
|
866
|
+
e((i) => ({ ...i, collapsed: !1 }));
|
|
867
|
+
}, []), m = c(() => {
|
|
868
|
+
e((i) => ({ ...i, collapsed: !0, results: [] }));
|
|
869
|
+
}, []), z = c(() => {
|
|
870
|
+
e((i) => ({
|
|
871
|
+
...i,
|
|
872
|
+
collapsed: !i.collapsed,
|
|
873
|
+
results: i.collapsed ? i.results : []
|
|
874
|
+
}));
|
|
875
|
+
}, []), x = c(() => {
|
|
876
|
+
e((i) => ({
|
|
877
|
+
...i,
|
|
878
|
+
query: "",
|
|
879
|
+
results: [],
|
|
880
|
+
selectedResult: null,
|
|
881
|
+
error: null
|
|
882
|
+
}));
|
|
883
|
+
}, []), h = c(() => {
|
|
884
|
+
e({ ...O, ...o });
|
|
885
|
+
}, [o]);
|
|
886
|
+
return {
|
|
887
|
+
state: f,
|
|
888
|
+
setState: e,
|
|
889
|
+
setVisible: a,
|
|
890
|
+
setCollapsed: l,
|
|
891
|
+
setQuery: t,
|
|
892
|
+
setResults: r,
|
|
893
|
+
setLoading: s,
|
|
894
|
+
selectResult: n,
|
|
895
|
+
setError: b,
|
|
896
|
+
show: C,
|
|
897
|
+
hide: v,
|
|
898
|
+
expand: u,
|
|
899
|
+
collapse: m,
|
|
900
|
+
toggle: z,
|
|
901
|
+
toggleVisibility: g,
|
|
902
|
+
clear: x,
|
|
903
|
+
reset: h
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
const j = {
|
|
907
|
+
visible: !0,
|
|
908
|
+
isDragging: !1,
|
|
909
|
+
isLoading: !1,
|
|
910
|
+
loadedDatasets: [],
|
|
911
|
+
error: null
|
|
912
|
+
};
|
|
913
|
+
function Ce(o) {
|
|
914
|
+
const [f, e] = k({
|
|
915
|
+
...j,
|
|
916
|
+
...o
|
|
917
|
+
}), a = c((u) => {
|
|
918
|
+
e((m) => ({ ...m, visible: u }));
|
|
919
|
+
}, []), l = c(() => {
|
|
920
|
+
e((u) => ({ ...u, visible: !0 }));
|
|
921
|
+
}, []), t = c(() => {
|
|
922
|
+
e((u) => ({ ...u, visible: !1 }));
|
|
923
|
+
}, []), r = c(() => {
|
|
924
|
+
e((u) => ({ ...u, visible: !u.visible }));
|
|
925
|
+
}, []), s = c((u) => {
|
|
926
|
+
e((m) => ({
|
|
927
|
+
...m,
|
|
928
|
+
loadedDatasets: [...m.loadedDatasets, u],
|
|
929
|
+
error: null
|
|
930
|
+
}));
|
|
931
|
+
}, []), n = c((u) => {
|
|
932
|
+
e((m) => ({
|
|
933
|
+
...m,
|
|
934
|
+
loadedDatasets: m.loadedDatasets.filter((z) => z.id !== u)
|
|
935
|
+
}));
|
|
936
|
+
}, []), b = c(() => {
|
|
937
|
+
e((u) => ({
|
|
938
|
+
...u,
|
|
939
|
+
loadedDatasets: []
|
|
940
|
+
}));
|
|
941
|
+
}, []), C = c((u) => {
|
|
942
|
+
e((m) => ({ ...m, error: u }));
|
|
943
|
+
}, []), v = c(() => {
|
|
944
|
+
e((u) => ({ ...u, error: null }));
|
|
945
|
+
}, []), g = c(() => {
|
|
946
|
+
e({ ...j, ...o });
|
|
947
|
+
}, [o]);
|
|
948
|
+
return {
|
|
949
|
+
state: f,
|
|
950
|
+
setState: e,
|
|
951
|
+
setVisible: a,
|
|
952
|
+
show: l,
|
|
953
|
+
hide: t,
|
|
954
|
+
toggleVisibility: r,
|
|
955
|
+
addDataset: s,
|
|
956
|
+
removeDataset: n,
|
|
957
|
+
clearAll: b,
|
|
958
|
+
setError: C,
|
|
959
|
+
clearError: v,
|
|
960
|
+
reset: g
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
const A = {
|
|
964
|
+
visible: !0,
|
|
965
|
+
enabled: !1,
|
|
966
|
+
inspectedFeatures: [],
|
|
967
|
+
selectedIndex: 0,
|
|
968
|
+
error: null
|
|
969
|
+
};
|
|
970
|
+
function ge(o) {
|
|
971
|
+
const [f, e] = k({
|
|
972
|
+
...A,
|
|
973
|
+
...o
|
|
974
|
+
}), a = c((d) => {
|
|
975
|
+
e((w) => ({ ...w, visible: d }));
|
|
976
|
+
}, []), l = c((d) => {
|
|
977
|
+
e((w) => ({ ...w, enabled: d }));
|
|
978
|
+
}, []), t = c(() => {
|
|
979
|
+
e((d) => ({ ...d, enabled: !0 }));
|
|
980
|
+
}, []), r = c(() => {
|
|
981
|
+
e((d) => ({
|
|
982
|
+
...d,
|
|
983
|
+
enabled: !1,
|
|
984
|
+
inspectedFeatures: [],
|
|
985
|
+
selectedIndex: 0
|
|
986
|
+
}));
|
|
987
|
+
}, []), s = c(() => {
|
|
988
|
+
e((d) => ({
|
|
989
|
+
...d,
|
|
990
|
+
enabled: !d.enabled,
|
|
991
|
+
inspectedFeatures: d.enabled ? [] : d.inspectedFeatures,
|
|
992
|
+
selectedIndex: d.enabled ? 0 : d.selectedIndex
|
|
993
|
+
}));
|
|
994
|
+
}, []), n = c((d) => {
|
|
995
|
+
e((w) => ({
|
|
996
|
+
...w,
|
|
997
|
+
inspectedFeatures: d,
|
|
998
|
+
selectedIndex: 0
|
|
999
|
+
}));
|
|
1000
|
+
}, []), b = c((d) => {
|
|
1001
|
+
e((w) => ({
|
|
1002
|
+
...w,
|
|
1003
|
+
selectedIndex: Math.max(
|
|
1004
|
+
0,
|
|
1005
|
+
Math.min(d, w.inspectedFeatures.length - 1)
|
|
1006
|
+
)
|
|
1007
|
+
}));
|
|
1008
|
+
}, []), C = c(() => {
|
|
1009
|
+
e((d) => d.inspectedFeatures.length <= 1 ? d : {
|
|
1010
|
+
...d,
|
|
1011
|
+
selectedIndex: (d.selectedIndex + 1) % d.inspectedFeatures.length
|
|
1012
|
+
});
|
|
1013
|
+
}, []), v = c(() => {
|
|
1014
|
+
e((d) => d.inspectedFeatures.length <= 1 ? d : {
|
|
1015
|
+
...d,
|
|
1016
|
+
selectedIndex: d.selectedIndex === 0 ? d.inspectedFeatures.length - 1 : d.selectedIndex - 1
|
|
1017
|
+
});
|
|
1018
|
+
}, []), g = c(() => {
|
|
1019
|
+
e((d) => ({
|
|
1020
|
+
...d,
|
|
1021
|
+
inspectedFeatures: [],
|
|
1022
|
+
selectedIndex: 0,
|
|
1023
|
+
error: null
|
|
1024
|
+
}));
|
|
1025
|
+
}, []), u = c((d) => {
|
|
1026
|
+
e((w) => ({ ...w, error: d }));
|
|
1027
|
+
}, []), m = c(() => {
|
|
1028
|
+
e((d) => ({ ...d, visible: !0 }));
|
|
1029
|
+
}, []), z = c(() => {
|
|
1030
|
+
e((d) => ({ ...d, visible: !1 }));
|
|
1031
|
+
}, []), x = c(() => {
|
|
1032
|
+
e({ ...A, ...o });
|
|
1033
|
+
}, [o]), h = f.inspectedFeatures[f.selectedIndex] || null, i = f.inspectedFeatures.length;
|
|
1034
|
+
return {
|
|
1035
|
+
state: f,
|
|
1036
|
+
setState: e,
|
|
1037
|
+
setVisible: a,
|
|
1038
|
+
setEnabled: l,
|
|
1039
|
+
enable: t,
|
|
1040
|
+
disable: r,
|
|
1041
|
+
toggle: s,
|
|
1042
|
+
setInspectedFeatures: n,
|
|
1043
|
+
selectFeature: b,
|
|
1044
|
+
nextFeature: C,
|
|
1045
|
+
previousFeature: v,
|
|
1046
|
+
clear: g,
|
|
1047
|
+
setError: u,
|
|
1048
|
+
show: m,
|
|
1049
|
+
hide: z,
|
|
1050
|
+
reset: x,
|
|
1051
|
+
// Computed values
|
|
1052
|
+
currentFeature: h,
|
|
1053
|
+
featureCount: i
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
const M = {
|
|
1057
|
+
visible: !0,
|
|
1058
|
+
collapsed: !0,
|
|
1059
|
+
center: [0, 0],
|
|
1060
|
+
bounds: [0, 0, 0, 0],
|
|
1061
|
+
zoom: 0,
|
|
1062
|
+
pitch: 0,
|
|
1063
|
+
bearing: 0,
|
|
1064
|
+
drawingBBox: !1,
|
|
1065
|
+
drawnBBox: null
|
|
1066
|
+
};
|
|
1067
|
+
function ve(o) {
|
|
1068
|
+
const [f, e] = k({
|
|
1069
|
+
...M,
|
|
1070
|
+
...o
|
|
1071
|
+
}), a = c((m) => {
|
|
1072
|
+
e((z) => ({ ...z, visible: m }));
|
|
1073
|
+
}, []), l = c((m) => {
|
|
1074
|
+
e((z) => ({ ...z, collapsed: m }));
|
|
1075
|
+
}, []), t = c(() => {
|
|
1076
|
+
e((m) => ({ ...m, collapsed: !1 }));
|
|
1077
|
+
}, []), r = c(() => {
|
|
1078
|
+
e((m) => ({ ...m, collapsed: !0 }));
|
|
1079
|
+
}, []), s = c(() => {
|
|
1080
|
+
e((m) => ({ ...m, collapsed: !m.collapsed }));
|
|
1081
|
+
}, []), n = c((m) => {
|
|
1082
|
+
e((z) => ({ ...z, drawingBBox: m }));
|
|
1083
|
+
}, []), b = c(
|
|
1084
|
+
(m) => {
|
|
1085
|
+
e((z) => ({ ...z, drawnBBox: m }));
|
|
1086
|
+
},
|
|
1087
|
+
[]
|
|
1088
|
+
), C = c(() => {
|
|
1089
|
+
e((m) => ({ ...m, drawnBBox: null, drawingBBox: !1 }));
|
|
1090
|
+
}, []), v = c(() => {
|
|
1091
|
+
e((m) => ({ ...m, visible: !0 }));
|
|
1092
|
+
}, []), g = c(() => {
|
|
1093
|
+
e((m) => ({ ...m, visible: !1 }));
|
|
1094
|
+
}, []), u = c(() => {
|
|
1095
|
+
e({ ...M, ...o });
|
|
1096
|
+
}, [o]);
|
|
1097
|
+
return {
|
|
1098
|
+
state: f,
|
|
1099
|
+
setState: e,
|
|
1100
|
+
setVisible: a,
|
|
1101
|
+
setCollapsed: l,
|
|
1102
|
+
expand: t,
|
|
1103
|
+
collapse: r,
|
|
1104
|
+
toggle: s,
|
|
1105
|
+
setDrawingBBox: n,
|
|
1106
|
+
setDrawnBBox: b,
|
|
1107
|
+
clearBBox: C,
|
|
1108
|
+
show: v,
|
|
1109
|
+
hide: g,
|
|
1110
|
+
reset: u
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
const B = {
|
|
1114
|
+
visible: !0,
|
|
1115
|
+
collapsed: !1,
|
|
1116
|
+
rows: 2,
|
|
1117
|
+
columns: 2
|
|
1118
|
+
};
|
|
1119
|
+
function xe(o) {
|
|
1120
|
+
const [f, e] = k({
|
|
1121
|
+
...B,
|
|
1122
|
+
...o
|
|
1123
|
+
}), a = c((u) => {
|
|
1124
|
+
e((m) => ({ ...m, visible: u }));
|
|
1125
|
+
}, []), l = c((u) => {
|
|
1126
|
+
e((m) => ({ ...m, collapsed: u }));
|
|
1127
|
+
}, []), t = c((u) => {
|
|
1128
|
+
e((m) => ({
|
|
1129
|
+
...m,
|
|
1130
|
+
rows: Math.max(1, Math.min(12, Math.round(u)))
|
|
1131
|
+
}));
|
|
1132
|
+
}, []), r = c((u) => {
|
|
1133
|
+
e((m) => ({
|
|
1134
|
+
...m,
|
|
1135
|
+
columns: Math.max(1, Math.min(12, Math.round(u)))
|
|
1136
|
+
}));
|
|
1137
|
+
}, []), s = c(() => {
|
|
1138
|
+
e((u) => ({ ...u, collapsed: !1 }));
|
|
1139
|
+
}, []), n = c(() => {
|
|
1140
|
+
e((u) => ({ ...u, collapsed: !0 }));
|
|
1141
|
+
}, []), b = c(() => {
|
|
1142
|
+
e((u) => ({ ...u, collapsed: !u.collapsed }));
|
|
1143
|
+
}, []), C = c(() => {
|
|
1144
|
+
e((u) => ({ ...u, visible: !0 }));
|
|
1145
|
+
}, []), v = c(() => {
|
|
1146
|
+
e((u) => ({ ...u, visible: !1 }));
|
|
1147
|
+
}, []), g = c(() => {
|
|
1148
|
+
e({ ...B, ...o });
|
|
1149
|
+
}, [o]);
|
|
1150
|
+
return {
|
|
1151
|
+
state: f,
|
|
1152
|
+
setState: e,
|
|
1153
|
+
setVisible: a,
|
|
1154
|
+
setCollapsed: l,
|
|
1155
|
+
setRows: t,
|
|
1156
|
+
setColumns: r,
|
|
1157
|
+
expand: s,
|
|
1158
|
+
collapse: n,
|
|
1159
|
+
toggle: b,
|
|
1160
|
+
show: C,
|
|
1161
|
+
hide: v,
|
|
1162
|
+
reset: g
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
const D = {
|
|
1166
|
+
visible: !0,
|
|
1167
|
+
collapsed: !0,
|
|
1168
|
+
url: "",
|
|
1169
|
+
bands: "1",
|
|
1170
|
+
colormap: "viridis",
|
|
1171
|
+
rescaleMin: 0,
|
|
1172
|
+
rescaleMax: 255,
|
|
1173
|
+
nodata: 0,
|
|
1174
|
+
layerOpacity: 1,
|
|
1175
|
+
pickable: !0,
|
|
1176
|
+
hasLayer: !1,
|
|
1177
|
+
layerCount: 0,
|
|
1178
|
+
layers: [],
|
|
1179
|
+
loading: !1,
|
|
1180
|
+
error: null,
|
|
1181
|
+
status: null,
|
|
1182
|
+
layerName: ""
|
|
1183
|
+
};
|
|
1184
|
+
function we(o) {
|
|
1185
|
+
const [f, e] = k({
|
|
1186
|
+
...D,
|
|
1187
|
+
...o
|
|
1188
|
+
}), a = c((d) => {
|
|
1189
|
+
e((w) => ({ ...w, visible: d }));
|
|
1190
|
+
}, []), l = c((d) => {
|
|
1191
|
+
e((w) => ({ ...w, collapsed: d }));
|
|
1192
|
+
}, []), t = c((d) => {
|
|
1193
|
+
e((w) => ({ ...w, url: d }));
|
|
1194
|
+
}, []), r = c((d) => {
|
|
1195
|
+
e((w) => ({ ...w, bands: d }));
|
|
1196
|
+
}, []), s = c((d) => {
|
|
1197
|
+
e((w) => ({ ...w, colormap: d }));
|
|
1198
|
+
}, []), n = c((d) => {
|
|
1199
|
+
e((w) => ({ ...w, rescaleMin: d }));
|
|
1200
|
+
}, []), b = c((d) => {
|
|
1201
|
+
e((w) => ({ ...w, rescaleMax: d }));
|
|
1202
|
+
}, []), C = c((d) => {
|
|
1203
|
+
e((w) => ({ ...w, nodata: d }));
|
|
1204
|
+
}, []), v = c((d) => {
|
|
1205
|
+
const w = Math.max(0, Math.min(1, d));
|
|
1206
|
+
e((I) => ({ ...I, layerOpacity: w }));
|
|
1207
|
+
}, []), g = c(() => {
|
|
1208
|
+
e((d) => ({ ...d, visible: !0 }));
|
|
1209
|
+
}, []), u = c(() => {
|
|
1210
|
+
e((d) => ({ ...d, visible: !1 }));
|
|
1211
|
+
}, []), m = c(() => {
|
|
1212
|
+
e((d) => ({ ...d, collapsed: !1 }));
|
|
1213
|
+
}, []), z = c(() => {
|
|
1214
|
+
e((d) => ({ ...d, collapsed: !0 }));
|
|
1215
|
+
}, []), x = c(() => {
|
|
1216
|
+
e((d) => ({ ...d, visible: !d.visible }));
|
|
1217
|
+
}, []), h = c(() => {
|
|
1218
|
+
e((d) => ({ ...d, collapsed: !d.collapsed }));
|
|
1219
|
+
}, []), i = c(() => {
|
|
1220
|
+
e({ ...D, ...o });
|
|
1221
|
+
}, [o]);
|
|
1222
|
+
return {
|
|
1223
|
+
state: f,
|
|
1224
|
+
setState: e,
|
|
1225
|
+
setVisible: a,
|
|
1226
|
+
setCollapsed: l,
|
|
1227
|
+
setUrl: t,
|
|
1228
|
+
setBands: r,
|
|
1229
|
+
setColormap: s,
|
|
1230
|
+
setRescaleMin: n,
|
|
1231
|
+
setRescaleMax: b,
|
|
1232
|
+
setNodata: C,
|
|
1233
|
+
setOpacity: v,
|
|
1234
|
+
show: g,
|
|
1235
|
+
hide: u,
|
|
1236
|
+
expand: m,
|
|
1237
|
+
collapse: z,
|
|
1238
|
+
toggleVisibility: x,
|
|
1239
|
+
togglePanel: h,
|
|
1240
|
+
reset: i
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
const H = {
|
|
1244
|
+
visible: !0,
|
|
1245
|
+
collapsed: !1
|
|
1246
|
+
};
|
|
1247
|
+
function ye(o) {
|
|
1248
|
+
const [f, e] = k({
|
|
1249
|
+
...H,
|
|
1250
|
+
...o
|
|
1251
|
+
}), a = c((v) => {
|
|
1252
|
+
e((g) => ({ ...g, visible: v }));
|
|
1253
|
+
}, []), l = c((v) => {
|
|
1254
|
+
e((g) => ({ ...g, collapsed: v }));
|
|
1255
|
+
}, []), t = c(() => {
|
|
1256
|
+
e((v) => ({ ...v, visible: !0 }));
|
|
1257
|
+
}, []), r = c(() => {
|
|
1258
|
+
e((v) => ({ ...v, visible: !1 }));
|
|
1259
|
+
}, []), s = c(() => {
|
|
1260
|
+
e((v) => ({ ...v, collapsed: !1 }));
|
|
1261
|
+
}, []), n = c(() => {
|
|
1262
|
+
e((v) => ({ ...v, collapsed: !0 }));
|
|
1263
|
+
}, []), b = c(() => {
|
|
1264
|
+
e((v) => ({ ...v, collapsed: !v.collapsed }));
|
|
1265
|
+
}, []), C = c(() => {
|
|
1266
|
+
e({ ...H, ...o });
|
|
1267
|
+
}, [o]);
|
|
1268
|
+
return {
|
|
1269
|
+
state: f,
|
|
1270
|
+
setState: e,
|
|
1271
|
+
setVisible: a,
|
|
1272
|
+
setCollapsed: l,
|
|
1273
|
+
show: t,
|
|
1274
|
+
hide: r,
|
|
1275
|
+
expand: s,
|
|
1276
|
+
collapse: n,
|
|
1277
|
+
toggle: b,
|
|
1278
|
+
reset: C
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
export {
|
|
1282
|
+
le as BasemapReact,
|
|
1283
|
+
de as CogLayerReact,
|
|
1284
|
+
X as ColorbarReact,
|
|
1285
|
+
oe as ControlGridReact,
|
|
1286
|
+
ee as HtmlControlReact,
|
|
1287
|
+
se as InspectControlReact,
|
|
1288
|
+
p as LegendReact,
|
|
1289
|
+
ne as MinimapControlReact,
|
|
1290
|
+
te as SearchControlReact,
|
|
1291
|
+
re as TerrainReact,
|
|
1292
|
+
ce as VectorDatasetReact,
|
|
1293
|
+
ae as ViewStateControlReact,
|
|
1294
|
+
be as useBasemap,
|
|
1295
|
+
we as useCogLayer,
|
|
1296
|
+
ue as useColorbar,
|
|
1297
|
+
xe as useControlGrid,
|
|
1298
|
+
fe as useHtmlControl,
|
|
1299
|
+
ge as useInspectControl,
|
|
1300
|
+
ie as useLegend,
|
|
1301
|
+
ye as useMinimapControl,
|
|
1302
|
+
he as useSearchControl,
|
|
1303
|
+
me as useTerrain,
|
|
1304
|
+
Ce as useVectorDataset,
|
|
1305
|
+
ve as useViewState
|
|
1306
|
+
};
|