@macrostrat/map-interface 0.3.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs DELETED
@@ -1,1783 +0,0 @@
1
- require("./index.css");
2
- var $9B3TU$react = require("react");
3
- var $9B3TU$blueprintjscore = require("@blueprintjs/core");
4
- var $9B3TU$macrostrathyper = require("@macrostrat/hyper");
5
- var $9B3TU$macrostratmapboxreact = require("@macrostrat/mapbox-react");
6
- var $9B3TU$classnames = require("classnames");
7
- var $9B3TU$macrostratuicomponents = require("@macrostrat/ui-components");
8
- var $9B3TU$d3format = require("d3-format");
9
- var $9B3TU$mapboxgl = require("mapbox-gl");
10
- var $9B3TU$macrostratmapboxutils = require("@macrostrat/mapbox-utils");
11
- var $9B3TU$chromajs = require("chroma-js");
12
- var $9B3TU$transitionhook = require("transition-hook");
13
- var $9B3TU$underscore = require("underscore");
14
- var $9B3TU$useresizeobserver = require("use-resize-observer");
15
- require("mapbox-gl/dist/mapbox-gl.css");
16
- var $9B3TU$mapboxtilebelt = require("@mapbox/tilebelt");
17
- var $9B3TU$d3array = require("d3-array");
18
-
19
- function $parcel$exportWildcard(dest, source) {
20
- Object.keys(source).forEach(function(key) {
21
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
22
- return;
23
- }
24
-
25
- Object.defineProperty(dest, key, {
26
- enumerable: true,
27
- get: function get() {
28
- return source[key];
29
- }
30
- });
31
- });
32
-
33
- return dest;
34
- }
35
- function $parcel$interopDefault(a) {
36
- return a && a.__esModule ? a.default : a;
37
- }
38
- function $parcel$export(e, n, v, s) {
39
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
40
- }
41
- var $fce5fc950d1fe35b$exports = {};
42
-
43
- $parcel$export($fce5fc950d1fe35b$exports, "LoadingButton", () => $fce5fc950d1fe35b$export$4ec83e90d030b2f3);
44
- $parcel$export($fce5fc950d1fe35b$exports, "MapLoadingButton", () => $fce5fc950d1fe35b$export$9e3bae3c08bde368);
45
- $parcel$export($fce5fc950d1fe35b$exports, "FloatingNavbar", () => $fce5fc950d1fe35b$export$a8cc0062d02a3841);
46
-
47
-
48
-
49
- var $7a1b0f72a2e7f87d$exports = {};
50
-
51
- $parcel$export($7a1b0f72a2e7f87d$exports, "navbar-holder", () => $7a1b0f72a2e7f87d$export$d8779dd86528d602, (v) => $7a1b0f72a2e7f87d$export$d8779dd86528d602 = v);
52
- $parcel$export($7a1b0f72a2e7f87d$exports, "searchbar", () => $7a1b0f72a2e7f87d$export$2ac23befe9d406ee, (v) => $7a1b0f72a2e7f87d$export$2ac23befe9d406ee = v);
53
- $parcel$export($7a1b0f72a2e7f87d$exports, "searchbar-holder", () => $7a1b0f72a2e7f87d$export$3a39e67bbbcbd4ae, (v) => $7a1b0f72a2e7f87d$export$3a39e67bbbcbd4ae = v);
54
- $parcel$export($7a1b0f72a2e7f87d$exports, "status-tongue", () => $7a1b0f72a2e7f87d$export$764ade2d69041360, (v) => $7a1b0f72a2e7f87d$export$764ade2d69041360 = v);
55
- var $7a1b0f72a2e7f87d$export$d8779dd86528d602;
56
- var $7a1b0f72a2e7f87d$export$2ac23befe9d406ee;
57
- var $7a1b0f72a2e7f87d$export$3a39e67bbbcbd4ae;
58
- var $7a1b0f72a2e7f87d$export$764ade2d69041360;
59
- $7a1b0f72a2e7f87d$export$d8779dd86528d602 = `_8hZKsW_navbar-holder`;
60
- $7a1b0f72a2e7f87d$export$2ac23befe9d406ee = `_8hZKsW_searchbar`;
61
- $7a1b0f72a2e7f87d$export$3a39e67bbbcbd4ae = `_8hZKsW_searchbar-holder`;
62
- $7a1b0f72a2e7f87d$export$764ade2d69041360 = `_8hZKsW_status-tongue`;
63
-
64
-
65
-
66
- const $fce5fc950d1fe35b$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($7a1b0f72a2e7f87d$exports))));
67
- const $fce5fc950d1fe35b$var$spinnerElement = $fce5fc950d1fe35b$var$h((0, $9B3TU$blueprintjscore.Spinner), {
68
- size: 16
69
- });
70
- function $fce5fc950d1fe35b$export$4ec83e90d030b2f3({ isLoading: isLoading = false , onClick: onClick , active: active = false , icon: icon = "menu" , }) {
71
- return $fce5fc950d1fe35b$var$h((0, $9B3TU$blueprintjscore.Button), {
72
- icon: isLoading ? $fce5fc950d1fe35b$var$spinnerElement : icon,
73
- large: true,
74
- minimal: true,
75
- onClick: onClick,
76
- active: active && !isLoading
77
- });
78
- }
79
- function $fce5fc950d1fe35b$export$9e3bae3c08bde368(props) {
80
- const { isLoading: isLoading } = (0, $9B3TU$macrostratmapboxreact.useMapStatus)();
81
- const mapIsLoading = (0, $9B3TU$react.useMemo)(()=>isLoading, [
82
- isLoading
83
- ]);
84
- return $fce5fc950d1fe35b$var$h($fce5fc950d1fe35b$export$4ec83e90d030b2f3, {
85
- ...props,
86
- isLoading: mapIsLoading
87
- });
88
- }
89
- function $fce5fc950d1fe35b$export$a8cc0062d02a3841({ className: className , children: children , statusElement: statusElement = null }) {
90
- return $fce5fc950d1fe35b$var$h("div.searchbar-holder", {
91
- className: className
92
- }, [
93
- $fce5fc950d1fe35b$var$h("div.navbar-holder", [
94
- $fce5fc950d1fe35b$var$h((0, $9B3TU$blueprintjscore.Navbar), {
95
- className: "searchbar panel"
96
- }, children),
97
- ]),
98
- $fce5fc950d1fe35b$var$h.if(statusElement != null)((0, $9B3TU$blueprintjscore.Card), {
99
- className: "status-tongue"
100
- }, statusElement),
101
- ]);
102
- }
103
-
104
-
105
- var $2bc7c1e4e7da7fdf$exports = {};
106
-
107
- $parcel$export($2bc7c1e4e7da7fdf$exports, "InfoDrawerContainer", () => $2bc7c1e4e7da7fdf$export$83f9a19cf91c2d06);
108
- $parcel$export($2bc7c1e4e7da7fdf$exports, "LocationPanel", () => $2bc7c1e4e7da7fdf$export$aa4baff5242ea6e1);
109
-
110
-
111
-
112
-
113
- var $a8d7c4c397e52cf6$exports = {};
114
-
115
- $parcel$export($a8d7c4c397e52cf6$exports, "left-icon", () => $a8d7c4c397e52cf6$export$f750577db09821ce, (v) => $a8d7c4c397e52cf6$export$f750577db09821ce = v);
116
- $parcel$export($a8d7c4c397e52cf6$exports, "infodrawer-header-item", () => $a8d7c4c397e52cf6$export$333d72514239bce8, (v) => $a8d7c4c397e52cf6$export$333d72514239bce8 = v);
117
- $parcel$export($a8d7c4c397e52cf6$exports, "spacer", () => $a8d7c4c397e52cf6$export$8cc075c801fd6817, (v) => $a8d7c4c397e52cf6$export$8cc075c801fd6817 = v);
118
- $parcel$export($a8d7c4c397e52cf6$exports, "infodrawer", () => $a8d7c4c397e52cf6$export$b5017f7ff265217d, (v) => $a8d7c4c397e52cf6$export$b5017f7ff265217d = v);
119
- $parcel$export($a8d7c4c397e52cf6$exports, "copy-link-button", () => $a8d7c4c397e52cf6$export$d1352d0c31a65024, (v) => $a8d7c4c397e52cf6$export$d1352d0c31a65024 = v);
120
- $parcel$export($a8d7c4c397e52cf6$exports, "loading", () => $a8d7c4c397e52cf6$export$46c1c92549715335, (v) => $a8d7c4c397e52cf6$export$46c1c92549715335 = v);
121
- $parcel$export($a8d7c4c397e52cf6$exports, "location-panel-header", () => $a8d7c4c397e52cf6$export$d821beb98a87c6d7, (v) => $a8d7c4c397e52cf6$export$d821beb98a87c6d7 = v);
122
- $parcel$export($a8d7c4c397e52cf6$exports, "infodrawer-contents", () => $a8d7c4c397e52cf6$export$69ed3ba502fbf15b, (v) => $a8d7c4c397e52cf6$export$69ed3ba502fbf15b = v);
123
- $parcel$export($a8d7c4c397e52cf6$exports, "position-controls", () => $a8d7c4c397e52cf6$export$dfae07a3bf0fbd6, (v) => $a8d7c4c397e52cf6$export$dfae07a3bf0fbd6 = v);
124
- $parcel$export($a8d7c4c397e52cf6$exports, "infodrawer-body", () => $a8d7c4c397e52cf6$export$310e8f86a84c074f, (v) => $a8d7c4c397e52cf6$export$310e8f86a84c074f = v);
125
- var $a8d7c4c397e52cf6$export$f750577db09821ce;
126
- var $a8d7c4c397e52cf6$export$333d72514239bce8;
127
- var $a8d7c4c397e52cf6$export$8cc075c801fd6817;
128
- var $a8d7c4c397e52cf6$export$b5017f7ff265217d;
129
- var $a8d7c4c397e52cf6$export$d1352d0c31a65024;
130
- var $a8d7c4c397e52cf6$export$46c1c92549715335;
131
- var $a8d7c4c397e52cf6$export$d821beb98a87c6d7;
132
- var $a8d7c4c397e52cf6$export$69ed3ba502fbf15b;
133
- var $a8d7c4c397e52cf6$export$dfae07a3bf0fbd6;
134
- var $a8d7c4c397e52cf6$export$310e8f86a84c074f;
135
- $a8d7c4c397e52cf6$export$f750577db09821ce = `VPa3-W_left-icon`;
136
- $a8d7c4c397e52cf6$export$333d72514239bce8 = `VPa3-W_infodrawer-header-item`;
137
- $a8d7c4c397e52cf6$export$8cc075c801fd6817 = `VPa3-W_spacer`;
138
- $a8d7c4c397e52cf6$export$b5017f7ff265217d = `VPa3-W_infodrawer`;
139
- $a8d7c4c397e52cf6$export$d1352d0c31a65024 = `VPa3-W_copy-link-button`;
140
- $a8d7c4c397e52cf6$export$46c1c92549715335 = `VPa3-W_loading`;
141
- $a8d7c4c397e52cf6$export$d821beb98a87c6d7 = `VPa3-W_location-panel-header`;
142
- $a8d7c4c397e52cf6$export$69ed3ba502fbf15b = `VPa3-W_infodrawer-contents`;
143
- $a8d7c4c397e52cf6$export$dfae07a3bf0fbd6 = `VPa3-W_position-controls`;
144
- $a8d7c4c397e52cf6$export$310e8f86a84c074f = `VPa3-W_infodrawer-body`;
145
-
146
-
147
-
148
- var $860d9939f7032c69$exports = {};
149
-
150
- $parcel$export($860d9939f7032c69$exports, "ValueWithUnit", () => $860d9939f7032c69$export$716098b85fd0efdf);
151
- $parcel$export($860d9939f7032c69$exports, "DegreeCoord", () => $860d9939f7032c69$export$af8082af0bea3eb1);
152
- $parcel$export($860d9939f7032c69$exports, "LngLatCoords", () => $860d9939f7032c69$export$f195b3550849e560);
153
- $parcel$export($860d9939f7032c69$exports, "Elevation", () => $860d9939f7032c69$export$58bfb4f6ec5aa58d);
154
-
155
-
156
- function $bf943af2b72f182b$export$424827e271c4ba96(val, zoom) {
157
- if (zoom < 2) return $bf943af2b72f182b$export$e54bbd2c33d17485(val);
158
- else if (zoom < 4) return $bf943af2b72f182b$export$4c173b1b2f78faf7(val);
159
- else if (zoom < 7) return $bf943af2b72f182b$export$b1cb0f7fb990b3ea(val);
160
- return $bf943af2b72f182b$export$97c1b10e131a836d(val);
161
- }
162
- function $bf943af2b72f182b$export$e94ac56c4c53fe58(lng) {
163
- // via https://github.com/Leaflet/Leaflet/blob/32c9156cb1d1c9bd53130639ec4d8575fbeef5a6/src/core/Util.js#L87
164
- return (((lng - 180) % 360 + 360) % 360 - 180).toFixed(4);
165
- }
166
- const $bf943af2b72f182b$export$97c1b10e131a836d = (0, $9B3TU$d3format.format)(".4~f");
167
- const $bf943af2b72f182b$export$b1cb0f7fb990b3ea = (0, $9B3TU$d3format.format)(".3~f");
168
- const $bf943af2b72f182b$export$4c173b1b2f78faf7 = (0, $9B3TU$d3format.format)(".2~f");
169
- const $bf943af2b72f182b$export$e54bbd2c33d17485 = (0, $9B3TU$d3format.format)(".1~f");
170
- const $bf943af2b72f182b$export$bc135f63e2f56fd4 = (0, $9B3TU$d3format.format)(".0f");
171
- function $bf943af2b72f182b$export$7c4d25c0c3217d8c(val, precision = 0) {
172
- switch(precision){
173
- case 4:
174
- return $bf943af2b72f182b$export$97c1b10e131a836d(val);
175
- case 3:
176
- return $bf943af2b72f182b$export$b1cb0f7fb990b3ea(val);
177
- case 2:
178
- return $bf943af2b72f182b$export$4c173b1b2f78faf7(val);
179
- case 1:
180
- return $bf943af2b72f182b$export$e54bbd2c33d17485(val);
181
- case 0:
182
- return $bf943af2b72f182b$export$bc135f63e2f56fd4(val);
183
- default:
184
- return $bf943af2b72f182b$export$97c1b10e131a836d(val);
185
- }
186
- }
187
- function $bf943af2b72f182b$export$d284c26147b5ca34(meters, precision = 0) {
188
- return (meters * 3.28084).toFixed(precision);
189
- }
190
-
191
-
192
- function $860d9939f7032c69$export$716098b85fd0efdf(props) {
193
- const { value: value , unit: unit } = props;
194
- return (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("span.value-with-unit", [
195
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("span.value", [
196
- value
197
- ]),
198
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("span.spacer", [
199
- " "
200
- ]),
201
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("span.unit", [
202
- unit
203
- ]),
204
- ]);
205
- }
206
- function $860d9939f7032c69$export$af8082af0bea3eb1(props) {
207
- const { value: value , labels: labels , precision: precision = 3 , format: format = (0, $bf943af2b72f182b$export$7c4d25c0c3217d8c) } = props;
208
- const direction = value < 0 ? labels[1] : labels[0];
209
- return (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
210
- value: format(Math.abs(value), precision) + "\xb0",
211
- unit: direction
212
- });
213
- }
214
- function $860d9939f7032c69$export$f195b3550849e560(props) {
215
- /** Formatted geographic coordinates */ const { position: position , className: className , precision: precision , zoom: zoom } = props;
216
- let { format: format } = props;
217
- if (position == null) return null;
218
- let lat, lng;
219
- if (Array.isArray(position)) [lng, lat] = position;
220
- else ({ lat: lat , lng: lng } = position);
221
- if (zoom != null && format == null && precision == null) format = (val, _)=>(0, $bf943af2b72f182b$export$424827e271c4ba96)(val, zoom);
222
- return (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("div.lnglat-container", {
223
- className: className
224
- }, [
225
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("span.lnglat", [
226
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))($860d9939f7032c69$export$af8082af0bea3eb1, {
227
- value: lat,
228
- labels: [
229
- "N",
230
- "S"
231
- ],
232
- precision: precision,
233
- format: format
234
- }),
235
- ", ",
236
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))($860d9939f7032c69$export$af8082af0bea3eb1, {
237
- value: (0, $bf943af2b72f182b$export$e94ac56c4c53fe58)(lng),
238
- labels: [
239
- "E",
240
- "W"
241
- ],
242
- precision: precision,
243
- format: format
244
- }),
245
- ]),
246
- ]);
247
- }
248
- function $860d9939f7032c69$export$58bfb4f6ec5aa58d(props) {
249
- /** Renders an elevation value in meters and a parenthetical conversion to feet. */ const { elevation: elevation , className: className , includeFeet: includeFeet = true } = props;
250
- if (elevation == null) return null;
251
- return (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))("div.elevation", {
252
- className: className
253
- }, [
254
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
255
- value: elevation,
256
- unit: "m"
257
- }),
258
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).if(includeFeet)("span.secondary", [
259
- " (",
260
- (0, ($parcel$interopDefault($9B3TU$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
261
- value: (0, $bf943af2b72f182b$export$d284c26147b5ca34)(elevation),
262
- unit: "ft"
263
- }),
264
- ")",
265
- ]),
266
- ]);
267
- }
268
-
269
-
270
-
271
- const $548387e5996cdbbd$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($a8d7c4c397e52cf6$exports))));
272
- function $548387e5996cdbbd$var$PositionButton({ position: position }) {
273
- const focusState = (0, $9B3TU$macrostratmapboxreact.useFocusState)(position);
274
- return $548387e5996cdbbd$var$h("div.position-controls", [
275
- $548387e5996cdbbd$var$h((0, $9B3TU$macrostratmapboxreact.LocationFocusButton), {
276
- location: position,
277
- focusState: focusState
278
- }, []),
279
- (0, $9B3TU$macrostratmapboxreact.isCentered)(focusState) ? $548387e5996cdbbd$var$h($548387e5996cdbbd$var$CopyLinkButton, {
280
- itemName: "position"
281
- }) : null,
282
- ]);
283
- }
284
- function $548387e5996cdbbd$var$CopyLinkButton({ itemName: itemName , children: children , onClick: onClick , ...rest }) {
285
- const toaster = (0, $9B3TU$macrostratuicomponents.useToaster)();
286
- let message = `Copied link`;
287
- if (itemName != null) message += ` to ${itemName}`;
288
- message += "!";
289
- return $548387e5996cdbbd$var$h((0, $9B3TU$blueprintjscore.Button), {
290
- className: "copy-link-button",
291
- rightIcon: $548387e5996cdbbd$var$h((0, $9B3TU$blueprintjscore.Icon), {
292
- icon: "link",
293
- size: 12
294
- }),
295
- minimal: true,
296
- small: true,
297
- onClick () {
298
- navigator.clipboard.writeText(window.location.href).then(()=>{
299
- toaster?.show({
300
- message: message,
301
- intent: "success",
302
- icon: "clipboard",
303
- timeout: 1000
304
- });
305
- onClick?.();
306
- }, ()=>{
307
- toaster?.show({
308
- message: "Failed to copy link",
309
- intent: "danger",
310
- icon: "error",
311
- timeout: 1000
312
- });
313
- });
314
- },
315
- ...rest
316
- }, children ?? "Copy link");
317
- }
318
- function $548387e5996cdbbd$export$e9ff14c4822c2e8c(props) {
319
- const { onClose: onClose , position: position , zoom: zoom = 7 , elevation: elevation } = props;
320
- return $548387e5996cdbbd$var$h("header.location-panel-header", [
321
- $548387e5996cdbbd$var$h($548387e5996cdbbd$var$PositionButton, {
322
- position: position
323
- }),
324
- $548387e5996cdbbd$var$h("div.spacer"),
325
- $548387e5996cdbbd$var$h((0, $860d9939f7032c69$export$f195b3550849e560), {
326
- position: position,
327
- zoom: zoom,
328
- className: "infodrawer-header-item"
329
- }),
330
- $548387e5996cdbbd$var$h.if(elevation != null)((0, $860d9939f7032c69$export$58bfb4f6ec5aa58d), {
331
- elevation: elevation,
332
- className: "infodrawer-header-item"
333
- }),
334
- $548387e5996cdbbd$var$h((0, $9B3TU$blueprintjscore.Button), {
335
- minimal: true,
336
- icon: "cross",
337
- onClick: onClose
338
- }),
339
- ]);
340
- }
341
-
342
-
343
-
344
-
345
-
346
- const $2bc7c1e4e7da7fdf$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($a8d7c4c397e52cf6$exports))));
347
- function $2bc7c1e4e7da7fdf$export$83f9a19cf91c2d06(props) {
348
- const className = (0, ($parcel$interopDefault($9B3TU$classnames)))("infodrawer", props.className);
349
- return $2bc7c1e4e7da7fdf$var$h((0, $9B3TU$blueprintjscore.Card), {
350
- ...props,
351
- className: className
352
- });
353
- }
354
- function $2bc7c1e4e7da7fdf$export$aa4baff5242ea6e1(props) {
355
- const { children: children , className: className , loading: loading = false , ...rest } = props;
356
- const cls = (0, ($parcel$interopDefault($9B3TU$classnames)))("location-panel", className, {
357
- loading: loading
358
- });
359
- return $2bc7c1e4e7da7fdf$var$h($2bc7c1e4e7da7fdf$export$83f9a19cf91c2d06, {
360
- className: cls
361
- }, [
362
- $2bc7c1e4e7da7fdf$var$h((0, $548387e5996cdbbd$export$e9ff14c4822c2e8c), rest),
363
- $2bc7c1e4e7da7fdf$var$h("div.infodrawer-body", $2bc7c1e4e7da7fdf$var$h("div.infodrawer-contents", $2bc7c1e4e7da7fdf$var$h((0, $9B3TU$macrostratuicomponents.ErrorBoundary), null, children))),
364
- ]);
365
- }
366
-
367
-
368
- var $9acbb47bf7cb7660$exports = {};
369
- var $6f5ca387ac26c0b5$exports = {};
370
-
371
- $parcel$export($6f5ca387ac26c0b5$exports, "MacrostratVectorTileset", () => $6f5ca387ac26c0b5$export$dce4b6e67bb5f25a);
372
- $parcel$export($6f5ca387ac26c0b5$exports, "MacrostratRasterTileset", () => $6f5ca387ac26c0b5$export$cc7c195070dfb906);
373
- $parcel$export($6f5ca387ac26c0b5$exports, "h", () => $6f5ca387ac26c0b5$export$dda1d9f60106f0e9);
374
- $parcel$export($6f5ca387ac26c0b5$exports, "DevMapPage", () => $6f5ca387ac26c0b5$export$2391061fbdfb71ef);
375
-
376
-
377
-
378
-
379
-
380
- var $8646508ae99a5857$exports = {};
381
-
382
- $parcel$export($8646508ae99a5857$exports, "buildXRayStyle", () => $8646508ae99a5857$export$eff5fb2e10d05b1d);
383
- $parcel$export($8646508ae99a5857$exports, "buildInspectorStyle", () => $8646508ae99a5857$export$e739dc8dfc0db9a6);
384
-
385
-
386
- async function $8646508ae99a5857$export$eff5fb2e10d05b1d(baseStyle, params = null) {
387
- const { inDarkMode: inDarkMode = false , color: color = "rgb(74, 242, 161)" , mapboxToken: mapboxToken , xRaySources: xRaySources } = params;
388
- const style = await (0, $9B3TU$macrostratmapboxutils.getMapboxStyle)(baseStyle, {
389
- access_token: mapboxToken
390
- });
391
- const sources = xRaySources ?? Object.keys(style.sources);
392
- let layers = [];
393
- for (let layer of style.layers){
394
- if (!sources.includes(layer.source)) {
395
- layers.push(layer);
396
- continue;
397
- }
398
- let newLayer = $8646508ae99a5857$var$transformMapboxLayer(layer, color, inDarkMode);
399
- if (newLayer != null) layers.push(newLayer);
400
- }
401
- return {
402
- ...style,
403
- layers: layers
404
- };
405
- }
406
- function $8646508ae99a5857$var$transformMapboxLayer(layer, color, inDarkMode) {
407
- const c = (0, ($parcel$interopDefault($9B3TU$chromajs)))(color);
408
- const xRayColor = (opacity = 1, darken = 0)=>{
409
- if (!inDarkMode) return (0, ($parcel$interopDefault($9B3TU$chromajs)))(color).darken(2 - darken).alpha(opacity).css();
410
- return c.alpha(opacity).darken(darken).css();
411
- };
412
- if (layer.type == "background") return null;
413
- let newLayer = {
414
- ...layer
415
- };
416
- if (layer.type == "fill") newLayer.paint = {
417
- "fill-color": xRayColor(0.1),
418
- "fill-outline-color": xRayColor(0.5)
419
- };
420
- else if (layer.type == "line") newLayer.paint = {
421
- "line-color": xRayColor(0.5, 0),
422
- "line-width": 1.5
423
- };
424
- else if (layer.type == "symbol") newLayer.paint = {
425
- "text-color": xRayColor(1, -0.5),
426
- "text-halo-color": "#000"
427
- };
428
- else if (layer.type == "circle") newLayer.paint = {
429
- "circle-color": xRayColor(0.5, 0),
430
- "circle-stroke-color": xRayColor(0.5, 1),
431
- "circle-radius": 2
432
- };
433
- return newLayer;
434
- }
435
- async function $8646508ae99a5857$export$e739dc8dfc0db9a6(baseStyle, overlayStyle = null, params = {}) {
436
- const { mapboxToken: mapboxToken , xRay: xRay = false , xRaySources: _xRaySources , ...rest } = params;
437
- let xRaySources = _xRaySources;
438
- let style = await (0, $9B3TU$macrostratmapboxutils.getMapboxStyle)(baseStyle, {
439
- access_token: mapboxToken
440
- });
441
- if (overlayStyle != null) {
442
- const overlay = await (0, $9B3TU$macrostratmapboxutils.getMapboxStyle)(overlayStyle, {
443
- access_token: mapboxToken
444
- });
445
- style = (0, $9B3TU$macrostratmapboxutils.mergeStyles)(style, overlay);
446
- xRaySources ??= Object.keys(overlay.sources);
447
- }
448
- if (xRay) {
449
- // If we haven't specified sources, then we'll use all of them
450
- xRaySources ??= Object.keys(style.sources);
451
- style = await $8646508ae99a5857$export$eff5fb2e10d05b1d(style, {
452
- ...rest,
453
- mapboxToken: mapboxToken,
454
- xRaySources: xRaySources
455
- });
456
- }
457
- return style;
458
- }
459
-
460
-
461
- var $c3311f59335df34d$exports = {};
462
-
463
- $parcel$export($c3311f59335df34d$exports, "MapInterface", () => $c3311f59335df34d$export$57b87f3e07d4bb90);
464
- $parcel$export($c3311f59335df34d$exports, "PanelCard", () => $c3311f59335df34d$export$ec68dd77edbe678b);
465
- $parcel$export($c3311f59335df34d$exports, "MapStyledContainer", () => $c3311f59335df34d$export$fa395a37c3898ae3);
466
- $parcel$export($c3311f59335df34d$exports, "MapAreaContainer", () => $c3311f59335df34d$export$9fa5da0bcfd0a290);
467
-
468
- var $35f1bc0112883d51$exports = {};
469
-
470
- $parcel$export($35f1bc0112883d51$exports, "map-page", () => $35f1bc0112883d51$export$5ec584901c06c5b9, (v) => $35f1bc0112883d51$export$5ec584901c06c5b9 = v);
471
- $parcel$export($35f1bc0112883d51$exports, "fit-viewport", () => $35f1bc0112883d51$export$2a73fca7b70dce31, (v) => $35f1bc0112883d51$export$2a73fca7b70dce31 = v);
472
- $parcel$export($35f1bc0112883d51$exports, "compass-control", () => $35f1bc0112883d51$export$cc73204c64cc0950, (v) => $35f1bc0112883d51$export$cc73204c64cc0950 = v);
473
- $parcel$export($35f1bc0112883d51$exports, "map-is-rotated", () => $35f1bc0112883d51$export$d2972e7dfac51dc2, (v) => $35f1bc0112883d51$export$d2972e7dfac51dc2 = v);
474
- $parcel$export($35f1bc0112883d51$exports, "map-3d-control", () => $35f1bc0112883d51$export$142b9410c523ef40, (v) => $35f1bc0112883d51$export$142b9410c523ef40 = v);
475
- $parcel$export($35f1bc0112883d51$exports, "map-3d-available", () => $35f1bc0112883d51$export$6bc2d6545947abbc, (v) => $35f1bc0112883d51$export$6bc2d6545947abbc = v);
476
- $parcel$export($35f1bc0112883d51$exports, "globe-control", () => $35f1bc0112883d51$export$b06313b17bd37b68, (v) => $35f1bc0112883d51$export$b06313b17bd37b68 = v);
477
- $parcel$export($35f1bc0112883d51$exports, "map-is-global", () => $35f1bc0112883d51$export$ea9cfbb56edd0e47, (v) => $35f1bc0112883d51$export$ea9cfbb56edd0e47 = v);
478
- $parcel$export($35f1bc0112883d51$exports, "main-ui", () => $35f1bc0112883d51$export$6d74761ad3ff486d, (v) => $35f1bc0112883d51$export$6d74761ad3ff486d = v);
479
- $parcel$export($35f1bc0112883d51$exports, "panel-card", () => $35f1bc0112883d51$export$8eff531ff0f1cffe, (v) => $35f1bc0112883d51$export$8eff531ff0f1cffe = v);
480
- $parcel$export($35f1bc0112883d51$exports, "context-stack", () => $35f1bc0112883d51$export$a15c1c170cdda69a, (v) => $35f1bc0112883d51$export$a15c1c170cdda69a = v);
481
- $parcel$export($35f1bc0112883d51$exports, "searchbar", () => $35f1bc0112883d51$export$2ac23befe9d406ee, (v) => $35f1bc0112883d51$export$2ac23befe9d406ee = v);
482
- $parcel$export($35f1bc0112883d51$exports, "detail-stack", () => $35f1bc0112883d51$export$bb1d4538b98f1621, (v) => $35f1bc0112883d51$export$bb1d4538b98f1621 = v);
483
- $parcel$export($35f1bc0112883d51$exports, "panel-container", () => $35f1bc0112883d51$export$9dd9a0eceddf6af6, (v) => $35f1bc0112883d51$export$9dd9a0eceddf6af6 = v);
484
- $parcel$export($35f1bc0112883d51$exports, "panel-title", () => $35f1bc0112883d51$export$9672a0c48c9048ad, (v) => $35f1bc0112883d51$export$9672a0c48c9048ad = v);
485
- $parcel$export($35f1bc0112883d51$exports, "spacer", () => $35f1bc0112883d51$export$8cc075c801fd6817, (v) => $35f1bc0112883d51$export$8cc075c801fd6817 = v);
486
- $parcel$export($35f1bc0112883d51$exports, "map-view-container", () => $35f1bc0112883d51$export$11aa7dc57218208d, (v) => $35f1bc0112883d51$export$11aa7dc57218208d = v);
487
- $parcel$export($35f1bc0112883d51$exports, "searchbar-holder", () => $35f1bc0112883d51$export$3a39e67bbbcbd4ae, (v) => $35f1bc0112883d51$export$3a39e67bbbcbd4ae = v);
488
- $parcel$export($35f1bc0112883d51$exports, "right-panel", () => $35f1bc0112883d51$export$3332ecdf6c5467a, (v) => $35f1bc0112883d51$export$3332ecdf6c5467a = v);
489
- $parcel$export($35f1bc0112883d51$exports, "buttons", () => $35f1bc0112883d51$export$bbea856fdb3e3c5f, (v) => $35f1bc0112883d51$export$bbea856fdb3e3c5f = v);
490
- $parcel$export($35f1bc0112883d51$exports, "tab-button", () => $35f1bc0112883d51$export$76800529067ae833, (v) => $35f1bc0112883d51$export$76800529067ae833 = v);
491
- $parcel$export($35f1bc0112883d51$exports, "menu-card", () => $35f1bc0112883d51$export$d94de0bab38fd59, (v) => $35f1bc0112883d51$export$d94de0bab38fd59 = v);
492
- $parcel$export($35f1bc0112883d51$exports, "narrow-card", () => $35f1bc0112883d51$export$9769f988dc28baf, (v) => $35f1bc0112883d51$export$9769f988dc28baf = v);
493
- $parcel$export($35f1bc0112883d51$exports, "panel-header", () => $35f1bc0112883d51$export$90b77e3be608e918, (v) => $35f1bc0112883d51$export$90b77e3be608e918 = v);
494
- $parcel$export($35f1bc0112883d51$exports, "minimal", () => $35f1bc0112883d51$export$10c083462c34aef3, (v) => $35f1bc0112883d51$export$10c083462c34aef3 = v);
495
- $parcel$export($35f1bc0112883d51$exports, "context-panel-leave", () => $35f1bc0112883d51$export$f3ad069e7751fe80, (v) => $35f1bc0112883d51$export$f3ad069e7751fe80 = v);
496
- $parcel$export($35f1bc0112883d51$exports, "narrow-enter", () => $35f1bc0112883d51$export$c20b2d766062840f, (v) => $35f1bc0112883d51$export$c20b2d766062840f = v);
497
- $parcel$export($35f1bc0112883d51$exports, "menu-group", () => $35f1bc0112883d51$export$3a4b737893473805, (v) => $35f1bc0112883d51$export$3a4b737893473805 = v);
498
- $parcel$export($35f1bc0112883d51$exports, "menu-content", () => $35f1bc0112883d51$export$3eeb6f640f2fe17b, (v) => $35f1bc0112883d51$export$3eeb6f640f2fe17b = v);
499
- $parcel$export($35f1bc0112883d51$exports, "bp4-button-group", () => $35f1bc0112883d51$export$e7ed5da3d9a53077, (v) => $35f1bc0112883d51$export$e7ed5da3d9a53077 = v);
500
- $parcel$export($35f1bc0112883d51$exports, "detail-panel-open", () => $35f1bc0112883d51$export$62a60ea2feb29c53, (v) => $35f1bc0112883d51$export$62a60ea2feb29c53 = v);
501
- $parcel$export($35f1bc0112883d51$exports, "zoom-control", () => $35f1bc0112883d51$export$61e54aa1efb913ad, (v) => $35f1bc0112883d51$export$61e54aa1efb913ad = v);
502
- $parcel$export($35f1bc0112883d51$exports, "searching", () => $35f1bc0112883d51$export$fddadf6320237c22, (v) => $35f1bc0112883d51$export$fddadf6320237c22 = v);
503
- $parcel$export($35f1bc0112883d51$exports, "map-controls", () => $35f1bc0112883d51$export$802dc54769b48aa7, (v) => $35f1bc0112883d51$export$802dc54769b48aa7 = v);
504
- $parcel$export($35f1bc0112883d51$exports, "map-control", () => $35f1bc0112883d51$export$521e5bd1ca520342, (v) => $35f1bc0112883d51$export$521e5bd1ca520342 = v);
505
- $parcel$export($35f1bc0112883d51$exports, "map-scale-control", () => $35f1bc0112883d51$export$b56f659d649f0d92, (v) => $35f1bc0112883d51$export$b56f659d649f0d92 = v);
506
- $parcel$export($35f1bc0112883d51$exports, "detail-panel-enter", () => $35f1bc0112883d51$export$e017ebf46ba443ed, (v) => $35f1bc0112883d51$export$e017ebf46ba443ed = v);
507
- $parcel$export($35f1bc0112883d51$exports, "infodrawer-stack", () => $35f1bc0112883d51$export$69fa1b5d46c139b9, (v) => $35f1bc0112883d51$export$69fa1b5d46c139b9 = v);
508
- $parcel$export($35f1bc0112883d51$exports, "detail-panel", () => $35f1bc0112883d51$export$c6930745f2610de0, (v) => $35f1bc0112883d51$export$c6930745f2610de0 = v);
509
- $parcel$export($35f1bc0112883d51$exports, "context-panel-holder", () => $35f1bc0112883d51$export$1113ec858cdbc244, (v) => $35f1bc0112883d51$export$1113ec858cdbc244 = v);
510
- $parcel$export($35f1bc0112883d51$exports, "detail-panel-from", () => $35f1bc0112883d51$export$419647d5ce4279cb, (v) => $35f1bc0112883d51$export$419647d5ce4279cb = v);
511
- $parcel$export($35f1bc0112883d51$exports, "detail-panel-leave", () => $35f1bc0112883d51$export$1d0f1d0b062c3bee, (v) => $35f1bc0112883d51$export$1d0f1d0b062c3bee = v);
512
- $parcel$export($35f1bc0112883d51$exports, "context-panel-from", () => $35f1bc0112883d51$export$90f42dafd5c24d2d, (v) => $35f1bc0112883d51$export$90f42dafd5c24d2d = v);
513
- $parcel$export($35f1bc0112883d51$exports, "context-panel-enter", () => $35f1bc0112883d51$export$9ea3835d1b44cc08, (v) => $35f1bc0112883d51$export$9ea3835d1b44cc08 = v);
514
- $parcel$export($35f1bc0112883d51$exports, "context-panel", () => $35f1bc0112883d51$export$b4dbb67ffc3cc7a9, (v) => $35f1bc0112883d51$export$b4dbb67ffc3cc7a9 = v);
515
- var $35f1bc0112883d51$export$5ec584901c06c5b9;
516
- var $35f1bc0112883d51$export$2a73fca7b70dce31;
517
- var $35f1bc0112883d51$export$cc73204c64cc0950;
518
- var $35f1bc0112883d51$export$d2972e7dfac51dc2;
519
- var $35f1bc0112883d51$export$142b9410c523ef40;
520
- var $35f1bc0112883d51$export$6bc2d6545947abbc;
521
- var $35f1bc0112883d51$export$b06313b17bd37b68;
522
- var $35f1bc0112883d51$export$ea9cfbb56edd0e47;
523
- var $35f1bc0112883d51$export$6d74761ad3ff486d;
524
- var $35f1bc0112883d51$export$8eff531ff0f1cffe;
525
- var $35f1bc0112883d51$export$a15c1c170cdda69a;
526
- var $35f1bc0112883d51$export$2ac23befe9d406ee;
527
- var $35f1bc0112883d51$export$bb1d4538b98f1621;
528
- var $35f1bc0112883d51$export$9dd9a0eceddf6af6;
529
- var $35f1bc0112883d51$export$9672a0c48c9048ad;
530
- var $35f1bc0112883d51$export$8cc075c801fd6817;
531
- var $35f1bc0112883d51$export$11aa7dc57218208d;
532
- var $35f1bc0112883d51$export$3a39e67bbbcbd4ae;
533
- var $35f1bc0112883d51$export$3332ecdf6c5467a;
534
- var $35f1bc0112883d51$export$bbea856fdb3e3c5f;
535
- var $35f1bc0112883d51$export$76800529067ae833;
536
- var $35f1bc0112883d51$export$d94de0bab38fd59;
537
- var $35f1bc0112883d51$export$9769f988dc28baf;
538
- var $35f1bc0112883d51$export$90b77e3be608e918;
539
- var $35f1bc0112883d51$export$10c083462c34aef3;
540
- var $35f1bc0112883d51$export$f3ad069e7751fe80;
541
- var $35f1bc0112883d51$export$c20b2d766062840f;
542
- var $35f1bc0112883d51$export$3a4b737893473805;
543
- var $35f1bc0112883d51$export$3eeb6f640f2fe17b;
544
- var $35f1bc0112883d51$export$e7ed5da3d9a53077;
545
- var $35f1bc0112883d51$export$62a60ea2feb29c53;
546
- var $35f1bc0112883d51$export$61e54aa1efb913ad;
547
- var $35f1bc0112883d51$export$fddadf6320237c22;
548
- var $35f1bc0112883d51$export$802dc54769b48aa7;
549
- var $35f1bc0112883d51$export$521e5bd1ca520342;
550
- var $35f1bc0112883d51$export$b56f659d649f0d92;
551
- var $35f1bc0112883d51$export$e017ebf46ba443ed;
552
- var $35f1bc0112883d51$export$69fa1b5d46c139b9;
553
- var $35f1bc0112883d51$export$c6930745f2610de0;
554
- var $35f1bc0112883d51$export$1113ec858cdbc244;
555
- var $35f1bc0112883d51$export$419647d5ce4279cb;
556
- var $35f1bc0112883d51$export$1d0f1d0b062c3bee;
557
- var $35f1bc0112883d51$export$90f42dafd5c24d2d;
558
- var $35f1bc0112883d51$export$9ea3835d1b44cc08;
559
- var $35f1bc0112883d51$export$b4dbb67ffc3cc7a9;
560
- $35f1bc0112883d51$export$5ec584901c06c5b9 = "map-page_4c0a66";
561
- $35f1bc0112883d51$export$2a73fca7b70dce31 = "fit-viewport_4c0a66";
562
- $35f1bc0112883d51$export$cc73204c64cc0950 = "compass-control_4c0a66";
563
- $35f1bc0112883d51$export$d2972e7dfac51dc2 = "map-is-rotated_4c0a66";
564
- $35f1bc0112883d51$export$142b9410c523ef40 = "map-3d-control_4c0a66";
565
- $35f1bc0112883d51$export$6bc2d6545947abbc = "map-3d-available_4c0a66";
566
- $35f1bc0112883d51$export$b06313b17bd37b68 = "globe-control_4c0a66";
567
- $35f1bc0112883d51$export$ea9cfbb56edd0e47 = "map-is-global_4c0a66";
568
- $35f1bc0112883d51$export$6d74761ad3ff486d = "main-ui_4c0a66";
569
- $35f1bc0112883d51$export$8eff531ff0f1cffe = "panel-card_4c0a66";
570
- $35f1bc0112883d51$export$a15c1c170cdda69a = "context-stack_4c0a66";
571
- $35f1bc0112883d51$export$2ac23befe9d406ee = "searchbar_4c0a66";
572
- $35f1bc0112883d51$export$bb1d4538b98f1621 = "detail-stack_4c0a66";
573
- $35f1bc0112883d51$export$9dd9a0eceddf6af6 = "panel-container_4c0a66";
574
- $35f1bc0112883d51$export$9672a0c48c9048ad = "panel-title_4c0a66";
575
- $35f1bc0112883d51$export$8cc075c801fd6817 = "spacer_4c0a66";
576
- $35f1bc0112883d51$export$11aa7dc57218208d = "map-view-container_4c0a66";
577
- $35f1bc0112883d51$export$3a39e67bbbcbd4ae = "searchbar-holder_4c0a66";
578
- $35f1bc0112883d51$export$3332ecdf6c5467a = "right-panel_4c0a66";
579
- $35f1bc0112883d51$export$bbea856fdb3e3c5f = "buttons_4c0a66";
580
- $35f1bc0112883d51$export$76800529067ae833 = "tab-button_4c0a66";
581
- $35f1bc0112883d51$export$d94de0bab38fd59 = "menu-card_4c0a66";
582
- $35f1bc0112883d51$export$9769f988dc28baf = "narrow-card_4c0a66";
583
- $35f1bc0112883d51$export$90b77e3be608e918 = "panel-header_4c0a66";
584
- $35f1bc0112883d51$export$10c083462c34aef3 = "minimal_4c0a66";
585
- $35f1bc0112883d51$export$f3ad069e7751fe80 = "context-panel-leave_4c0a66";
586
- $35f1bc0112883d51$export$c20b2d766062840f = "narrow-enter_4c0a66";
587
- $35f1bc0112883d51$export$3a4b737893473805 = "menu-group_4c0a66";
588
- $35f1bc0112883d51$export$3eeb6f640f2fe17b = "menu-content_4c0a66";
589
- $35f1bc0112883d51$export$e7ed5da3d9a53077 = "bp4-button-group_4c0a66";
590
- $35f1bc0112883d51$export$62a60ea2feb29c53 = "detail-panel-open_4c0a66";
591
- $35f1bc0112883d51$export$61e54aa1efb913ad = "zoom-control_4c0a66";
592
- $35f1bc0112883d51$export$fddadf6320237c22 = "searching_4c0a66";
593
- $35f1bc0112883d51$export$802dc54769b48aa7 = "map-controls_4c0a66";
594
- $35f1bc0112883d51$export$521e5bd1ca520342 = "map-control_4c0a66";
595
- $35f1bc0112883d51$export$b56f659d649f0d92 = "map-scale-control_4c0a66";
596
- $35f1bc0112883d51$export$e017ebf46ba443ed = "detail-panel-enter_4c0a66";
597
- $35f1bc0112883d51$export$69fa1b5d46c139b9 = "infodrawer-stack_4c0a66";
598
- $35f1bc0112883d51$export$c6930745f2610de0 = "detail-panel_4c0a66";
599
- $35f1bc0112883d51$export$1113ec858cdbc244 = "context-panel-holder_4c0a66";
600
- $35f1bc0112883d51$export$419647d5ce4279cb = "detail-panel-from_4c0a66";
601
- $35f1bc0112883d51$export$1d0f1d0b062c3bee = "detail-panel-leave_4c0a66";
602
- $35f1bc0112883d51$export$90f42dafd5c24d2d = "context-panel-from_4c0a66";
603
- $35f1bc0112883d51$export$9ea3835d1b44cc08 = "context-panel-enter_4c0a66";
604
- $35f1bc0112883d51$export$b4dbb67ffc3cc7a9 = "context-panel_4c0a66";
605
-
606
-
607
-
608
-
609
-
610
-
611
- var $f333fe6f49373ca9$exports = {};
612
-
613
- $parcel$export($f333fe6f49373ca9$exports, "MapBottomControls", () => $f333fe6f49373ca9$export$db1a2e058a06fb5c);
614
-
615
-
616
-
617
-
618
-
619
-
620
- const $f333fe6f49373ca9$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($35f1bc0112883d51$exports))));
621
- function $f333fe6f49373ca9$var$ScaleControl(props) {
622
- const optionsRef = (0, $9B3TU$react.useRef)({
623
- maxWidth: 200,
624
- unit: "metric"
625
- });
626
- return $f333fe6f49373ca9$var$h((0, $9B3TU$macrostratmapboxreact.MapControlWrapper), {
627
- className: "map-scale-control",
628
- control: (0, $9B3TU$mapboxgl.ScaleControl),
629
- options: optionsRef.current,
630
- ...props
631
- });
632
- }
633
- function $f333fe6f49373ca9$var$GeolocationControl(props) {
634
- const optionsRef = (0, $9B3TU$react.useRef)({
635
- showAccuracyCircle: true,
636
- showUserLocation: true,
637
- trackUserLocation: true,
638
- positionOptions: {
639
- enableHighAccuracy: true
640
- }
641
- });
642
- return $f333fe6f49373ca9$var$h((0, $9B3TU$macrostratmapboxreact.MapControlWrapper), {
643
- control: (0, $9B3TU$mapboxgl.GeolocateControl),
644
- options: optionsRef.current,
645
- ...props
646
- });
647
- }
648
- function $f333fe6f49373ca9$export$db1a2e058a06fb5c() {
649
- return $f333fe6f49373ca9$var$h("div.map-controls", [
650
- $f333fe6f49373ca9$var$h($f333fe6f49373ca9$var$ScaleControl),
651
- $f333fe6f49373ca9$var$h((0, $9B3TU$macrostratmapboxreact.ThreeDControl), {
652
- className: "map-3d-control"
653
- }),
654
- $f333fe6f49373ca9$var$h((0, $9B3TU$macrostratmapboxreact.CompassControl), {
655
- className: "compass-control"
656
- }),
657
- $f333fe6f49373ca9$var$h((0, $9B3TU$macrostratmapboxreact.GlobeControl), {
658
- className: "globe-control"
659
- }),
660
- $f333fe6f49373ca9$var$h($f333fe6f49373ca9$var$GeolocationControl, {
661
- className: "geolocation-control"
662
- }),
663
- ]);
664
- }
665
-
666
-
667
-
668
-
669
- function $c3311f59335df34d$export$57b87f3e07d4bb90() {
670
- return $c3311f59335df34d$var$h("div", "Hello world");
671
- }
672
- const $c3311f59335df34d$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($35f1bc0112883d51$exports))));
673
- const $c3311f59335df34d$export$ec68dd77edbe678b = (props)=>$c3311f59335df34d$var$h((0, $9B3TU$blueprintjscore.Card), {
674
- ...props,
675
- className: (0, ($parcel$interopDefault($9B3TU$classnames)))("panel-card", props.className)
676
- });
677
- function $c3311f59335df34d$var$_MapAreaContainer({ children: children , className: className , navbar: navbar , contextPanel: contextPanel = null , detailPanel: detailPanel = null , detailPanelOpen: detailPanelOpen , contextPanelOpen: contextPanelOpen = true , bottomPanel: bottomPanel = null , mainPanel: mainPanel , mapControls: mapControls = $c3311f59335df34d$var$h((0, $f333fe6f49373ca9$export$db1a2e058a06fb5c)) , contextStackProps: contextStackProps = null , detailStackProps: detailStackProps = null , mapPosition: mapPosition = null , fitViewport: fitViewport = true , ...rest }) {
678
- const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;
679
- const contextPanelTrans = (0, $9B3TU$transitionhook.useTransition)(contextPanelOpen, 800);
680
- const detailPanelTrans = (0, $9B3TU$transitionhook.useTransition)(_detailPanelOpen, 800);
681
- /*- We apply a custom style to the panel container when we are interacting
682
- with the search bar, so that we can block map interactions until search
683
- bar focus is lost.
684
- - We also apply a custom style when the infodrawer is open so we can hide
685
- the search bar on mobile platforms
686
- - These styles are doubly applied so we can have both namespaced and
687
- outside-accessible styles for each case.
688
- */ const mainUIClassName = (0, ($parcel$interopDefault($9B3TU$classnames)))({
689
- "detail-panel-open": _detailPanelOpen,
690
- "map-context-open": contextPanelOpen
691
- }, `context-panel-${contextPanelTrans.stage}`, `map-context-${contextPanelTrans.stage}`, `detail-panel-${detailPanelTrans.stage}`, `map-detail-${detailPanelTrans.stage}`);
692
- return $c3311f59335df34d$var$h($c3311f59335df34d$export$fa395a37c3898ae3, {
693
- className: (0, ($parcel$interopDefault($9B3TU$classnames)))("map-page", className, {
694
- "fit-viewport": fitViewport
695
- }),
696
- mapPosition: mapPosition
697
- }, [
698
- $c3311f59335df34d$var$h("div.main-ui", {
699
- className: mainUIClassName,
700
- ...rest
701
- }, [
702
- $c3311f59335df34d$var$h("div.context-stack", [
703
- navbar,
704
- $c3311f59335df34d$var$h("div.context-panel-holder", [
705
- $c3311f59335df34d$var$h.if(contextPanelTrans.shouldMount)([
706
- contextPanel
707
- ]),
708
- ]),
709
- $c3311f59335df34d$var$h("div.spacer"),
710
- ]),
711
- //h(MapView),
712
- children ?? mainPanel,
713
- $c3311f59335df34d$var$h("div.detail-stack.infodrawer-container", detailStackProps, [
714
- detailPanel,
715
- $c3311f59335df34d$var$h((0, $9B3TU$macrostratmapboxreact.ZoomControl), {
716
- className: "zoom-control"
717
- }),
718
- $c3311f59335df34d$var$h("div.spacer"),
719
- mapControls,
720
- ]),
721
- ]),
722
- $c3311f59335df34d$var$h("div.bottom", null, bottomPanel),
723
- ]);
724
- }
725
- const $c3311f59335df34d$var$MapProviders = ({ children: children })=>$c3311f59335df34d$var$h((0, $9B3TU$macrostratuicomponents.ToasterContext), $c3311f59335df34d$var$h((0, $9B3TU$macrostratmapboxreact.MapboxMapProvider), children));
726
- const $c3311f59335df34d$export$9fa5da0bcfd0a290 = (props)=>$c3311f59335df34d$var$h($c3311f59335df34d$var$MapProviders, $c3311f59335df34d$var$h($c3311f59335df34d$var$_MapAreaContainer, props));
727
- function $c3311f59335df34d$export$fa395a37c3898ae3({ className: className , children: children }) {
728
- const mapPosition = (0, $9B3TU$macrostratmapboxreact.useMapPosition)();
729
- if (mapPosition != null) {
730
- const { mapIsRotated: mapIsRotated , mapUse3D: mapUse3D , mapIsGlobal: mapIsGlobal } = (0, $9B3TU$macrostratmapboxutils.mapViewInfo)(mapPosition);
731
- className = (0, ($parcel$interopDefault($9B3TU$classnames)))(className, {
732
- "map-is-rotated": mapIsRotated,
733
- "map-3d-available": mapUse3D,
734
- "map-is-global": mapIsGlobal
735
- });
736
- }
737
- return $c3311f59335df34d$var$h("div", {
738
- className: className
739
- }, children);
740
- } //const _MapPage = compose(HotkeysProvider, MapPage);
741
-
742
-
743
-
744
- var $2611a7b4364593e5$exports = {};
745
-
746
- $parcel$export($2611a7b4364593e5$exports, "MapResizeManager", () => $2611a7b4364593e5$export$31b2e088aff2dc5d);
747
- $parcel$export($2611a7b4364593e5$exports, "MapPaddingManager", () => $2611a7b4364593e5$export$2ab96428dea558d6);
748
- $parcel$export($2611a7b4364593e5$exports, "MapMovedReporter", () => $2611a7b4364593e5$export$f6eeee399afc4e9a);
749
- $parcel$export($2611a7b4364593e5$exports, "MapLoadingReporter", () => $2611a7b4364593e5$export$e57f9eaa51773f82);
750
- $parcel$export($2611a7b4364593e5$exports, "MapMarker", () => $2611a7b4364593e5$export$5c90a91c7455938c);
751
-
752
-
753
-
754
-
755
-
756
-
757
- var $3490fc4f4bda12f7$exports = {};
758
-
759
- $parcel$export($3490fc4f4bda12f7$exports, "getMapPadding", () => $3490fc4f4bda12f7$export$bb78f9f01775eef1);
760
- $parcel$export($3490fc4f4bda12f7$exports, "useMapMarker", () => $3490fc4f4bda12f7$export$278090850f6b3a9f);
761
-
762
-
763
- function $3490fc4f4bda12f7$var$calcMapPadding(rect, childRect) {
764
- return {
765
- left: Math.max(rect.left - childRect.left, 0),
766
- top: Math.max(rect.top - childRect.top, 0),
767
- right: Math.max(childRect.right - rect.right, 0),
768
- bottom: Math.max(childRect.bottom - rect.bottom, 0)
769
- };
770
- }
771
- function $3490fc4f4bda12f7$export$bb78f9f01775eef1(ref, parentRef) {
772
- const rect = parentRef.current?.getBoundingClientRect();
773
- const childRect = ref.current?.getBoundingClientRect();
774
- if (rect == null || childRect == null) return;
775
- return $3490fc4f4bda12f7$var$calcMapPadding(rect, childRect);
776
- }
777
- function $3490fc4f4bda12f7$export$278090850f6b3a9f(mapRef, markerRef, markerPosition) {
778
- (0, $9B3TU$react.useEffect)(()=>{
779
- const map = mapRef.current;
780
- if (map == null) return;
781
- if (markerPosition == null) {
782
- markerRef.current?.remove();
783
- return;
784
- }
785
- const marker = markerRef.current ?? new (0, $9B3TU$mapboxgl.Marker)();
786
- marker.setLngLat(markerPosition).addTo(map);
787
- markerRef.current = marker;
788
- return ()=>marker.remove();
789
- }, [
790
- mapRef.current,
791
- markerPosition
792
- ]);
793
- }
794
-
795
-
796
- function $2611a7b4364593e5$export$31b2e088aff2dc5d({ containerRef: containerRef }) {
797
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
798
- const debouncedResize = (0, $9B3TU$react.useRef)((0, $9B3TU$underscore.debounce)(()=>{
799
- mapRef.current?.resize();
800
- }, 100));
801
- (0, ($parcel$interopDefault($9B3TU$useresizeobserver)))({
802
- ref: containerRef,
803
- onResize: debouncedResize.current
804
- });
805
- return null;
806
- }
807
- function $2611a7b4364593e5$export$2ab96428dea558d6({ containerRef: containerRef , parentRef: parentRef , infoMarkerPosition: infoMarkerPosition }) {
808
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
809
- const [padding, setPadding] = (0, $9B3TU$react.useState)((0, $3490fc4f4bda12f7$export$bb78f9f01775eef1)(containerRef, parentRef));
810
- const updateMapPadding = (0, $9B3TU$react.useCallback)(()=>{
811
- const newPadding = (0, $3490fc4f4bda12f7$export$bb78f9f01775eef1)(containerRef, parentRef);
812
- setPadding(newPadding);
813
- }, [
814
- containerRef.current,
815
- parentRef.current
816
- ]);
817
- (0, $9B3TU$react.useEffect)(()=>{
818
- const map = mapRef.current;
819
- if (map == null) return;
820
- // Update map padding on load
821
- updateMapPadding();
822
- }, [
823
- mapRef.current
824
- ]);
825
- (0, ($parcel$interopDefault($9B3TU$useresizeobserver)))({
826
- ref: parentRef,
827
- onResize (sz) {
828
- updateMapPadding();
829
- }
830
- });
831
- (0, $9B3TU$macrostratmapboxreact.useMapEaseToCenter)(infoMarkerPosition, padding);
832
- return null;
833
- }
834
- function $2611a7b4364593e5$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = null }) {
835
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
836
- const dispatch = (0, $9B3TU$macrostratmapboxreact.useMapDispatch)();
837
- const mapMovedCallback = (0, $9B3TU$react.useCallback)(()=>{
838
- const map = mapRef.current;
839
- if (map == null) return;
840
- const mapPosition = (0, $9B3TU$macrostratmapboxutils.getMapPosition)(map);
841
- dispatch({
842
- type: "map-moved",
843
- payload: mapPosition
844
- });
845
- onMapMoved?.(mapPosition, map);
846
- }, [
847
- mapRef.current,
848
- onMapMoved,
849
- dispatch
850
- ]);
851
- (0, $9B3TU$react.useEffect)(()=>{
852
- // Get the current value of the map. Useful for gradually moving away
853
- // from class component
854
- const map = mapRef.current;
855
- if (map == null) return;
856
- // Update the URI when the map moves
857
- mapMovedCallback();
858
- const cb = (0, $9B3TU$underscore.debounce)(mapMovedCallback, 100);
859
- map.on("moveend", cb);
860
- return ()=>{
861
- map?.off("moveend", cb);
862
- };
863
- }, [
864
- mapMovedCallback
865
- ]);
866
- return null;
867
- }
868
- function $2611a7b4364593e5$export$e57f9eaa51773f82({ ignoredSources: ignoredSources , onMapLoading: onMapLoading = null , onMapIdle: onMapIdle = null , mapIsLoading: mapIsLoading1 , }) {
869
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
870
- const loadingRef = (0, $9B3TU$react.useRef)(false);
871
- const dispatch = (0, $9B3TU$macrostratmapboxreact.useMapDispatch)();
872
- (0, $9B3TU$react.useEffect)(()=>{
873
- const map = mapRef.current;
874
- const mapIsLoading = loadingRef.current;
875
- if (map == null) return;
876
- let didSendLoading = false;
877
- const loadingCallback = (evt)=>{
878
- if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;
879
- if (didSendLoading) return;
880
- onMapLoading?.(evt);
881
- dispatch({
882
- type: "set-loading",
883
- payload: true
884
- });
885
- loadingRef.current = true;
886
- didSendLoading = true;
887
- };
888
- const idleCallback = (evt)=>{
889
- if (!mapIsLoading) return;
890
- dispatch({
891
- type: "set-loading",
892
- payload: false
893
- });
894
- loadingRef.current = false;
895
- onMapIdle?.(evt);
896
- };
897
- map.on("sourcedataloading", loadingCallback);
898
- map.on("idle", idleCallback);
899
- return ()=>{
900
- map?.off("sourcedataloading", loadingCallback);
901
- map?.off("idle", idleCallback);
902
- };
903
- }, [
904
- ignoredSources,
905
- mapRef.current,
906
- mapIsLoading1
907
- ]);
908
- return null;
909
- }
910
- function $2611a7b4364593e5$export$5c90a91c7455938c({ position: position , setPosition: setPosition , centerMarker: centerMarker = true }) {
911
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
912
- const markerRef = (0, $9B3TU$react.useRef)(null);
913
- (0, $3490fc4f4bda12f7$export$278090850f6b3a9f)(mapRef, markerRef, position);
914
- const handleMapClick = (0, $9B3TU$react.useCallback)((event)=>{
915
- setPosition(event.lngLat, event, mapRef.current);
916
- // We should integrate this with the "easeToCenter" hook
917
- if (centerMarker) mapRef.current?.flyTo({
918
- center: event.lngLat,
919
- duration: 800
920
- });
921
- }, [
922
- mapRef.current,
923
- setPosition
924
- ]);
925
- (0, $9B3TU$react.useEffect)(()=>{
926
- const map = mapRef.current;
927
- if (map != null && setPosition != null) map.on("click", handleMapClick);
928
- return ()=>{
929
- map?.off("click", handleMapClick);
930
- };
931
- }, [
932
- mapRef.current,
933
- setPosition
934
- ]);
935
- return null;
936
- }
937
-
938
-
939
-
940
- var $12b6032029db16d4$exports = {};
941
-
942
- $parcel$export($12b6032029db16d4$exports, "MapView", () => $12b6032029db16d4$export$ab1e7a67d6ec5ad8);
943
- $parcel$export($12b6032029db16d4$exports, "MapTerrainManager", () => $12b6032029db16d4$export$cee395a8a2a00b29);
944
-
945
-
946
-
947
-
948
-
949
-
950
- var $094b46e231302b09$exports = {};
951
-
952
- $parcel$export($094b46e231302b09$exports, "map-view-container", () => $094b46e231302b09$export$11aa7dc57218208d, (v) => $094b46e231302b09$export$11aa7dc57218208d = v);
953
- $parcel$export($094b46e231302b09$exports, "mapbox-map", () => $094b46e231302b09$export$d0dcaf774d09fc4c, (v) => $094b46e231302b09$export$d0dcaf774d09fc4c = v);
954
- var $094b46e231302b09$export$11aa7dc57218208d;
955
- var $094b46e231302b09$export$d0dcaf774d09fc4c;
956
- $094b46e231302b09$export$11aa7dc57218208d = `-mD4Aa_map-view-container`;
957
- $094b46e231302b09$export$d0dcaf774d09fc4c = `-mD4Aa_mapbox-map`;
958
-
959
-
960
-
961
- function $ecfbeec2ae4211a4$export$b730542ee281c4b1(map, shouldEnable, sourceID = null) {
962
- let demSourceID = (sourceID ?? $ecfbeec2ae4211a4$var$getTerrainSourceID(map)) ?? "mapbox-dem";
963
- console.log("Enabling 3D terrain with source", demSourceID);
964
- if (!map.style?._loaded) {
965
- map.once("style.load", ()=>{
966
- $ecfbeec2ae4211a4$export$b730542ee281c4b1(map, shouldEnable, demSourceID);
967
- });
968
- return;
969
- }
970
- // Enable or disable terrain depending on our current desires...
971
- const currentTerrain = map.getTerrain();
972
- if (!shouldEnable) {
973
- if (currentTerrain != null) map.setTerrain(null);
974
- return;
975
- }
976
- if (currentTerrain != null) return;
977
- // Add a DEM source if one is not found already.
978
- if (map.getSource(demSourceID) == null) map.addSource(demSourceID, {
979
- type: "raster-dem",
980
- url: "mapbox://mapbox.mapbox-terrain-dem-v1",
981
- tileSize: 512,
982
- maxzoom: 14
983
- });
984
- // add a sky layer that will show when the map is highly pitched
985
- if (map.getLayer("sky") == null) map.addLayer({
986
- id: "sky",
987
- type: "sky",
988
- paint: {
989
- "sky-type": "atmosphere",
990
- "sky-atmosphere-sun": [
991
- 0.0,
992
- 0.0
993
- ],
994
- "sky-atmosphere-sun-intensity": 15
995
- }
996
- });
997
- map.setTerrain({
998
- source: demSourceID,
999
- exaggeration: 1
1000
- });
1001
- }
1002
- function $ecfbeec2ae4211a4$var$getTerrainSourceID(map) {
1003
- for (const [key, source] of Object.entries(map.getStyle().sources)){
1004
- if (source.type == "raster-dem") return key;
1005
- }
1006
- return null;
1007
- }
1008
-
1009
-
1010
-
1011
-
1012
- const $12b6032029db16d4$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled({
1013
- ...(0, (/*@__PURE__*/$parcel$interopDefault($094b46e231302b09$exports))),
1014
- ...(0, (/*@__PURE__*/$parcel$interopDefault($35f1bc0112883d51$exports)))
1015
- });
1016
- function $12b6032029db16d4$var$defaultInitializeMap(container, args = {}) {
1017
- const { mapPosition: mapPosition , ...rest } = args;
1018
- const map = new (0, ($parcel$interopDefault($9B3TU$mapboxgl))).Map({
1019
- container: container,
1020
- maxZoom: 18,
1021
- //maxTileCacheSize: 0,
1022
- logoPosition: "bottom-left",
1023
- trackResize: true,
1024
- antialias: true,
1025
- optimizeForTerrain: true,
1026
- ...rest
1027
- });
1028
- // set initial map position
1029
- if (mapPosition != null) (0, $9B3TU$macrostratmapboxutils.setMapPosition)(map, mapPosition);
1030
- //setMapPosition(map, mapPosition);
1031
- return map;
1032
- }
1033
- const $12b6032029db16d4$var$defaultMapPosition = {
1034
- camera: {
1035
- lat: 34,
1036
- lng: -120,
1037
- altitude: 300000
1038
- }
1039
- };
1040
- function $12b6032029db16d4$export$ab1e7a67d6ec5ad8(props) {
1041
- let { terrainSourceID: terrainSourceID } = props;
1042
- const { enableTerrain: enableTerrain = true , style: style , mapPosition: mapPosition = $12b6032029db16d4$var$defaultMapPosition , initializeMap: initializeMap = $12b6032029db16d4$var$defaultInitializeMap , children: children , accessToken: accessToken , infoMarkerPosition: infoMarkerPosition , transformRequest: transformRequest , projection: projection , onMapLoaded: onMapLoaded = null , onStyleLoaded: onStyleLoaded = null , ...rest } = props;
1043
- if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
1044
- if (accessToken != null) (0, ($parcel$interopDefault($9B3TU$mapboxgl))).accessToken = accessToken;
1045
- const dispatch = (0, $9B3TU$macrostratmapboxreact.useMapDispatch)();
1046
- let mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
1047
- const ref = (0, $9B3TU$react.useRef)();
1048
- const parentRef = (0, $9B3TU$react.useRef)();
1049
- // Keep track of map position for reloads
1050
- (0, $9B3TU$react.useEffect)(()=>{
1051
- if (style == null) return;
1052
- if (mapRef.current != null) {
1053
- console.log("Setting style", style);
1054
- mapRef.current.setStyle(style);
1055
- return;
1056
- }
1057
- const map = initializeMap(ref.current, {
1058
- style: style,
1059
- projection: projection,
1060
- mapPosition: mapPosition,
1061
- ...rest
1062
- });
1063
- map.on("style.load", ()=>{
1064
- onStyleLoaded?.(map);
1065
- dispatch({
1066
- type: "set-style-loaded",
1067
- payload: true
1068
- });
1069
- });
1070
- onMapLoaded?.(map);
1071
- dispatch({
1072
- type: "set-map",
1073
- payload: map
1074
- });
1075
- }, [
1076
- style
1077
- ]);
1078
- // Map style updating
1079
- // useEffect(() => {
1080
- // if (mapRef?.current == null || style == null) return;
1081
- // mapRef?.current?.setStyle(style);
1082
- // }, [mapRef.current, style]);
1083
- // Set map position if it changes
1084
- // useEffect(() => {
1085
- // const map = mapRef.current;
1086
- // if (map == null || mapPosition == null) return;
1087
- // setMapPosition(map, mapPosition);
1088
- // }, [mapPosition]);
1089
- const _computedMapPosition = (0, $9B3TU$macrostratmapboxreact.useMapPosition)();
1090
- const { mapUse3D: mapUse3D , mapIsRotated: mapIsRotated } = (0, $9B3TU$macrostratmapboxutils.mapViewInfo)(_computedMapPosition);
1091
- // Get map projection
1092
- const _projection = mapRef.current?.getProjection()?.name ?? "mercator";
1093
- const className = (0, ($parcel$interopDefault($9B3TU$classnames)))({
1094
- "is-rotated": mapIsRotated ?? false,
1095
- "is-3d-available": mapUse3D ?? false
1096
- }, `${_projection}-projection`);
1097
- return $12b6032029db16d4$var$h("div.map-view-container.main-view", {
1098
- ref: parentRef
1099
- }, [
1100
- $12b6032029db16d4$var$h("div.mapbox-map#map", {
1101
- ref: ref,
1102
- className: className
1103
- }),
1104
- $12b6032029db16d4$var$h((0, $2611a7b4364593e5$export$e57f9eaa51773f82), {
1105
- ignoredSources: [
1106
- "elevationMarker",
1107
- "crossSectionEndpoints"
1108
- ]
1109
- }),
1110
- $12b6032029db16d4$var$h((0, $2611a7b4364593e5$export$f6eeee399afc4e9a)),
1111
- $12b6032029db16d4$var$h((0, $2611a7b4364593e5$export$31b2e088aff2dc5d), {
1112
- containerRef: ref
1113
- }),
1114
- $12b6032029db16d4$var$h((0, $2611a7b4364593e5$export$2ab96428dea558d6), {
1115
- containerRef: ref,
1116
- parentRef: parentRef,
1117
- infoMarkerPosition: infoMarkerPosition
1118
- }),
1119
- $12b6032029db16d4$var$h($12b6032029db16d4$export$cee395a8a2a00b29, {
1120
- mapUse3D: mapUse3D,
1121
- terrainSourceID: terrainSourceID
1122
- }),
1123
- children,
1124
- ]);
1125
- }
1126
- function $12b6032029db16d4$export$cee395a8a2a00b29({ mapUse3D: mapUse3D , terrainSourceID: terrainSourceID }) {
1127
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
1128
- (0, $9B3TU$react.useEffect)(()=>{
1129
- const map = mapRef.current;
1130
- if (map == null) return;
1131
- (0, $ecfbeec2ae4211a4$export$b730542ee281c4b1)(map, mapUse3D, terrainSourceID);
1132
- }, [
1133
- mapRef.current,
1134
- mapUse3D
1135
- ]);
1136
- return null;
1137
- }
1138
-
1139
-
1140
- var $33088e8384af337c$exports = {};
1141
-
1142
- $parcel$export($33088e8384af337c$exports, "feature-panel", () => $33088e8384af337c$export$d27ce8c17b289f33, (v) => $33088e8384af337c$export$d27ce8c17b289f33 = v);
1143
- $parcel$export($33088e8384af337c$exports, "key-value", () => $33088e8384af337c$export$6025d8aaa4edba3b, (v) => $33088e8384af337c$export$6025d8aaa4edba3b = v);
1144
- $parcel$export($33088e8384af337c$exports, "key", () => $33088e8384af337c$export$df61b30b684217c0, (v) => $33088e8384af337c$export$df61b30b684217c0 = v);
1145
- $parcel$export($33088e8384af337c$exports, "value", () => $33088e8384af337c$export$2ab9a8f9f1186f14, (v) => $33088e8384af337c$export$2ab9a8f9f1186f14 = v);
1146
- $parcel$export($33088e8384af337c$exports, "feature-properties", () => $33088e8384af337c$export$4f7f4a0a9b87a0a1, (v) => $33088e8384af337c$export$4f7f4a0a9b87a0a1 = v);
1147
- $parcel$export($33088e8384af337c$exports, "feature-header", () => $33088e8384af337c$export$435bd1864bef6e22, (v) => $33088e8384af337c$export$435bd1864bef6e22 = v);
1148
- $parcel$export($33088e8384af337c$exports, "feature-group", () => $33088e8384af337c$export$a1386d43b662271, (v) => $33088e8384af337c$export$a1386d43b662271 = v);
1149
- $parcel$export($33088e8384af337c$exports, "tile-info", () => $33088e8384af337c$export$1ea80fe0e5d4f6be, (v) => $33088e8384af337c$export$1ea80fe0e5d4f6be = v);
1150
- $parcel$export($33088e8384af337c$exports, "opacity-slider", () => $33088e8384af337c$export$802c81ec652235aa, (v) => $33088e8384af337c$export$802c81ec652235aa = v);
1151
- $parcel$export($33088e8384af337c$exports, "unit-number", () => $33088e8384af337c$export$ce32b714ddd6b59, (v) => $33088e8384af337c$export$ce32b714ddd6b59 = v);
1152
- $parcel$export($33088e8384af337c$exports, "unit", () => $33088e8384af337c$export$523c0b569236b342, (v) => $33088e8384af337c$export$523c0b569236b342 = v);
1153
- $parcel$export($33088e8384af337c$exports, "page", () => $33088e8384af337c$export$523fb3936f49e028, (v) => $33088e8384af337c$export$523fb3936f49e028 = v);
1154
- $parcel$export($33088e8384af337c$exports, "dev-index-page", () => $33088e8384af337c$export$ee954d6f5e1b21cc, (v) => $33088e8384af337c$export$ee954d6f5e1b21cc = v);
1155
- var $33088e8384af337c$export$d27ce8c17b289f33;
1156
- var $33088e8384af337c$export$6025d8aaa4edba3b;
1157
- var $33088e8384af337c$export$df61b30b684217c0;
1158
- var $33088e8384af337c$export$2ab9a8f9f1186f14;
1159
- var $33088e8384af337c$export$4f7f4a0a9b87a0a1;
1160
- var $33088e8384af337c$export$435bd1864bef6e22;
1161
- var $33088e8384af337c$export$a1386d43b662271;
1162
- var $33088e8384af337c$export$1ea80fe0e5d4f6be;
1163
- var $33088e8384af337c$export$802c81ec652235aa;
1164
- var $33088e8384af337c$export$ce32b714ddd6b59;
1165
- var $33088e8384af337c$export$523c0b569236b342;
1166
- var $33088e8384af337c$export$523fb3936f49e028;
1167
- var $33088e8384af337c$export$ee954d6f5e1b21cc;
1168
- $33088e8384af337c$export$d27ce8c17b289f33 = "feature-panel_48e225";
1169
- $33088e8384af337c$export$6025d8aaa4edba3b = "key-value_48e225";
1170
- $33088e8384af337c$export$df61b30b684217c0 = "key_48e225";
1171
- $33088e8384af337c$export$2ab9a8f9f1186f14 = "value_48e225";
1172
- $33088e8384af337c$export$4f7f4a0a9b87a0a1 = "feature-properties_48e225";
1173
- $33088e8384af337c$export$435bd1864bef6e22 = "feature-header_48e225";
1174
- $33088e8384af337c$export$a1386d43b662271 = "feature-group_48e225";
1175
- $33088e8384af337c$export$1ea80fe0e5d4f6be = "tile-info_48e225";
1176
- $33088e8384af337c$export$802c81ec652235aa = "opacity-slider_48e225";
1177
- $33088e8384af337c$export$ce32b714ddd6b59 = "unit-number_48e225";
1178
- $33088e8384af337c$export$523c0b569236b342 = "unit_48e225";
1179
- $33088e8384af337c$export$523fb3936f49e028 = "page_48e225";
1180
- $33088e8384af337c$export$ee954d6f5e1b21cc = "dev-index-page_48e225";
1181
-
1182
-
1183
- var $abbe8d0af34cbbed$exports = {};
1184
-
1185
- $parcel$export($abbe8d0af34cbbed$exports, "TileExtentLayer", () => $abbe8d0af34cbbed$export$86c09739b12f23cd);
1186
-
1187
-
1188
-
1189
- function $abbe8d0af34cbbed$export$86c09739b12f23cd({ tile: tile , color: color = "red" }) {
1190
- const styleCallback = (0, $9B3TU$react.useCallback)((map, val)=>{
1191
- const style = map.getStyle();
1192
- if (style.layers == null) return;
1193
- style.layers = style.layers.filter((l)=>l.id != "tile-extent");
1194
- if (val == null) return map.setStyle(style);
1195
- const { x: x , y: y , z: z } = val;
1196
- const extent = (0, $9B3TU$mapboxtilebelt.tileToGeoJSON)([
1197
- x,
1198
- y,
1199
- z
1200
- ]);
1201
- const source = {
1202
- type: "geojson",
1203
- data: extent
1204
- };
1205
- const layer = {
1206
- id: "tile-extent",
1207
- type: "line",
1208
- source: "tile-extent",
1209
- paint: {
1210
- "line-color": color,
1211
- "line-width": 2
1212
- }
1213
- };
1214
- style.sources["tile-extent"] = source;
1215
- style.layers.push(layer);
1216
- map.setStyle(style);
1217
- }, [
1218
- color
1219
- ]);
1220
- const map1 = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
1221
- (0, $9B3TU$macrostratmapboxreact.useMapConditionalStyle)(map1, tile, styleCallback);
1222
- return null;
1223
- }
1224
-
1225
-
1226
- var $db14eb7a5c07abdb$exports = {};
1227
-
1228
- $parcel$export($db14eb7a5c07abdb$exports, "FeatureProperties", () => $db14eb7a5c07abdb$export$2906e7f4b228efe9);
1229
- $parcel$export($db14eb7a5c07abdb$exports, "FeatureRecord", () => $db14eb7a5c07abdb$export$dc87b4d46cea200d);
1230
- $parcel$export($db14eb7a5c07abdb$exports, "FeatureSelectionHandler", () => $db14eb7a5c07abdb$export$214daccdda0f4ac6);
1231
- $parcel$export($db14eb7a5c07abdb$exports, "Features", () => $db14eb7a5c07abdb$export$617d79dae526d2cf);
1232
- $parcel$export($db14eb7a5c07abdb$exports, "TileInfo", () => $db14eb7a5c07abdb$export$43c75dec9d0b96c);
1233
- $parcel$export($db14eb7a5c07abdb$exports, "FeaturePanel", () => $db14eb7a5c07abdb$export$43277c51a01761c1);
1234
-
1235
-
1236
-
1237
-
1238
-
1239
-
1240
-
1241
- var $750d69d73bfbdc9a$exports = {};
1242
-
1243
- $parcel$export($750d69d73bfbdc9a$exports, "ExpansionPanelSummary", () => $750d69d73bfbdc9a$export$cea00a9d724d5a32);
1244
- $parcel$export($750d69d73bfbdc9a$exports, "InfoPanelSection", () => $750d69d73bfbdc9a$export$39c134eb0b07cf0e);
1245
- $parcel$export($750d69d73bfbdc9a$exports, "ExpansionPanel", () => $750d69d73bfbdc9a$export$40e646e38e6ed100);
1246
- $parcel$export($750d69d73bfbdc9a$exports, "SubExpansionPanel", () => $750d69d73bfbdc9a$export$d7160281aff7c3b8);
1247
- $parcel$export($750d69d73bfbdc9a$exports, "ExpandableDetailsPanel", () => $750d69d73bfbdc9a$export$44ad9ff780615135);
1248
- $parcel$export($750d69d73bfbdc9a$exports, "ExpansionBody", () => $750d69d73bfbdc9a$export$263416b670b3f129);
1249
- $parcel$export($750d69d73bfbdc9a$exports, "PanelSubhead", () => $a0970d22776f9f4c$export$ed081779ec3709aa);
1250
-
1251
-
1252
-
1253
- var $b1c160aff794b8f5$exports = {};
1254
-
1255
- $parcel$export($b1c160aff794b8f5$exports, "panel-subhead", () => $b1c160aff794b8f5$export$bb6008c7ec506dc5, (v) => $b1c160aff794b8f5$export$bb6008c7ec506dc5 = v);
1256
- $parcel$export($b1c160aff794b8f5$exports, "title", () => $b1c160aff794b8f5$export$fb184b623420d9be, (v) => $b1c160aff794b8f5$export$fb184b623420d9be = v);
1257
- $parcel$export($b1c160aff794b8f5$exports, "expansion-panel", () => $b1c160aff794b8f5$export$1db06abc8684077f, (v) => $b1c160aff794b8f5$export$1db06abc8684077f = v);
1258
- $parcel$export($b1c160aff794b8f5$exports, "sub-expansion-panel", () => $b1c160aff794b8f5$export$e1943f56d410f24c, (v) => $b1c160aff794b8f5$export$e1943f56d410f24c = v);
1259
- $parcel$export($b1c160aff794b8f5$exports, "expansion-panel-header", () => $b1c160aff794b8f5$export$771f363b9f663d2c, (v) => $b1c160aff794b8f5$export$771f363b9f663d2c = v);
1260
- $parcel$export($b1c160aff794b8f5$exports, "expansion-summary-title-help", () => $b1c160aff794b8f5$export$47b2fa26e88e0093, (v) => $b1c160aff794b8f5$export$47b2fa26e88e0093 = v);
1261
- $parcel$export($b1c160aff794b8f5$exports, "expansion-children", () => $b1c160aff794b8f5$export$d8457cb7ae0c47fd, (v) => $b1c160aff794b8f5$export$d8457cb7ae0c47fd = v);
1262
- $parcel$export($b1c160aff794b8f5$exports, "expansion-panel-subtext", () => $b1c160aff794b8f5$export$f3447611ed163f53, (v) => $b1c160aff794b8f5$export$f3447611ed163f53 = v);
1263
- $parcel$export($b1c160aff794b8f5$exports, "expandable-details-main", () => $b1c160aff794b8f5$export$561f0c2134cd9732, (v) => $b1c160aff794b8f5$export$561f0c2134cd9732 = v);
1264
- $parcel$export($b1c160aff794b8f5$exports, "expandable-details-header", () => $b1c160aff794b8f5$export$ec357a59e90ee7ee, (v) => $b1c160aff794b8f5$export$ec357a59e90ee7ee = v);
1265
- $parcel$export($b1c160aff794b8f5$exports, "expandable-details-children", () => $b1c160aff794b8f5$export$ae8d16cb87fbdc31, (v) => $b1c160aff794b8f5$export$ae8d16cb87fbdc31 = v);
1266
- $parcel$export($b1c160aff794b8f5$exports, "expandable-details-toggle", () => $b1c160aff794b8f5$export$1089a6d45649b54c, (v) => $b1c160aff794b8f5$export$1089a6d45649b54c = v);
1267
- $parcel$export($b1c160aff794b8f5$exports, "expandable-details", () => $b1c160aff794b8f5$export$20a01d7b55fba18b, (v) => $b1c160aff794b8f5$export$20a01d7b55fba18b = v);
1268
- $parcel$export($b1c160aff794b8f5$exports, "macrostrat-unit", () => $b1c160aff794b8f5$export$fcdb9e479e3129ed, (v) => $b1c160aff794b8f5$export$fcdb9e479e3129ed = v);
1269
- $parcel$export($b1c160aff794b8f5$exports, "expansion-body", () => $b1c160aff794b8f5$export$2d112e83849a3cf7, (v) => $b1c160aff794b8f5$export$2d112e83849a3cf7 = v);
1270
- $parcel$export($b1c160aff794b8f5$exports, "expansion-panel-detail-header", () => $b1c160aff794b8f5$export$854d9fad3b5263eb, (v) => $b1c160aff794b8f5$export$854d9fad3b5263eb = v);
1271
- $parcel$export($b1c160aff794b8f5$exports, "expansion-panel-detail-body", () => $b1c160aff794b8f5$export$494f9067c39d24ef, (v) => $b1c160aff794b8f5$export$494f9067c39d24ef = v);
1272
- var $b1c160aff794b8f5$export$bb6008c7ec506dc5;
1273
- var $b1c160aff794b8f5$export$fb184b623420d9be;
1274
- var $b1c160aff794b8f5$export$1db06abc8684077f;
1275
- var $b1c160aff794b8f5$export$e1943f56d410f24c;
1276
- var $b1c160aff794b8f5$export$771f363b9f663d2c;
1277
- var $b1c160aff794b8f5$export$47b2fa26e88e0093;
1278
- var $b1c160aff794b8f5$export$d8457cb7ae0c47fd;
1279
- var $b1c160aff794b8f5$export$f3447611ed163f53;
1280
- var $b1c160aff794b8f5$export$561f0c2134cd9732;
1281
- var $b1c160aff794b8f5$export$ec357a59e90ee7ee;
1282
- var $b1c160aff794b8f5$export$ae8d16cb87fbdc31;
1283
- var $b1c160aff794b8f5$export$1089a6d45649b54c;
1284
- var $b1c160aff794b8f5$export$20a01d7b55fba18b;
1285
- var $b1c160aff794b8f5$export$fcdb9e479e3129ed;
1286
- var $b1c160aff794b8f5$export$2d112e83849a3cf7;
1287
- var $b1c160aff794b8f5$export$854d9fad3b5263eb;
1288
- var $b1c160aff794b8f5$export$494f9067c39d24ef;
1289
- $b1c160aff794b8f5$export$bb6008c7ec506dc5 = "panel-subhead_1340c8";
1290
- $b1c160aff794b8f5$export$fb184b623420d9be = "title_1340c8";
1291
- $b1c160aff794b8f5$export$1db06abc8684077f = "expansion-panel_1340c8";
1292
- $b1c160aff794b8f5$export$e1943f56d410f24c = "sub-expansion-panel_1340c8";
1293
- $b1c160aff794b8f5$export$771f363b9f663d2c = "expansion-panel-header_1340c8";
1294
- $b1c160aff794b8f5$export$47b2fa26e88e0093 = "expansion-summary-title-help_1340c8";
1295
- $b1c160aff794b8f5$export$d8457cb7ae0c47fd = "expansion-children_1340c8";
1296
- $b1c160aff794b8f5$export$f3447611ed163f53 = "expansion-panel-subtext_1340c8";
1297
- $b1c160aff794b8f5$export$561f0c2134cd9732 = "expandable-details-main_1340c8";
1298
- $b1c160aff794b8f5$export$ec357a59e90ee7ee = "expandable-details-header_1340c8";
1299
- $b1c160aff794b8f5$export$ae8d16cb87fbdc31 = "expandable-details-children_1340c8";
1300
- $b1c160aff794b8f5$export$1089a6d45649b54c = "expandable-details-toggle_1340c8";
1301
- $b1c160aff794b8f5$export$20a01d7b55fba18b = "expandable-details_1340c8";
1302
- $b1c160aff794b8f5$export$fcdb9e479e3129ed = "macrostrat-unit_1340c8";
1303
- $b1c160aff794b8f5$export$2d112e83849a3cf7 = "expansion-body_1340c8";
1304
- $b1c160aff794b8f5$export$854d9fad3b5263eb = "expansion-panel-detail-header_1340c8";
1305
- $b1c160aff794b8f5$export$494f9067c39d24ef = "expansion-panel-detail-body_1340c8";
1306
-
1307
-
1308
-
1309
-
1310
-
1311
-
1312
- const $a0970d22776f9f4c$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($b1c160aff794b8f5$exports))));
1313
- function $a0970d22776f9f4c$export$ed081779ec3709aa(props) {
1314
- const { title: title , component: component = "h3" , children: children , ...rest } = props;
1315
- return $a0970d22776f9f4c$var$h("div.panel-subhead", rest, [
1316
- $a0970d22776f9f4c$var$h(component, {
1317
- className: "title"
1318
- }, title),
1319
- children,
1320
- ]);
1321
- }
1322
-
1323
-
1324
- const $750d69d73bfbdc9a$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($b1c160aff794b8f5$exports))));
1325
- function $750d69d73bfbdc9a$export$cea00a9d724d5a32(props) {
1326
- const { expanded: expanded , children: children , onChange: onChange , className: className , title: title , titleComponent: titleComponent } = props;
1327
- const icon = expanded ? "chevron-up" : "chevron-down";
1328
- return $750d69d73bfbdc9a$var$h((0, $a0970d22776f9f4c$export$ed081779ec3709aa), {
1329
- className: (0, ($parcel$interopDefault($9B3TU$classnames)))("expansion-panel-header", className),
1330
- onClick: onChange,
1331
- title: title,
1332
- component: titleComponent
1333
- }, [
1334
- children,
1335
- $750d69d73bfbdc9a$var$h((0, $9B3TU$blueprintjscore.Icon), {
1336
- icon: icon
1337
- })
1338
- ]);
1339
- }
1340
- function $750d69d73bfbdc9a$var$ExpansionPanelBase(props) {
1341
- let { title: title , titleComponent: titleComponent = "h3" , children: children , expanded: expanded , helpText: helpText , onChange: onChange = ()=>{} , sideComponent: sideComponent = null , className: className , } = props;
1342
- const [isOpen, setOpen] = (0, $9B3TU$react.useState)(expanded || false);
1343
- const onChange_ = ()=>{
1344
- onChange();
1345
- setOpen(!isOpen);
1346
- };
1347
- return $750d69d73bfbdc9a$var$h("div.expansion-panel-base", {
1348
- className: (0, ($parcel$interopDefault($9B3TU$classnames)))(className, {
1349
- expanded: isOpen,
1350
- collapsed: !isOpen
1351
- })
1352
- }, [
1353
- $750d69d73bfbdc9a$var$h($750d69d73bfbdc9a$export$cea00a9d724d5a32, {
1354
- onChange: onChange_,
1355
- expanded: isOpen,
1356
- title: title,
1357
- titleComponent: titleComponent
1358
- }, $750d69d73bfbdc9a$var$h("div.expansion-summary-title-help", [
1359
- $750d69d73bfbdc9a$var$h("span.expansion-panel-subtext", helpText),
1360
- " ",
1361
- sideComponent,
1362
- ])),
1363
- $750d69d73bfbdc9a$var$h((0, $9B3TU$blueprintjscore.Collapse), {
1364
- isOpen: isOpen
1365
- }, $750d69d73bfbdc9a$var$h("div.expansion-children", null, children)),
1366
- ]);
1367
- }
1368
- function $750d69d73bfbdc9a$export$39c134eb0b07cf0e(props) {
1369
- let { title: title , children: children , className: className , headerElement: headerElement = null } = props;
1370
- return $750d69d73bfbdc9a$var$h("div.info-panel-section", {
1371
- className: className
1372
- }, [
1373
- $750d69d73bfbdc9a$var$h("div.panel-subhead", null, headerElement ?? $750d69d73bfbdc9a$var$h("h3", title)),
1374
- $750d69d73bfbdc9a$var$h("div.panel-content", null, children),
1375
- ]);
1376
- }
1377
- function $750d69d73bfbdc9a$export$40e646e38e6ed100(props) {
1378
- return $750d69d73bfbdc9a$var$h($750d69d73bfbdc9a$var$ExpansionPanelBase, {
1379
- ...props,
1380
- className: "expansion-panel"
1381
- });
1382
- }
1383
- function $750d69d73bfbdc9a$export$d7160281aff7c3b8(props) {
1384
- return $750d69d73bfbdc9a$var$h($750d69d73bfbdc9a$var$ExpansionPanelBase, {
1385
- ...props,
1386
- className: "expansion-panel sub-expansion-panel",
1387
- titleComponent: "h4"
1388
- });
1389
- }
1390
- function $750d69d73bfbdc9a$export$44ad9ff780615135(props) {
1391
- let { title: title , children: children , value: value , headerElement: headerElement , className: className } = props;
1392
- const [isOpen, setIsOpen] = (0, $9B3TU$react.useState)(false);
1393
- headerElement ??= $750d69d73bfbdc9a$var$h([
1394
- $750d69d73bfbdc9a$var$h("div.title", title),
1395
- value
1396
- ]);
1397
- return $750d69d73bfbdc9a$var$h("div.expandable-details", {
1398
- className: className
1399
- }, [
1400
- $750d69d73bfbdc9a$var$h("div.expandable-details-main", [
1401
- $750d69d73bfbdc9a$var$h("div.expandable-details-header", headerElement),
1402
- $750d69d73bfbdc9a$var$h("div.expandable-details-toggle", [
1403
- $750d69d73bfbdc9a$var$h((0, $9B3TU$blueprintjscore.Button), {
1404
- small: true,
1405
- minimal: true,
1406
- active: isOpen,
1407
- onClick: ()=>setIsOpen(!isOpen),
1408
- icon: "more"
1409
- }),
1410
- ]),
1411
- ]),
1412
- $750d69d73bfbdc9a$var$h((0, $9B3TU$blueprintjscore.Collapse), {
1413
- isOpen: isOpen
1414
- }, $750d69d73bfbdc9a$var$h("div.expandable-details-children", null, children)),
1415
- ]);
1416
- }
1417
- function $750d69d73bfbdc9a$export$263416b670b3f129({ title: title , className: className , children: children }) {
1418
- return $750d69d73bfbdc9a$var$h("div.expansion-body", {
1419
- className: className
1420
- }, [
1421
- $750d69d73bfbdc9a$var$h("div.expansion-panel-detail-header", title),
1422
- $750d69d73bfbdc9a$var$h("div.expansion-panel-detail-body", null, children),
1423
- ]);
1424
- }
1425
-
1426
-
1427
- const $db14eb7a5c07abdb$var$h = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($33088e8384af337c$exports))));
1428
- function $db14eb7a5c07abdb$export$2906e7f4b228efe9({ data: data , ...rest }) {
1429
- return $db14eb7a5c07abdb$var$h("div.feature-properties", [
1430
- $db14eb7a5c07abdb$var$h((0, $9B3TU$macrostratuicomponents.JSONView), {
1431
- data: data,
1432
- hideRoot: true,
1433
- ...rest
1434
- }),
1435
- ]);
1436
- }
1437
- function $db14eb7a5c07abdb$export$dc87b4d46cea200d({ feature: feature }) {
1438
- const props = feature.properties;
1439
- return $db14eb7a5c07abdb$var$h("div.feature-record", [
1440
- $db14eb7a5c07abdb$var$h.if(Object.keys(props).length > 0)($db14eb7a5c07abdb$export$2906e7f4b228efe9, {
1441
- data: props
1442
- }),
1443
- ]);
1444
- }
1445
- function $db14eb7a5c07abdb$export$214daccdda0f4ac6({ selectedLocation: selectedLocation , setFeatures: setFeatures , radius: radius = 2 }) {
1446
- const mapRef = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
1447
- const { isLoading: isLoading } = (0, $9B3TU$macrostratmapboxreact.useMapStatus)();
1448
- const prevLocation = (0, $9B3TU$macrostratuicomponents.usePrevious)(selectedLocation);
1449
- (0, $9B3TU$react.useEffect)(()=>{
1450
- const map = mapRef?.current;
1451
- if (map == null) return;
1452
- if (selectedLocation == null) {
1453
- setFeatures(null);
1454
- return;
1455
- }
1456
- // Don't update if the location hasn't changed
1457
- if (selectedLocation == prevLocation) return;
1458
- const r = radius;
1459
- const pt = map.project(selectedLocation);
1460
- const bbox = [
1461
- [
1462
- pt.x - r,
1463
- pt.y - r
1464
- ],
1465
- [
1466
- pt.x + r,
1467
- pt.y + r
1468
- ],
1469
- ];
1470
- const features = map.queryRenderedFeatures(bbox);
1471
- setFeatures(features);
1472
- }, [
1473
- mapRef?.current,
1474
- selectedLocation,
1475
- isLoading
1476
- ]);
1477
- return null;
1478
- }
1479
- function $db14eb7a5c07abdb$var$FeatureHeader({ feature: feature }) {
1480
- return $db14eb7a5c07abdb$var$h("div.feature-header", [
1481
- $db14eb7a5c07abdb$var$h("h3", [
1482
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1483
- label: "Source",
1484
- value: feature.source
1485
- }),
1486
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1487
- label: "Source layer",
1488
- value: feature.sourceLayer
1489
- }),
1490
- ]),
1491
- ]);
1492
- }
1493
- function $db14eb7a5c07abdb$var$KeyValue({ label: label , value: value }) {
1494
- return $db14eb7a5c07abdb$var$h("span.key-value", [
1495
- $db14eb7a5c07abdb$var$h("span.key", label),
1496
- $db14eb7a5c07abdb$var$h("code.value", value)
1497
- ]);
1498
- }
1499
- function $db14eb7a5c07abdb$var$LoadingAwareFeatureSet({ features: features , sourceID: sourceID }) {
1500
- const map = (0, $9B3TU$macrostratmapboxreact.useMapRef)();
1501
- if (map?.current == null) return null;
1502
- const [isLoaded1, setIsLoaded] = (0, $9B3TU$react.useState)(false);
1503
- const sourceFeatures = features.filter((d)=>d.source == "burwell");
1504
- (0, $9B3TU$react.useEffect)(()=>{
1505
- if (sourceFeatures.length > 0) {
1506
- setIsLoaded(true);
1507
- return;
1508
- }
1509
- const isLoaded = map.current.isSourceLoaded(sourceID);
1510
- setIsLoaded(isLoaded);
1511
- if (!isLoaded) map.current.once("sourcedata", (e)=>{
1512
- if (e.sourceId == sourceID) setIsLoaded(true);
1513
- });
1514
- }, [
1515
- map.current,
1516
- sourceID,
1517
- sourceFeatures.length
1518
- ]);
1519
- if (!isLoaded1) return $db14eb7a5c07abdb$var$h((0, $9B3TU$blueprintjscore.Spinner));
1520
- return $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$export$617d79dae526d2cf, {
1521
- features: sourceFeatures
1522
- });
1523
- }
1524
- function $db14eb7a5c07abdb$export$43c75dec9d0b96c({ feature: feature , showExtent: showExtent , setShowExtent: setShowExtent }) {
1525
- if (feature == null) return null;
1526
- const size = feature._vectorTileFeature._pbf.length;
1527
- return $db14eb7a5c07abdb$var$h("div.tile-info", [
1528
- $db14eb7a5c07abdb$var$h("h3", "Tile"),
1529
- $db14eb7a5c07abdb$var$h("div.tile-index", [
1530
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1531
- label: "x",
1532
- value: feature._x
1533
- }),
1534
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1535
- label: "y",
1536
- value: feature._y
1537
- }),
1538
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1539
- label: "z",
1540
- value: feature._z
1541
- }),
1542
- ]),
1543
- $db14eb7a5c07abdb$var$h("div.spacer"),
1544
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$KeyValue, {
1545
- label: "Size",
1546
- value: $db14eb7a5c07abdb$var$formatSize(size)
1547
- }),
1548
- $db14eb7a5c07abdb$var$h((0, $9B3TU$blueprintjscore.Switch), {
1549
- label: "Show extent",
1550
- alignIndicator: "right",
1551
- checked: showExtent,
1552
- onChange () {
1553
- setShowExtent(!showExtent);
1554
- }
1555
- }),
1556
- ]);
1557
- }
1558
- function $db14eb7a5c07abdb$var$formatSize(size) {
1559
- if (size > 1000000) return $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$UnitNumber, {
1560
- value: size / 1000000,
1561
- unit: "Mb"
1562
- });
1563
- if (size > 1000) return $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$UnitNumber, {
1564
- value: size / 1000,
1565
- unit: "Kb"
1566
- });
1567
- return `${size} bytes`;
1568
- }
1569
- function $db14eb7a5c07abdb$var$UnitNumber({ value: value , unit: unit , precision: precision = 1 }) {
1570
- return $db14eb7a5c07abdb$var$h("span.unit-number", [
1571
- $db14eb7a5c07abdb$var$h("span.number", value.toFixed(precision)),
1572
- $db14eb7a5c07abdb$var$h("span.unit", unit),
1573
- ]);
1574
- }
1575
- function $db14eb7a5c07abdb$export$43277c51a01761c1({ features: features , focusedSource: focusedSource = null , focusedSourceTitle: focusedSourceTitle = null , }) {
1576
- if (features == null) return null;
1577
- let focusedSourcePanel = null;
1578
- let filteredFeatures = features;
1579
- let title = "Features";
1580
- if (focusedSource != null) {
1581
- title = "Basemap features";
1582
- focusedSourcePanel = $db14eb7a5c07abdb$var$h((0, $750d69d73bfbdc9a$export$40e646e38e6ed100), {
1583
- title: "Macrostrat features",
1584
- className: "macrostrat-features",
1585
- expanded: true
1586
- }, [
1587
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$LoadingAwareFeatureSet, {
1588
- features: features,
1589
- sourceID: focusedSource
1590
- }),
1591
- ]);
1592
- filteredFeatures = features.filter((d)=>d.source != focusedSource);
1593
- }
1594
- return $db14eb7a5c07abdb$var$h("div.feature-panel", [
1595
- focusedSourcePanel,
1596
- $db14eb7a5c07abdb$var$h((0, $750d69d73bfbdc9a$export$40e646e38e6ed100), {
1597
- title: title,
1598
- className: "basemap-features",
1599
- expanded: focusedSource == null
1600
- }, [
1601
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$FeatureGroups, {
1602
- features: filteredFeatures
1603
- }),
1604
- ]),
1605
- ]);
1606
- }
1607
- function $db14eb7a5c07abdb$var$FeatureGroups({ features: features1 }) {
1608
- /** Group features by source and sourceLayer */ if (features1 == null) return null;
1609
- const groups = (0, $9B3TU$d3array.group)(features1, (d)=>`${d.source} - ${d.sourceLayer}`);
1610
- return $db14eb7a5c07abdb$var$h("div.feature-groups", Array.from(groups).map(([key, features])=>{
1611
- return $db14eb7a5c07abdb$var$h("div.feature-group", [
1612
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$var$FeatureHeader, {
1613
- feature: features[0]
1614
- }),
1615
- $db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$export$617d79dae526d2cf, {
1616
- features: features
1617
- }),
1618
- ]);
1619
- }));
1620
- }
1621
- function $db14eb7a5c07abdb$export$617d79dae526d2cf({ features: features }) {
1622
- return $db14eb7a5c07abdb$var$h("div.features", features.map((feature, i)=>$db14eb7a5c07abdb$var$h($db14eb7a5c07abdb$export$dc87b4d46cea200d, {
1623
- key: i,
1624
- feature: feature
1625
- })));
1626
- }
1627
-
1628
-
1629
- let $6f5ca387ac26c0b5$export$dce4b6e67bb5f25a;
1630
- (function(MacrostratVectorTileset1) {
1631
- MacrostratVectorTileset1["Carto"] = "carto";
1632
- MacrostratVectorTileset1["CartoSlim"] = "carto-slim";
1633
- MacrostratVectorTileset1["IGCPOrogens"] = "igcp-orogens";
1634
- })($6f5ca387ac26c0b5$export$dce4b6e67bb5f25a || ($6f5ca387ac26c0b5$export$dce4b6e67bb5f25a = {}));
1635
- let $6f5ca387ac26c0b5$export$cc7c195070dfb906;
1636
- (function(MacrostratRasterTileset1) {
1637
- MacrostratRasterTileset1["Carto"] = "carto";
1638
- MacrostratRasterTileset1["Emphasized"] = "emphasized";
1639
- })($6f5ca387ac26c0b5$export$cc7c195070dfb906 || ($6f5ca387ac26c0b5$export$cc7c195070dfb906 = {}));
1640
- const $6f5ca387ac26c0b5$export$dda1d9f60106f0e9 = (0, ($parcel$interopDefault($9B3TU$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($33088e8384af337c$exports))));
1641
- function $6f5ca387ac26c0b5$export$2391061fbdfb71ef({ title: title = "Map inspector" , headerElement: headerElement = null , transformRequest: transformRequest = null , mapPosition: mapPosition = null , mapboxToken: mapboxToken = null , overlayStyle: overlayStyle = null , children: children , style: style , focusedSource: focusedSource = null , focusedSourceTitle: focusedSourceTitle = null , projection: projection = null }) {
1642
- /* We apply a custom style to the panel container when we are interacting
1643
- with the search bar, so that we can block map interactions until search
1644
- bar focus is lost.
1645
- We also apply a custom style when the infodrawer is open so we can hide
1646
- the search bar on mobile platforms
1647
- */ const dark = (0, $9B3TU$macrostratuicomponents.useDarkMode)();
1648
- const isEnabled = dark?.isEnabled;
1649
- if (mapboxToken != null) (0, ($parcel$interopDefault($9B3TU$mapboxgl))).accessToken = mapboxToken;
1650
- style ??= isEnabled ? "mapbox://styles/mapbox/dark-v10" : "mapbox://styles/mapbox/light-v10";
1651
- const [isOpen, setOpen] = (0, $9B3TU$react.useState)(false);
1652
- const [state, setState] = (0, $9B3TU$macrostratuicomponents.useStoredState)("macrostrat:dev-map-page", {
1653
- showTileExtent: false,
1654
- xRay: false
1655
- });
1656
- const { showTileExtent: showTileExtent , xRay: xRay } = state;
1657
- const [actualStyle, setActualStyle] = (0, $9B3TU$react.useState)(style);
1658
- (0, $9B3TU$react.useEffect)(()=>{
1659
- (0, $8646508ae99a5857$export$e739dc8dfc0db9a6)(style, overlayStyle, {
1660
- mapboxToken: mapboxToken,
1661
- inDarkMode: isEnabled,
1662
- xRay: xRay
1663
- }).then(setActualStyle);
1664
- }, [
1665
- style,
1666
- xRay,
1667
- mapboxToken,
1668
- isEnabled,
1669
- overlayStyle
1670
- ]);
1671
- const [inspectPosition, setInspectPosition] = (0, $9B3TU$react.useState)(null);
1672
- const [data, setData] = (0, $9B3TU$react.useState)(null);
1673
- const onSelectPosition = (0, $9B3TU$react.useCallback)((position)=>{
1674
- setInspectPosition(position);
1675
- }, []);
1676
- let detailElement = null;
1677
- if (inspectPosition != null) detailElement = $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $2bc7c1e4e7da7fdf$export$aa4baff5242ea6e1), {
1678
- onClose () {
1679
- setInspectPosition(null);
1680
- },
1681
- position: inspectPosition
1682
- }, [
1683
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $db14eb7a5c07abdb$export$43c75dec9d0b96c), {
1684
- feature: data?.[0] ?? null,
1685
- showExtent: showTileExtent,
1686
- setShowExtent () {
1687
- setState({
1688
- ...state,
1689
- showTileExtent: !showTileExtent
1690
- });
1691
- }
1692
- }),
1693
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $db14eb7a5c07abdb$export$43277c51a01761c1), {
1694
- features: data,
1695
- focusedSource: focusedSource,
1696
- focusedSourceTitle: focusedSourceTitle
1697
- }),
1698
- ]);
1699
- let tile = null;
1700
- if (showTileExtent && data?.[0] != null) {
1701
- let f = data[0];
1702
- tile = {
1703
- x: f._x,
1704
- y: f._y,
1705
- z: f._z
1706
- };
1707
- }
1708
- console.log("Style", actualStyle);
1709
- return $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $c3311f59335df34d$export$9fa5da0bcfd0a290), {
1710
- navbar: $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $fce5fc950d1fe35b$export$a8cc0062d02a3841), [
1711
- headerElement ?? $6f5ca387ac26c0b5$export$dda1d9f60106f0e9("h2", title),
1712
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $9B3TU$macrostratuicomponents.Spacer)),
1713
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $fce5fc950d1fe35b$export$9e3bae3c08bde368), {
1714
- active: isOpen,
1715
- onClick: ()=>setOpen(!isOpen)
1716
- }),
1717
- ]),
1718
- contextPanel: $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $c3311f59335df34d$export$ec68dd77edbe678b), [
1719
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $9B3TU$blueprintjscore.Switch), {
1720
- checked: xRay,
1721
- label: "X-ray mode",
1722
- onChange () {
1723
- setState({
1724
- ...state,
1725
- xRay: !xRay
1726
- });
1727
- }
1728
- }),
1729
- children,
1730
- ]),
1731
- detailPanel: detailElement,
1732
- contextPanelOpen: isOpen
1733
- }, $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $12b6032029db16d4$export$ab1e7a67d6ec5ad8), {
1734
- style: actualStyle,
1735
- transformRequest: transformRequest,
1736
- mapPosition: mapPosition,
1737
- projection: "globe"
1738
- }, [
1739
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $db14eb7a5c07abdb$export$214daccdda0f4ac6), {
1740
- selectedLocation: inspectPosition,
1741
- setFeatures: setData
1742
- }),
1743
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $2611a7b4364593e5$export$5c90a91c7455938c), {
1744
- position: inspectPosition,
1745
- setPosition: onSelectPosition
1746
- }),
1747
- $6f5ca387ac26c0b5$export$dda1d9f60106f0e9((0, $abbe8d0af34cbbed$export$86c09739b12f23cd), {
1748
- tile: tile,
1749
- color: isEnabled ? "white" : "black"
1750
- }),
1751
- ]));
1752
- }
1753
-
1754
-
1755
-
1756
-
1757
-
1758
- $parcel$exportWildcard($9acbb47bf7cb7660$exports, $6f5ca387ac26c0b5$exports);
1759
- $parcel$exportWildcard($9acbb47bf7cb7660$exports, $abbe8d0af34cbbed$exports);
1760
- $parcel$exportWildcard($9acbb47bf7cb7660$exports, $db14eb7a5c07abdb$exports);
1761
- $parcel$exportWildcard($9acbb47bf7cb7660$exports, $8646508ae99a5857$exports);
1762
-
1763
-
1764
-
1765
-
1766
-
1767
-
1768
-
1769
-
1770
-
1771
- $parcel$exportWildcard(module.exports, $fce5fc950d1fe35b$exports);
1772
- $parcel$exportWildcard(module.exports, $2bc7c1e4e7da7fdf$exports);
1773
- $parcel$exportWildcard(module.exports, $9acbb47bf7cb7660$exports);
1774
- $parcel$exportWildcard(module.exports, $c3311f59335df34d$exports);
1775
- $parcel$exportWildcard(module.exports, $12b6032029db16d4$exports);
1776
- $parcel$exportWildcard(module.exports, $f333fe6f49373ca9$exports);
1777
- $parcel$exportWildcard(module.exports, $2611a7b4364593e5$exports);
1778
- $parcel$exportWildcard(module.exports, $3490fc4f4bda12f7$exports);
1779
- $parcel$exportWildcard(module.exports, $860d9939f7032c69$exports);
1780
- $parcel$exportWildcard(module.exports, $750d69d73bfbdc9a$exports);
1781
-
1782
-
1783
- //# sourceMappingURL=index.cjs.map