@macrostrat/map-interface 0.0.9 → 0.0.11
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.css → module.css} +375 -395
- package/dist/module.css.map +1 -0
- package/dist/{index.js → module.js} +236 -931
- package/dist/module.js.map +1 -0
- package/dist/types.d.ts +223 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +8 -7
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {useMemo as $Zz0sd$useMemo, createContext as $Zz0sd$createContext, useContext as $Zz0sd$useContext,
|
|
3
|
-
import {Spinner as $Zz0sd$Spinner, Button as $Zz0sd$Button, Navbar as $Zz0sd$Navbar, Card as $Zz0sd$Card, Icon as $Zz0sd$Icon,
|
|
1
|
+
import "./module.css";
|
|
2
|
+
import {useMemo as $Zz0sd$useMemo, createContext as $Zz0sd$createContext, useContext as $Zz0sd$useContext, useState as $Zz0sd$useState, useRef as $Zz0sd$useRef, Component as $Zz0sd$Component, useCallback as $Zz0sd$useCallback, useLayoutEffect as $Zz0sd$useLayoutEffect, useEffect as $Zz0sd$useEffect, forwardRef as $Zz0sd$forwardRef, isValidElement as $Zz0sd$isValidElement, cloneElement as $Zz0sd$cloneElement, useReducer as $Zz0sd$useReducer} from "react";
|
|
3
|
+
import {Spinner as $Zz0sd$Spinner, Button as $Zz0sd$Button, Navbar as $Zz0sd$Navbar, Card as $Zz0sd$Card, Icon as $Zz0sd$Icon, ButtonGroup as $Zz0sd$ButtonGroup, NonIdealState as $Zz0sd$NonIdealState, Intent as $Zz0sd$Intent, Alert as $Zz0sd$Alert, Collapse as $Zz0sd$Collapse, Tag as $Zz0sd$Tag, EditableText as $Zz0sd$EditableText, Toaster as $Zz0sd$Toaster, Classes as $Zz0sd$Classes, Slider as $Zz0sd$Slider, Callout as $Zz0sd$Callout, Overlay as $Zz0sd$Overlay, Position as $Zz0sd$Position, NavbarGroup as $Zz0sd$NavbarGroup, Alignment as $Zz0sd$Alignment, Switch as $Zz0sd$Switch} from "@blueprintjs/core";
|
|
4
4
|
import $Zz0sd$macrostrathyper, {hyperStyled as $Zz0sd$hyperStyled, classed as $Zz0sd$classed} from "@macrostrat/hyper";
|
|
5
|
-
import $Zz0sd$
|
|
6
|
-
import $Zz0sd$axios from "axios";
|
|
7
|
-
import $Zz0sd$mapboxgl, {FreeCameraOptions as $Zz0sd$FreeCameraOptions, MercatorCoordinate as $Zz0sd$MercatorCoordinate, ScaleControl as $Zz0sd$ScaleControl, GeolocateControl as $Zz0sd$GeolocateControl, Marker as $Zz0sd$Marker} from "mapbox-gl";
|
|
8
|
-
import $Zz0sd$mapboxglcontrolslibBaseBase from "mapbox-gl-controls/lib/Base/Base";
|
|
9
|
-
import $Zz0sd$mapboxglcontrolslibButtonButton from "mapbox-gl-controls/lib/Button/Button";
|
|
10
|
-
import {CompassControl as $Zz0sd$CompassControl, ZoomControl as $Zz0sd$ZoomControl} from "mapbox-gl-controls";
|
|
5
|
+
import {useMapStatus as $Zz0sd$useMapStatus, useFocusState as $Zz0sd$useFocusState, LocationFocusButton as $Zz0sd$LocationFocusButton, isCentered as $Zz0sd$isCentered, ZoomControl as $Zz0sd$ZoomControl, MapboxMapProvider as $Zz0sd$MapboxMapProvider, MapControlWrapper as $Zz0sd$MapControlWrapper, ThreeDControl as $Zz0sd$ThreeDControl, CompassControl as $Zz0sd$CompassControl, GlobeControl as $Zz0sd$GlobeControl, useMapRef as $Zz0sd$useMapRef, useMapEaseToCenter as $Zz0sd$useMapEaseToCenter, useMapDispatch as $Zz0sd$useMapDispatch, useMapConditionalStyle as $Zz0sd$useMapConditionalStyle} from "@macrostrat/mapbox-react";
|
|
11
6
|
import $Zz0sd$classnames from "classnames";
|
|
12
|
-
import $Zz0sd$turfbbox from "@turf/bbox";
|
|
13
7
|
import {memoize as $Zz0sd$memoize, debounce as $Zz0sd$debounce, isEqual as $Zz0sd$isEqual} from "underscore";
|
|
8
|
+
import $Zz0sd$axios from "axios";
|
|
14
9
|
import $Zz0sd$useasynceffect, {useAsyncEffect as $Zz0sd$useAsyncEffect} from "use-async-effect";
|
|
10
|
+
import $Zz0sd$immutabilityhelper from "immutability-helper";
|
|
15
11
|
import {stringify as $Zz0sd$stringify, parse as $Zz0sd$parse} from "query-string";
|
|
16
12
|
import $Zz0sd$reactjsontree from "react-json-tree";
|
|
17
13
|
import {pairs as $Zz0sd$pairs, group as $Zz0sd$group} from "d3-array";
|
|
@@ -23,6 +19,8 @@ import {DateInput as $Zz0sd$DateInput} from "@blueprintjs/datetime";
|
|
|
23
19
|
import "@blueprintjs/datetime/lib/css/blueprint-datetime.css";
|
|
24
20
|
import $Zz0sd$useelementdimensions from "use-element-dimensions";
|
|
25
21
|
import {format as $Zz0sd$format} from "d3-format";
|
|
22
|
+
import $Zz0sd$mapboxgl, {ScaleControl as $Zz0sd$ScaleControl, GeolocateControl as $Zz0sd$GeolocateControl, Marker as $Zz0sd$Marker} from "mapbox-gl";
|
|
23
|
+
import {getMapboxStyle as $Zz0sd$getMapboxStyle, mergeStyles as $Zz0sd$mergeStyles, mapViewInfo as $Zz0sd$mapViewInfo, getMapPosition as $Zz0sd$getMapPosition, setMapPosition as $Zz0sd$setMapPosition} from "@macrostrat/mapbox-utils";
|
|
26
24
|
import $Zz0sd$chromajs from "chroma-js";
|
|
27
25
|
import {useTransition as $Zz0sd$useTransition} from "transition-hook";
|
|
28
26
|
import $Zz0sd$useresizeobserver from "use-resize-observer";
|
|
@@ -75,696 +73,6 @@ $fbe402416678c280$export$764ade2d69041360 = `_8hZKsW_status-tongue`;
|
|
|
75
73
|
|
|
76
74
|
|
|
77
75
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const $dc75c8651942e3cf$var$MapContext = (0, $Zz0sd$createContext)({
|
|
81
|
-
mapRef: null,
|
|
82
|
-
status: {
|
|
83
|
-
isLoading: false,
|
|
84
|
-
isInitialized: false,
|
|
85
|
-
isStyleLoaded: false
|
|
86
|
-
},
|
|
87
|
-
position: null
|
|
88
|
-
});
|
|
89
|
-
const $dc75c8651942e3cf$var$MapDispatchContext = (0, $Zz0sd$createContext)(null);
|
|
90
|
-
function $dc75c8651942e3cf$export$79926a38b577730c() {
|
|
91
|
-
const { mapRef: mapRef } = (0, $Zz0sd$useContext)($dc75c8651942e3cf$var$MapContext);
|
|
92
|
-
return (0, $Zz0sd$useMemo)(()=>mapRef, [
|
|
93
|
-
mapRef
|
|
94
|
-
]);
|
|
95
|
-
}
|
|
96
|
-
function $dc75c8651942e3cf$export$6b15394f69cd8f33() {
|
|
97
|
-
const { status: status } = (0, $Zz0sd$useContext)($dc75c8651942e3cf$var$MapContext);
|
|
98
|
-
return (0, $Zz0sd$useMemo)(()=>status, [
|
|
99
|
-
status
|
|
100
|
-
]);
|
|
101
|
-
}
|
|
102
|
-
function $dc75c8651942e3cf$export$549a71cd2d2e3945() {
|
|
103
|
-
const { position: position } = (0, $Zz0sd$useContext)($dc75c8651942e3cf$var$MapContext);
|
|
104
|
-
return (0, $Zz0sd$useMemo)(()=>position, [
|
|
105
|
-
position
|
|
106
|
-
]);
|
|
107
|
-
}
|
|
108
|
-
function $dc75c8651942e3cf$export$54c1e9a8bb896c95() {
|
|
109
|
-
return $dc75c8651942e3cf$export$79926a38b577730c().current;
|
|
110
|
-
}
|
|
111
|
-
function $dc75c8651942e3cf$export$86f8f9f08863e403() {
|
|
112
|
-
return $dc75c8651942e3cf$export$79926a38b577730c().current;
|
|
113
|
-
}
|
|
114
|
-
function $dc75c8651942e3cf$export$5705f0dc4c1a0684() {
|
|
115
|
-
return (0, $Zz0sd$useContext)($dc75c8651942e3cf$var$MapDispatchContext);
|
|
116
|
-
}
|
|
117
|
-
function $dc75c8651942e3cf$var$mapReducer(state, action) {
|
|
118
|
-
switch(action.type){
|
|
119
|
-
case "set-map":
|
|
120
|
-
return (0, $Zz0sd$immutabilityhelper)(state, {
|
|
121
|
-
mapRef: {
|
|
122
|
-
current: {
|
|
123
|
-
$set: action.payload
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
status: {
|
|
127
|
-
isInitialized: {
|
|
128
|
-
$set: true
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
case "set-loading":
|
|
133
|
-
return (0, $Zz0sd$immutabilityhelper)(state, {
|
|
134
|
-
status: {
|
|
135
|
-
isLoading: {
|
|
136
|
-
$set: action.payload
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
case "set-initialized":
|
|
141
|
-
return (0, $Zz0sd$immutabilityhelper)(state, {
|
|
142
|
-
status: {
|
|
143
|
-
isInitialized: {
|
|
144
|
-
$set: action.payload
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
case "set-style-loaded":
|
|
149
|
-
return (0, $Zz0sd$immutabilityhelper)(state, {
|
|
150
|
-
status: {
|
|
151
|
-
isStyleLoaded: {
|
|
152
|
-
$set: action.payload
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
case "map-moved":
|
|
157
|
-
return {
|
|
158
|
-
...state,
|
|
159
|
-
position: action.payload
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function $dc75c8651942e3cf$export$5e21c9300e1e71dd({ children: children }) {
|
|
164
|
-
const mapRef = (0, $Zz0sd$useRef)();
|
|
165
|
-
const [value, dispatch] = (0, $Zz0sd$useReducer)($dc75c8651942e3cf$var$mapReducer, {
|
|
166
|
-
mapRef: mapRef,
|
|
167
|
-
status: {
|
|
168
|
-
isLoading: false,
|
|
169
|
-
isInitialized: false,
|
|
170
|
-
isStyleLoaded: false
|
|
171
|
-
},
|
|
172
|
-
position: null
|
|
173
|
-
});
|
|
174
|
-
return (0, $Zz0sd$macrostrathyper)($dc75c8651942e3cf$var$MapDispatchContext.Provider, {
|
|
175
|
-
value: dispatch
|
|
176
|
-
}, (0, $Zz0sd$macrostrathyper)($dc75c8651942e3cf$var$MapContext.Provider, {
|
|
177
|
-
value: value
|
|
178
|
-
}, children));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
function $16a1a67d6c9c7904$export$447c40024480b3c0(url) {
|
|
185
|
-
return url.replace("mapbox://styles/", "https://api.mapbox.com/styles/v1/");
|
|
186
|
-
}
|
|
187
|
-
async function $16a1a67d6c9c7904$export$2f09cfe1b8810033(style, params) {
|
|
188
|
-
if (typeof style !== "string") return style;
|
|
189
|
-
// We fetch styles if they aren't avaialable locally
|
|
190
|
-
let { data: data , status: status , statusText: statusText } = await (0, $Zz0sd$axios).get($16a1a67d6c9c7904$export$447c40024480b3c0(style), {
|
|
191
|
-
params: params
|
|
192
|
-
});
|
|
193
|
-
if (status !== 200) throw new Error(`Returned ${status}: ${statusText}`);
|
|
194
|
-
return data;
|
|
195
|
-
}
|
|
196
|
-
function $16a1a67d6c9c7904$export$e618dc39ac9ad607(...styles) {
|
|
197
|
-
let merged = {
|
|
198
|
-
...styles[0]
|
|
199
|
-
};
|
|
200
|
-
merged.sources = {};
|
|
201
|
-
merged.layers = [];
|
|
202
|
-
for (let s of styles){
|
|
203
|
-
merged.sources = {
|
|
204
|
-
...merged.sources,
|
|
205
|
-
...s.sources ?? {}
|
|
206
|
-
};
|
|
207
|
-
merged.layers = merged.layers.concat(s.layers);
|
|
208
|
-
merged.sprite = s.sprite ?? merged.sprite;
|
|
209
|
-
merged.glyphs = s.glyphs ?? merged.glyphs;
|
|
210
|
-
}
|
|
211
|
-
return merged;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
function $98c914c8d92d896f$export$7c8062fb47f5c43d(map) {
|
|
217
|
-
const pos = map.getFreeCameraOptions();
|
|
218
|
-
const cameraPos = pos.position.toLngLat();
|
|
219
|
-
let center = map.getCenter();
|
|
220
|
-
return {
|
|
221
|
-
camera: {
|
|
222
|
-
...cameraPos,
|
|
223
|
-
altitude: pos.position.toAltitude(),
|
|
224
|
-
bearing: map.getBearing(),
|
|
225
|
-
pitch: map.getPitch()
|
|
226
|
-
},
|
|
227
|
-
target: {
|
|
228
|
-
...center,
|
|
229
|
-
zoom: map.getZoom()
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function $98c914c8d92d896f$export$1362a5c98ca0069c(map, pos) {
|
|
234
|
-
const { pitch: pitch = 0 , bearing: bearing = 0 , altitude: altitude } = pos.camera;
|
|
235
|
-
const zoom = pos.target?.zoom;
|
|
236
|
-
if (zoom != null && altitude == null && pitch == 0 && bearing == 0) {
|
|
237
|
-
const { lng: lng , lat: lat } = pos.target;
|
|
238
|
-
map.setCenter([
|
|
239
|
-
lng,
|
|
240
|
-
lat
|
|
241
|
-
]);
|
|
242
|
-
map.setZoom(zoom);
|
|
243
|
-
} else {
|
|
244
|
-
const { altitude: altitude , lng: lng , lat: lat } = pos.camera;
|
|
245
|
-
const cameraOptions = new (0, $Zz0sd$FreeCameraOptions)((0, $Zz0sd$MercatorCoordinate).fromLngLat({
|
|
246
|
-
lng: lng,
|
|
247
|
-
lat: lat
|
|
248
|
-
}, altitude), [
|
|
249
|
-
0,
|
|
250
|
-
0,
|
|
251
|
-
0,
|
|
252
|
-
1
|
|
253
|
-
]);
|
|
254
|
-
cameraOptions.setPitchBearing(pitch, bearing);
|
|
255
|
-
map.setFreeCameraOptions(cameraOptions);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
function $b2a9fc2ffc60e62a$export$df38eeea86a10661(mapPosition) {
|
|
261
|
-
if (mapPosition == null) return {
|
|
262
|
-
mapIsRotated: false,
|
|
263
|
-
mapUse3D: false,
|
|
264
|
-
mapIsGlobal: false,
|
|
265
|
-
mapIsLoaded: false
|
|
266
|
-
};
|
|
267
|
-
// Switch to 3D mode at high zoom levels or with a rotated map
|
|
268
|
-
const pitch = mapPosition.camera.pitch ?? 0;
|
|
269
|
-
const bearing = mapPosition.camera.bearing ?? 0;
|
|
270
|
-
const alt = mapPosition.camera.altitude ?? 10000000;
|
|
271
|
-
const mapIsRotated = pitch != 0 || bearing != 0;
|
|
272
|
-
const mapIsGlobal = alt > 1600000;
|
|
273
|
-
let mapUse3D = false;
|
|
274
|
-
if (alt != null) mapUse3D = pitch > 0 && alt < 200000 || alt < 80000;
|
|
275
|
-
return {
|
|
276
|
-
mapIsRotated: mapIsRotated,
|
|
277
|
-
mapUse3D: mapUse3D,
|
|
278
|
-
mapIsGlobal: mapIsGlobal,
|
|
279
|
-
mapIsLoaded: true
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
function $bcda9afd15d68a9e$export$51bcefc0d73330c9(style, shouldRemove = true) {
|
|
285
|
-
// Disable labels on the map
|
|
286
|
-
for (let lyr of style.layers){
|
|
287
|
-
if (!("layout" in lyr)) continue;
|
|
288
|
-
const isLabelLayer = lyr.layout["text-field"] != null;
|
|
289
|
-
if (isLabelLayer) lyr.layout.visibility = shouldRemove ? "none" : "visible";
|
|
290
|
-
}
|
|
291
|
-
return style;
|
|
292
|
-
}
|
|
293
|
-
function $bcda9afd15d68a9e$export$548ed77deac280c0(map, visible, omitLayers = []) {
|
|
294
|
-
// Disable labels on the map
|
|
295
|
-
for (let lyr of map.getStyle().layers){
|
|
296
|
-
if (!("layout" in lyr)) continue;
|
|
297
|
-
const isLabelLayer = lyr.layout["text-field"] != null;
|
|
298
|
-
if (isLabelLayer && !omitLayers.includes(lyr.id)) map.setLayoutProperty(lyr.id, "visibility", visible ? "visible" : "none");
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
function $6546e155d824deab$export$16b2de187fda836f(mapRef, state, operator) {
|
|
306
|
-
/** Apply conditional style logic depending on a state value or object.
|
|
307
|
-
* The operator function can operate on the Map and the state, and is applied on state changes
|
|
308
|
-
* and on style load events. */ (0, $Zz0sd$useEffect)(()=>{
|
|
309
|
-
const map = mapRef.current;
|
|
310
|
-
if (map == null) return;
|
|
311
|
-
if (map.isStyleLoaded()) operator(map, state);
|
|
312
|
-
const fn = ()=>operator(map, state);
|
|
313
|
-
map.on("style.load", fn);
|
|
314
|
-
return ()=>{
|
|
315
|
-
map.off("style.load", fn);
|
|
316
|
-
};
|
|
317
|
-
}, [
|
|
318
|
-
mapRef.current,
|
|
319
|
-
state
|
|
320
|
-
]);
|
|
321
|
-
}
|
|
322
|
-
const $6546e155d824deab$var$_toggleMapLabels = (map, state)=>(0, $bcda9afd15d68a9e$export$548ed77deac280c0)(map, state.mapShowLabels, state.omitLayers);
|
|
323
|
-
function $6546e155d824deab$export$44d1ca598b5a6a5a(mapRef, mapShowLabels, omitLayers = []) {
|
|
324
|
-
$6546e155d824deab$export$16b2de187fda836f(mapRef, {
|
|
325
|
-
mapShowLabels: mapShowLabels,
|
|
326
|
-
omitLayers: omitLayers
|
|
327
|
-
}, $6546e155d824deab$var$_toggleMapLabels);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
function $e4df11ee33ce76ab$export$4bdc7a93a40ca832({ className: className , control: control , options: options = {} }) {
|
|
340
|
-
/** A wrapper for using Mapbox GL controls with a Mapbox GL map */ const mapRef = (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
341
|
-
const controlContainer = (0, $Zz0sd$useRef)();
|
|
342
|
-
const controlRef = (0, $Zz0sd$useRef)();
|
|
343
|
-
// Memoize the options object so that we don't continually recreate the control.
|
|
344
|
-
const _options = (0, $Zz0sd$useRef)(options);
|
|
345
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
346
|
-
_options.current = options;
|
|
347
|
-
}, Object.values(options));
|
|
348
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
349
|
-
if (mapRef.current == null) return;
|
|
350
|
-
const ctrl = new control(_options);
|
|
351
|
-
controlRef.current = ctrl;
|
|
352
|
-
const controlElement = ctrl.onAdd(mapRef.current);
|
|
353
|
-
controlContainer.current.appendChild(controlElement);
|
|
354
|
-
return ()=>{
|
|
355
|
-
controlRef.current?.onRemove();
|
|
356
|
-
};
|
|
357
|
-
}, [
|
|
358
|
-
mapRef.current,
|
|
359
|
-
controlContainer.current,
|
|
360
|
-
control,
|
|
361
|
-
_options
|
|
362
|
-
]);
|
|
363
|
-
return (0, $Zz0sd$macrostrathyper)("div.map-control-wrapper", {
|
|
364
|
-
className: className,
|
|
365
|
-
ref: controlContainer
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
function $e4df11ee33ce76ab$export$9618410ded3c9550({ className: className }) {
|
|
369
|
-
const map = (0, $dc75c8651942e3cf$export$54c1e9a8bb896c95)();
|
|
370
|
-
const [mapIsGlobe, setIsGlobe] = (0, $Zz0sd$useState)(false);
|
|
371
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
372
|
-
// @ts-ignore
|
|
373
|
-
let proj = map?.getProjection().name;
|
|
374
|
-
setIsGlobe(proj == "globe");
|
|
375
|
-
}, [
|
|
376
|
-
map
|
|
377
|
-
]);
|
|
378
|
-
const nextProj = mapIsGlobe ? "mercator" : "globe";
|
|
379
|
-
const icon = mapIsGlobe ? "map" : "globe";
|
|
380
|
-
return (0, $Zz0sd$macrostrathyper)("div.map-control.globe-control.mapboxgl-ctrl-group.mapboxgl-ctrl.mapbox-control", {
|
|
381
|
-
className: className
|
|
382
|
-
}, [
|
|
383
|
-
(0, $Zz0sd$macrostrathyper)("button.globe-control-button", {
|
|
384
|
-
onClick () {
|
|
385
|
-
if (map == null) return;
|
|
386
|
-
// @ts-ignore
|
|
387
|
-
map.setProjection(nextProj);
|
|
388
|
-
setIsGlobe(nextProj == "globe");
|
|
389
|
-
}
|
|
390
|
-
}, (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Icon), {
|
|
391
|
-
icon: icon
|
|
392
|
-
})),
|
|
393
|
-
]);
|
|
394
|
-
}
|
|
395
|
-
// Control for managing map 3D settings
|
|
396
|
-
class $e4df11ee33ce76ab$var$_ThreeDControl extends (0, $Zz0sd$mapboxglcontrolslibBaseBase) {
|
|
397
|
-
constructor(){
|
|
398
|
-
super();
|
|
399
|
-
this.button = new (0, $Zz0sd$mapboxglcontrolslibButtonButton)();
|
|
400
|
-
}
|
|
401
|
-
insert() {
|
|
402
|
-
this.addClassName("mapbox-3d");
|
|
403
|
-
this.button.setText("3D");
|
|
404
|
-
this.button.onClick(()=>{
|
|
405
|
-
this.map.easeTo({
|
|
406
|
-
pitch: 60,
|
|
407
|
-
duration: 1000
|
|
408
|
-
});
|
|
409
|
-
});
|
|
410
|
-
this.addButton(this.button);
|
|
411
|
-
}
|
|
412
|
-
onAddControl() {
|
|
413
|
-
this.insert();
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
function $e4df11ee33ce76ab$export$48c390f0a3a80b5c({ className: className , options: options }) {
|
|
417
|
-
return (0, $Zz0sd$macrostrathyper)($e4df11ee33ce76ab$export$4bdc7a93a40ca832, {
|
|
418
|
-
className: (0, $Zz0sd$classnames)("compass-control", className),
|
|
419
|
-
control: (0, $Zz0sd$CompassControl),
|
|
420
|
-
options: options
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
const $e4df11ee33ce76ab$export$dd36b6cb96de1ba3 = ({ className: className , options: options })=>(0, $Zz0sd$macrostrathyper)($e4df11ee33ce76ab$export$4bdc7a93a40ca832, {
|
|
424
|
-
className: (0, $Zz0sd$classnames)("zoom-control", className),
|
|
425
|
-
control: (0, $Zz0sd$ZoomControl),
|
|
426
|
-
options: options
|
|
427
|
-
});
|
|
428
|
-
const $e4df11ee33ce76ab$export$6074b9b7c7aefb14 = ({ className: className , options: options })=>(0, $Zz0sd$macrostrathyper)($e4df11ee33ce76ab$export$4bdc7a93a40ca832, {
|
|
429
|
-
className: (0, $Zz0sd$classnames)("map-3d-control", className),
|
|
430
|
-
control: $e4df11ee33ce76ab$var$_ThreeDControl,
|
|
431
|
-
options: options
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
function $a7719da14af16a6e$export$15ef564db477f342(shouldEnable = true, sourceName = "terrain", sourceCfg = {}) {
|
|
438
|
-
const mapRef = (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
439
|
-
const map = mapRef.current;
|
|
440
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
441
|
-
if (map == null) return;
|
|
442
|
-
$a7719da14af16a6e$export$3fe56b75a48fd245(map, shouldEnable, sourceName, sourceCfg);
|
|
443
|
-
map.on("style.load", ()=>{
|
|
444
|
-
$a7719da14af16a6e$export$3fe56b75a48fd245(map, shouldEnable, sourceName, sourceCfg);
|
|
445
|
-
});
|
|
446
|
-
}, [
|
|
447
|
-
map,
|
|
448
|
-
shouldEnable,
|
|
449
|
-
sourceName
|
|
450
|
-
]);
|
|
451
|
-
}
|
|
452
|
-
function $a7719da14af16a6e$export$3fe56b75a48fd245(map, shouldEnable = true, sourceName = "terrain", sourceCfg = {}) {
|
|
453
|
-
if (!map.isStyleLoaded()) return;
|
|
454
|
-
if (shouldEnable) $a7719da14af16a6e$var$addDefault3DStyles(map, sourceName, sourceCfg);
|
|
455
|
-
// Enable or disable terrain depending on our current desires...
|
|
456
|
-
const currentTerrain = map.getTerrain();
|
|
457
|
-
if (shouldEnable && currentTerrain == null) map.setTerrain({
|
|
458
|
-
source: sourceName,
|
|
459
|
-
exaggeration: 1
|
|
460
|
-
});
|
|
461
|
-
else if (!shouldEnable && currentTerrain != null) map.setTerrain(null);
|
|
462
|
-
}
|
|
463
|
-
function $a7719da14af16a6e$var$addDefault3DStyles(map, sourceName = "terrain", sourceCfg = {}) {
|
|
464
|
-
const style = map.getStyle();
|
|
465
|
-
const hasTerrain = Object.values(style.sources).some((source)=>source.type === "raster-dem");
|
|
466
|
-
const hasSky = Object.values(style.layers).some((lyr)=>lyr.type == "sky");
|
|
467
|
-
if (!hasTerrain) map.addSource(sourceName, {
|
|
468
|
-
type: "raster-dem",
|
|
469
|
-
url: "mapbox://mapbox.mapbox-terrain-dem-v1",
|
|
470
|
-
tileSize: 512,
|
|
471
|
-
maxzoom: 14,
|
|
472
|
-
...sourceCfg
|
|
473
|
-
});
|
|
474
|
-
if (!hasSky) map.addLayer({
|
|
475
|
-
id: "sky",
|
|
476
|
-
type: "sky",
|
|
477
|
-
paint: {
|
|
478
|
-
"sky-type": "atmosphere",
|
|
479
|
-
"sky-atmosphere-sun": [
|
|
480
|
-
0.0,
|
|
481
|
-
0.0
|
|
482
|
-
],
|
|
483
|
-
"sky-atmosphere-sun-intensity": 15
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
if (map.getFog() == null) map.setFog({
|
|
487
|
-
color: "#ffffff",
|
|
488
|
-
// @ts-ignore
|
|
489
|
-
"space-color": [
|
|
490
|
-
"interpolate",
|
|
491
|
-
[
|
|
492
|
-
"linear"
|
|
493
|
-
],
|
|
494
|
-
[
|
|
495
|
-
"zoom"
|
|
496
|
-
],
|
|
497
|
-
4,
|
|
498
|
-
"hsl(215, 28%, 64%)",
|
|
499
|
-
7,
|
|
500
|
-
"hsl(209, 92%, 85%)",
|
|
501
|
-
],
|
|
502
|
-
"star-intensity": [
|
|
503
|
-
"interpolate",
|
|
504
|
-
[
|
|
505
|
-
"linear"
|
|
506
|
-
],
|
|
507
|
-
[
|
|
508
|
-
"zoom"
|
|
509
|
-
],
|
|
510
|
-
5,
|
|
511
|
-
0.35,
|
|
512
|
-
6,
|
|
513
|
-
0
|
|
514
|
-
],
|
|
515
|
-
range: [
|
|
516
|
-
5,
|
|
517
|
-
15
|
|
518
|
-
]
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
function $f02df3b20102b6a0$export$e86da36f9a8e87e6({ mapRef: mapRef , ...rest }) {
|
|
526
|
-
const { showTileBoundaries: showTileBoundaries = false , showTerrainWireframe: showTerrainWireframe = false , showCollisionBoxes: showCollisionBoxes = false , } = rest;
|
|
527
|
-
const ref = mapRef ?? (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
528
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
529
|
-
const map = ref.current;
|
|
530
|
-
if (map == null) return;
|
|
531
|
-
map.showTileBoundaries = showTileBoundaries;
|
|
532
|
-
map.showTerrainWireframe = showTerrainWireframe;
|
|
533
|
-
map.showCollisionBoxes = showCollisionBoxes;
|
|
534
|
-
map.triggerRepaint();
|
|
535
|
-
}, [
|
|
536
|
-
ref.current,
|
|
537
|
-
showTileBoundaries,
|
|
538
|
-
showTerrainWireframe,
|
|
539
|
-
showCollisionBoxes,
|
|
540
|
-
]);
|
|
541
|
-
return null;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
var $7bb837c4f3322cbf$exports = {};
|
|
551
|
-
|
|
552
|
-
$parcel$export($7bb837c4f3322cbf$exports, "out-of-padding", () => $7bb837c4f3322cbf$export$399131e3fb0c6003, (v) => $7bb837c4f3322cbf$export$399131e3fb0c6003 = v);
|
|
553
|
-
$parcel$export($7bb837c4f3322cbf$exports, "off-center", () => $7bb837c4f3322cbf$export$e6ac8d2c206db13b, (v) => $7bb837c4f3322cbf$export$e6ac8d2c206db13b = v);
|
|
554
|
-
$parcel$export($7bb837c4f3322cbf$exports, "recenter-button", () => $7bb837c4f3322cbf$export$5480dcd3f23bfd2f, (v) => $7bb837c4f3322cbf$export$5480dcd3f23bfd2f = v);
|
|
555
|
-
$parcel$export($7bb837c4f3322cbf$exports, "recenter-label", () => $7bb837c4f3322cbf$export$81903ae29a3b2493, (v) => $7bb837c4f3322cbf$export$81903ae29a3b2493 = v);
|
|
556
|
-
var $7bb837c4f3322cbf$export$399131e3fb0c6003;
|
|
557
|
-
var $7bb837c4f3322cbf$export$e6ac8d2c206db13b;
|
|
558
|
-
var $7bb837c4f3322cbf$export$5480dcd3f23bfd2f;
|
|
559
|
-
var $7bb837c4f3322cbf$export$81903ae29a3b2493;
|
|
560
|
-
$7bb837c4f3322cbf$export$399131e3fb0c6003 = `y-HzBG_out-of-padding`;
|
|
561
|
-
$7bb837c4f3322cbf$export$e6ac8d2c206db13b = `y-HzBG_off-center`;
|
|
562
|
-
$7bb837c4f3322cbf$export$5480dcd3f23bfd2f = `y-HzBG_recenter-button`;
|
|
563
|
-
$7bb837c4f3322cbf$export$81903ae29a3b2493 = `y-HzBG_recenter-label`;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
const $ce8e9806d0af9d7a$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($7bb837c4f3322cbf$exports))));
|
|
568
|
-
let $ce8e9806d0af9d7a$export$381b754041286ee7;
|
|
569
|
-
(function(PositionFocusState1) {
|
|
570
|
-
PositionFocusState1[PositionFocusState1["CENTERED"] = 0] = "CENTERED";
|
|
571
|
-
PositionFocusState1[PositionFocusState1["NEAR_CENTER"] = 1] = "NEAR_CENTER";
|
|
572
|
-
PositionFocusState1[PositionFocusState1["OFF_CENTER"] = 2] = "OFF_CENTER";
|
|
573
|
-
PositionFocusState1[PositionFocusState1["OUT_OF_PADDING"] = 3] = "OUT_OF_PADDING";
|
|
574
|
-
PositionFocusState1[PositionFocusState1["OUT_OF_VIEW"] = 4] = "OUT_OF_VIEW";
|
|
575
|
-
})($ce8e9806d0af9d7a$export$381b754041286ee7 || ($ce8e9806d0af9d7a$export$381b754041286ee7 = {}));
|
|
576
|
-
function $ce8e9806d0af9d7a$export$8b404ce881070dbb(pos) {
|
|
577
|
-
switch(pos){
|
|
578
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.CENTERED:
|
|
579
|
-
return "centered";
|
|
580
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.NEAR_CENTER:
|
|
581
|
-
return "near-center";
|
|
582
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OFF_CENTER:
|
|
583
|
-
return "off-center";
|
|
584
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_PADDING:
|
|
585
|
-
return "out-of-padding";
|
|
586
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_VIEW:
|
|
587
|
-
return "out-of-view";
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
function $ce8e9806d0af9d7a$export$74dc4d71c4c9a90e(pos) {
|
|
591
|
-
switch(pos){
|
|
592
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.CENTERED:
|
|
593
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.NEAR_CENTER:
|
|
594
|
-
return (0, $Zz0sd$Intent).NONE;
|
|
595
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OFF_CENTER:
|
|
596
|
-
return (0, $Zz0sd$Intent).PRIMARY;
|
|
597
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_PADDING:
|
|
598
|
-
return (0, $Zz0sd$Intent).SUCCESS;
|
|
599
|
-
case $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_VIEW:
|
|
600
|
-
return (0, $Zz0sd$Intent).WARNING;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
function $ce8e9806d0af9d7a$export$7bd3facfe20e158a(position, padding) {
|
|
604
|
-
const mapRef = (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
605
|
-
const prevPosition = (0, $Zz0sd$useRef)(null);
|
|
606
|
-
const prevPadding = (0, $Zz0sd$useRef)(null);
|
|
607
|
-
// Handle map position easing (for both map padding and markers)
|
|
608
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
609
|
-
const map = mapRef.current;
|
|
610
|
-
if (map == null) return;
|
|
611
|
-
let opts = null;
|
|
612
|
-
if (position != prevPosition.current) {
|
|
613
|
-
opts ??= {};
|
|
614
|
-
opts.center = position;
|
|
615
|
-
}
|
|
616
|
-
if (padding != prevPadding.current) {
|
|
617
|
-
opts ??= {};
|
|
618
|
-
opts.padding = padding;
|
|
619
|
-
}
|
|
620
|
-
if (opts == null) return;
|
|
621
|
-
opts.duration = 800;
|
|
622
|
-
map.flyTo(opts);
|
|
623
|
-
map.once("moveend", ()=>{
|
|
624
|
-
/* Waiting until moveend to update the refs allows us to
|
|
625
|
-
batch overlapping movements together, which increases UI
|
|
626
|
-
smoothness when, e.g., flying to new panels */ prevPosition.current = position;
|
|
627
|
-
prevPadding.current = padding;
|
|
628
|
-
});
|
|
629
|
-
}, [
|
|
630
|
-
position,
|
|
631
|
-
padding
|
|
632
|
-
]);
|
|
633
|
-
}
|
|
634
|
-
function $ce8e9806d0af9d7a$var$greatCircleDistance(l1, l2) {
|
|
635
|
-
// get distance in radians between l1 and l2
|
|
636
|
-
const dLon = (l2[0] - l1[0]) * Math.PI / 180;
|
|
637
|
-
// Spherical law of cosines (accurate at large distances)
|
|
638
|
-
const lat1 = l1[1] * Math.PI / 180;
|
|
639
|
-
const lat2 = l2[1] * Math.PI / 180;
|
|
640
|
-
return Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos(dLon));
|
|
641
|
-
}
|
|
642
|
-
function $ce8e9806d0af9d7a$export$30e71709a35235ad(map, location) {
|
|
643
|
-
/** Determine whether the infomarker is positioned in the viewport */ if (location == null) return null;
|
|
644
|
-
const mapCenter = map.getCenter();
|
|
645
|
-
if (location.hasOwnProperty("lng") && location.hasOwnProperty("lat")) location = [
|
|
646
|
-
location.lng,
|
|
647
|
-
location.lat
|
|
648
|
-
];
|
|
649
|
-
if (!(location instanceof Array)) {
|
|
650
|
-
// Get geometry bounding box
|
|
651
|
-
const bounds = (0, $Zz0sd$turfbbox)(location);
|
|
652
|
-
location = [
|
|
653
|
-
(bounds[0] + bounds[2]) / 2,
|
|
654
|
-
(bounds[1] + bounds[3]) / 2
|
|
655
|
-
];
|
|
656
|
-
// For non-points this is extremely simplistic at the moment
|
|
657
|
-
}
|
|
658
|
-
const dist = $ce8e9806d0af9d7a$var$greatCircleDistance(location, mapCenter);
|
|
659
|
-
if (dist > Math.PI / 4) return $ce8e9806d0af9d7a$export$381b754041286ee7.OFF_CENTER;
|
|
660
|
-
else if (dist > Math.PI / 2) return $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_VIEW;
|
|
661
|
-
const markerPos = map.project(location);
|
|
662
|
-
const mapPos = map.project(mapCenter);
|
|
663
|
-
const dx = Math.abs(markerPos.x - mapPos.x);
|
|
664
|
-
const dy = Math.abs(markerPos.y - mapPos.y);
|
|
665
|
-
const padding = map.getPadding();
|
|
666
|
-
let { width: width , height: height } = map.getCanvas();
|
|
667
|
-
width /= 2;
|
|
668
|
-
height /= 2;
|
|
669
|
-
if (dx < 10 && dy < 10) return $ce8e9806d0af9d7a$export$381b754041286ee7.CENTERED;
|
|
670
|
-
if (dx < 150 && dy < 150) return $ce8e9806d0af9d7a$export$381b754041286ee7.NEAR_CENTER;
|
|
671
|
-
if (markerPos.x > padding.left && markerPos.x < width - padding.right && markerPos.y > padding.top && markerPos.y < height - padding.bottom) return $ce8e9806d0af9d7a$export$381b754041286ee7.OFF_CENTER;
|
|
672
|
-
if (markerPos.x > 0 && markerPos.x < width && markerPos.y > 0 && markerPos.y < height) return $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_PADDING;
|
|
673
|
-
return $ce8e9806d0af9d7a$export$381b754041286ee7.OUT_OF_VIEW;
|
|
674
|
-
}
|
|
675
|
-
function $ce8e9806d0af9d7a$export$ae79915617215704(position) {
|
|
676
|
-
const map = (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
677
|
-
const [focusState, setFocusState] = (0, $Zz0sd$useState)(null);
|
|
678
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
679
|
-
if (map.current == null || position == null) return;
|
|
680
|
-
const cb = ()=>{
|
|
681
|
-
setFocusState($ce8e9806d0af9d7a$export$30e71709a35235ad(map.current, position));
|
|
682
|
-
};
|
|
683
|
-
map.current?.on("move", cb);
|
|
684
|
-
cb();
|
|
685
|
-
return ()=>{
|
|
686
|
-
map.current?.off("move", cb);
|
|
687
|
-
};
|
|
688
|
-
}, [
|
|
689
|
-
map.current,
|
|
690
|
-
position
|
|
691
|
-
]);
|
|
692
|
-
return focusState;
|
|
693
|
-
}
|
|
694
|
-
function $ce8e9806d0af9d7a$export$ef19914521000df2(focusState) {
|
|
695
|
-
return focusState == $ce8e9806d0af9d7a$export$381b754041286ee7.CENTERED || focusState == $ce8e9806d0af9d7a$export$381b754041286ee7.NEAR_CENTER;
|
|
696
|
-
}
|
|
697
|
-
function $ce8e9806d0af9d7a$var$getCenterAndBestZoom(input) {
|
|
698
|
-
let box;
|
|
699
|
-
let center = null;
|
|
700
|
-
let zoom = null;
|
|
701
|
-
if (input instanceof Array) {
|
|
702
|
-
if (input.length === 2) point = input;
|
|
703
|
-
else if (input.length === 4) box = input;
|
|
704
|
-
}
|
|
705
|
-
if (input.hasOwnProperty("lat") && input.hasOwnProperty("lng")) center = [
|
|
706
|
-
input.lng,
|
|
707
|
-
input.lat
|
|
708
|
-
];
|
|
709
|
-
// If input is a geometry, get its bounding box
|
|
710
|
-
if (input.hasOwnProperty("type")) {
|
|
711
|
-
if (input.type === "Point") center = input.coordinates;
|
|
712
|
-
else box = (0, $Zz0sd$turfbbox)(input);
|
|
713
|
-
}
|
|
714
|
-
if (box != null) {
|
|
715
|
-
center = [
|
|
716
|
-
(box[0] + box[2]) / 2,
|
|
717
|
-
(box[1] + box[3]) / 2
|
|
718
|
-
];
|
|
719
|
-
const dist = $ce8e9806d0af9d7a$var$greatCircleDistance(center, [
|
|
720
|
-
box[0],
|
|
721
|
-
box[1]
|
|
722
|
-
]);
|
|
723
|
-
zoom = Math.log2(Math.PI * 2 / dist) - 1;
|
|
724
|
-
}
|
|
725
|
-
return {
|
|
726
|
-
center: center,
|
|
727
|
-
zoom: zoom
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
function $ce8e9806d0af9d7a$export$914b296afaaf39f6({ location: location , className: className , easeDuration: easeDuration = 800 , focusState: focusState = null , ...rest }) {
|
|
731
|
-
const map = (0, $dc75c8651942e3cf$export$79926a38b577730c)();
|
|
732
|
-
const defaultFocusState = $ce8e9806d0af9d7a$export$ae79915617215704(location);
|
|
733
|
-
focusState ??= defaultFocusState;
|
|
734
|
-
const _isCentered = $ce8e9806d0af9d7a$export$ef19914521000df2(focusState);
|
|
735
|
-
return $ce8e9806d0af9d7a$var$h((0, $Zz0sd$Button), {
|
|
736
|
-
minimal: true,
|
|
737
|
-
icon: "map-marker",
|
|
738
|
-
onClick () {
|
|
739
|
-
if (focusState == $ce8e9806d0af9d7a$export$381b754041286ee7.CENTERED) map.current?.resetNorth();
|
|
740
|
-
else {
|
|
741
|
-
let opts = {
|
|
742
|
-
duration: easeDuration
|
|
743
|
-
};
|
|
744
|
-
const { center: center , zoom: zoom } = $ce8e9806d0af9d7a$var$getCenterAndBestZoom(location);
|
|
745
|
-
if (center == null) return;
|
|
746
|
-
else opts = {
|
|
747
|
-
...opts,
|
|
748
|
-
center: center
|
|
749
|
-
};
|
|
750
|
-
if (zoom != null) opts = {
|
|
751
|
-
...opts,
|
|
752
|
-
zoom: zoom
|
|
753
|
-
};
|
|
754
|
-
map.current?.flyTo(opts);
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
className: (0, $Zz0sd$classnames)("recenter-button", className, $ce8e9806d0af9d7a$export$8b404ce881070dbb(focusState)),
|
|
758
|
-
intent: $ce8e9806d0af9d7a$export$74dc4d71c4c9a90e(focusState),
|
|
759
|
-
...rest
|
|
760
|
-
}, [
|
|
761
|
-
_isCentered ? null : $ce8e9806d0af9d7a$var$h("span.recenter-label", "Recenter")
|
|
762
|
-
]);
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
76
|
const $6e914c81c8e053da$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($fbe402416678c280$exports))));
|
|
769
77
|
const $6e914c81c8e053da$var$spinnerElement = $6e914c81c8e053da$var$h((0, $Zz0sd$Spinner), {
|
|
770
78
|
size: 16
|
|
@@ -779,7 +87,7 @@ function $6e914c81c8e053da$export$4ec83e90d030b2f3({ isLoading: isLoading = fals
|
|
|
779
87
|
});
|
|
780
88
|
}
|
|
781
89
|
function $6e914c81c8e053da$export$9e3bae3c08bde368(props) {
|
|
782
|
-
const { isLoading: isLoading } = (0, $
|
|
90
|
+
const { isLoading: isLoading } = (0, $Zz0sd$useMapStatus)();
|
|
783
91
|
const mapIsLoading = (0, $Zz0sd$useMemo)(()=>isLoading, [
|
|
784
92
|
isLoading
|
|
785
93
|
]);
|
|
@@ -814,33 +122,33 @@ $parcel$export($f50c3537aaff0cff$exports, "LocationPanel", () => $f50c3537aaff0c
|
|
|
814
122
|
|
|
815
123
|
var $29ab0212ea6844d0$exports = {};
|
|
816
124
|
|
|
817
|
-
$parcel$export($29ab0212ea6844d0$exports, "location-panel-header", () => $29ab0212ea6844d0$export$d821beb98a87c6d7, (v) => $29ab0212ea6844d0$export$d821beb98a87c6d7 = v);
|
|
818
125
|
$parcel$export($29ab0212ea6844d0$exports, "spacer", () => $29ab0212ea6844d0$export$8cc075c801fd6817, (v) => $29ab0212ea6844d0$export$8cc075c801fd6817 = v);
|
|
819
|
-
$parcel$export($29ab0212ea6844d0$exports, "loading", () => $29ab0212ea6844d0$export$46c1c92549715335, (v) => $29ab0212ea6844d0$export$46c1c92549715335 = v);
|
|
820
126
|
$parcel$export($29ab0212ea6844d0$exports, "position-controls", () => $29ab0212ea6844d0$export$dfae07a3bf0fbd6, (v) => $29ab0212ea6844d0$export$dfae07a3bf0fbd6 = v);
|
|
821
|
-
$parcel$export($29ab0212ea6844d0$exports, "
|
|
822
|
-
$parcel$export($29ab0212ea6844d0$exports, "left-icon", () => $29ab0212ea6844d0$export$f750577db09821ce, (v) => $29ab0212ea6844d0$export$f750577db09821ce = v);
|
|
823
|
-
$parcel$export($29ab0212ea6844d0$exports, "infodrawer", () => $29ab0212ea6844d0$export$b5017f7ff265217d, (v) => $29ab0212ea6844d0$export$b5017f7ff265217d = v);
|
|
127
|
+
$parcel$export($29ab0212ea6844d0$exports, "location-panel-header", () => $29ab0212ea6844d0$export$d821beb98a87c6d7, (v) => $29ab0212ea6844d0$export$d821beb98a87c6d7 = v);
|
|
824
128
|
$parcel$export($29ab0212ea6844d0$exports, "copy-link-button", () => $29ab0212ea6844d0$export$d1352d0c31a65024, (v) => $29ab0212ea6844d0$export$d1352d0c31a65024 = v);
|
|
825
129
|
$parcel$export($29ab0212ea6844d0$exports, "infodrawer-body", () => $29ab0212ea6844d0$export$310e8f86a84c074f, (v) => $29ab0212ea6844d0$export$310e8f86a84c074f = v);
|
|
826
|
-
|
|
130
|
+
$parcel$export($29ab0212ea6844d0$exports, "infodrawer", () => $29ab0212ea6844d0$export$b5017f7ff265217d, (v) => $29ab0212ea6844d0$export$b5017f7ff265217d = v);
|
|
131
|
+
$parcel$export($29ab0212ea6844d0$exports, "loading", () => $29ab0212ea6844d0$export$46c1c92549715335, (v) => $29ab0212ea6844d0$export$46c1c92549715335 = v);
|
|
132
|
+
$parcel$export($29ab0212ea6844d0$exports, "left-icon", () => $29ab0212ea6844d0$export$f750577db09821ce, (v) => $29ab0212ea6844d0$export$f750577db09821ce = v);
|
|
133
|
+
$parcel$export($29ab0212ea6844d0$exports, "infodrawer-header-item", () => $29ab0212ea6844d0$export$333d72514239bce8, (v) => $29ab0212ea6844d0$export$333d72514239bce8 = v);
|
|
827
134
|
var $29ab0212ea6844d0$export$8cc075c801fd6817;
|
|
828
|
-
var $29ab0212ea6844d0$export$46c1c92549715335;
|
|
829
135
|
var $29ab0212ea6844d0$export$dfae07a3bf0fbd6;
|
|
830
|
-
var $29ab0212ea6844d0$export$
|
|
831
|
-
var $29ab0212ea6844d0$export$f750577db09821ce;
|
|
832
|
-
var $29ab0212ea6844d0$export$b5017f7ff265217d;
|
|
136
|
+
var $29ab0212ea6844d0$export$d821beb98a87c6d7;
|
|
833
137
|
var $29ab0212ea6844d0$export$d1352d0c31a65024;
|
|
834
138
|
var $29ab0212ea6844d0$export$310e8f86a84c074f;
|
|
835
|
-
$29ab0212ea6844d0$export$
|
|
139
|
+
var $29ab0212ea6844d0$export$b5017f7ff265217d;
|
|
140
|
+
var $29ab0212ea6844d0$export$46c1c92549715335;
|
|
141
|
+
var $29ab0212ea6844d0$export$f750577db09821ce;
|
|
142
|
+
var $29ab0212ea6844d0$export$333d72514239bce8;
|
|
836
143
|
$29ab0212ea6844d0$export$8cc075c801fd6817 = `VPa3-W_spacer`;
|
|
837
|
-
$29ab0212ea6844d0$export$46c1c92549715335 = `VPa3-W_loading`;
|
|
838
144
|
$29ab0212ea6844d0$export$dfae07a3bf0fbd6 = `VPa3-W_position-controls`;
|
|
839
|
-
$29ab0212ea6844d0$export$
|
|
840
|
-
$29ab0212ea6844d0$export$f750577db09821ce = `VPa3-W_left-icon`;
|
|
841
|
-
$29ab0212ea6844d0$export$b5017f7ff265217d = `VPa3-W_infodrawer`;
|
|
145
|
+
$29ab0212ea6844d0$export$d821beb98a87c6d7 = `VPa3-W_location-panel-header`;
|
|
842
146
|
$29ab0212ea6844d0$export$d1352d0c31a65024 = `VPa3-W_copy-link-button`;
|
|
843
147
|
$29ab0212ea6844d0$export$310e8f86a84c074f = `VPa3-W_infodrawer-body`;
|
|
148
|
+
$29ab0212ea6844d0$export$b5017f7ff265217d = `VPa3-W_infodrawer`;
|
|
149
|
+
$29ab0212ea6844d0$export$46c1c92549715335 = `VPa3-W_loading`;
|
|
150
|
+
$29ab0212ea6844d0$export$f750577db09821ce = `VPa3-W_left-icon`;
|
|
151
|
+
$29ab0212ea6844d0$export$333d72514239bce8 = `VPa3-W_infodrawer-header-item`;
|
|
844
152
|
|
|
845
153
|
|
|
846
154
|
|
|
@@ -1014,162 +322,49 @@ function $962bc0f04255cfc3$export$8b052fe25089340e(key1, initialState, isValid =
|
|
|
1014
322
|
initialState,
|
|
1015
323
|
isValid
|
|
1016
324
|
]);
|
|
1017
|
-
if (!validator(initialValue)) initialValue = null;
|
|
1018
|
-
const [state1, _setState] = (0, $Zz0sd$useState)(initialValue ?? initialState);
|
|
1019
|
-
const setState = (0, $Zz0sd$useCallback)((nextState, validate = true)=>{
|
|
1020
|
-
if (validate && !validator(nextState)) throw `State ${nextState} is not valid.`;
|
|
1021
|
-
_setState(nextState);
|
|
1022
|
-
storage.set(nextState);
|
|
1023
|
-
}, [
|
|
1024
|
-
validator
|
|
1025
|
-
]);
|
|
1026
|
-
const resetState = (0, $Zz0sd$useCallback)(()=>{
|
|
1027
|
-
_setState(initialState);
|
|
1028
|
-
storage.remove();
|
|
1029
|
-
}, [
|
|
1030
|
-
initialState
|
|
1031
|
-
]);
|
|
1032
|
-
return [
|
|
1033
|
-
state1,
|
|
1034
|
-
setState,
|
|
1035
|
-
resetState
|
|
1036
|
-
];
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
const $70366c8972398d2a$var$systemDarkMode = ()=>({
|
|
1047
|
-
isEnabled: $70366c8972398d2a$var$matcher?.matches ?? false,
|
|
1048
|
-
isAutoset: true
|
|
1049
|
-
});
|
|
1050
|
-
const $70366c8972398d2a$var$ValueContext = (0, $Zz0sd$createContext)({
|
|
1051
|
-
isEnabled: false,
|
|
1052
|
-
isAutoset: false
|
|
1053
|
-
});
|
|
1054
|
-
const $70366c8972398d2a$var$UpdaterContext = (0, $Zz0sd$createContext)(null);
|
|
1055
|
-
const $70366c8972398d2a$var$matcher = window?.matchMedia("(prefers-color-scheme: dark)");
|
|
1056
|
-
const $70366c8972398d2a$var$_DarkModeProvider = (props)=>{
|
|
1057
|
-
const { addBodyClasses: addBodyClasses = true , isEnabled: isEnabled1 , followSystem: followSystem = false , children: children , } = props;
|
|
1058
|
-
const [storedValue, updateValue, resetState] = (0, $962bc0f04255cfc3$export$8b052fe25089340e)("ui-dark-mode", $70366c8972398d2a$var$systemDarkMode());
|
|
1059
|
-
// Guards so that we don't error on an invalid stored value
|
|
1060
|
-
const value = {
|
|
1061
|
-
isEnabled: storedValue?.isEnabled ?? false,
|
|
1062
|
-
isAutoset: storedValue?.isAutoset ?? false
|
|
1063
|
-
};
|
|
1064
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
1065
|
-
if (!followSystem) return;
|
|
1066
|
-
updateValue($70366c8972398d2a$var$systemDarkMode());
|
|
1067
|
-
}, []);
|
|
1068
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
1069
|
-
// Update value if isEnabled is provided
|
|
1070
|
-
if (isEnabled1 == null) return;
|
|
1071
|
-
updateValue({
|
|
1072
|
-
isAutoset: false,
|
|
1073
|
-
isEnabled: isEnabled1
|
|
1074
|
-
});
|
|
1075
|
-
}, [
|
|
1076
|
-
isEnabled1
|
|
1077
|
-
]);
|
|
1078
|
-
// Manage dark mode body classes
|
|
1079
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
1080
|
-
if (!addBodyClasses) return;
|
|
1081
|
-
if (value.isEnabled) document.body.classList.add("bp4-dark");
|
|
1082
|
-
else document.body.classList.remove("bp4-dark");
|
|
1083
|
-
}, [
|
|
1084
|
-
storedValue
|
|
1085
|
-
]);
|
|
1086
|
-
const update = (enabled)=>{
|
|
1087
|
-
if (enabled == null) return resetState();
|
|
1088
|
-
const isEnabled = enabled ?? !value.isEnabled;
|
|
1089
|
-
updateValue({
|
|
1090
|
-
isAutoset: false,
|
|
1091
|
-
isEnabled: isEnabled
|
|
1092
|
-
});
|
|
1093
|
-
};
|
|
1094
|
-
const onSystemChange = (0, $Zz0sd$useCallback)((e)=>{
|
|
1095
|
-
if (value.isAutoset || followSystem) updateValue($70366c8972398d2a$var$systemDarkMode());
|
|
1096
|
-
}, [
|
|
1097
|
-
value.isAutoset,
|
|
1098
|
-
followSystem
|
|
1099
|
-
]);
|
|
1100
|
-
(0, $Zz0sd$useEffect)(()=>{
|
|
1101
|
-
if ($70366c8972398d2a$var$matcher == null) return;
|
|
1102
|
-
$70366c8972398d2a$var$matcher.addEventListener("change", onSystemChange);
|
|
1103
|
-
return ()=>{
|
|
1104
|
-
$70366c8972398d2a$var$matcher.removeEventListener("change", onSystemChange);
|
|
1105
|
-
};
|
|
325
|
+
if (!validator(initialValue)) initialValue = null;
|
|
326
|
+
const [state1, _setState] = (0, $Zz0sd$useState)(initialValue ?? initialState);
|
|
327
|
+
const setState = (0, $Zz0sd$useCallback)((nextState, validate = true)=>{
|
|
328
|
+
if (validate && !validator(nextState)) throw `State ${nextState} is not valid.`;
|
|
329
|
+
_setState(nextState);
|
|
330
|
+
storage.set(nextState);
|
|
1106
331
|
}, [
|
|
1107
|
-
|
|
332
|
+
validator
|
|
1108
333
|
]);
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
value: update
|
|
1113
|
-
}, children));
|
|
1114
|
-
};
|
|
1115
|
-
const $70366c8972398d2a$export$6c869dfd601c964b = (props)=>{
|
|
1116
|
-
// Ensure that only one provider is active for an application
|
|
1117
|
-
const parentCtx = (0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
|
|
1118
|
-
if (parentCtx != null) return props.children ?? null;
|
|
1119
|
-
return (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$_DarkModeProvider, props);
|
|
1120
|
-
};
|
|
1121
|
-
const $70366c8972398d2a$export$4673cbff94e146e2 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$ValueContext);
|
|
1122
|
-
const $70366c8972398d2a$export$da73e849bfb9b978 = ()=>$70366c8972398d2a$export$4673cbff94e146e2()?.isEnabled ?? false;
|
|
1123
|
-
const $70366c8972398d2a$export$2158f0320fd21632 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
|
|
1124
|
-
const $70366c8972398d2a$export$4ca1a7f9e076e79b = (props)=>{
|
|
1125
|
-
const { allowReset: allowReset = true , showText: showText = false , children: children , ...rest } = props;
|
|
1126
|
-
const { isEnabled: isEnabled , isAutoset: isAutoset } = $70366c8972398d2a$export$4673cbff94e146e2();
|
|
1127
|
-
const icon = isEnabled ? "flash" : "moon";
|
|
1128
|
-
const update = $70366c8972398d2a$export$2158f0320fd21632();
|
|
1129
|
-
const onClick = (event)=>{
|
|
1130
|
-
if (update == null) {
|
|
1131
|
-
console.warn("No DarkModeProvider is available");
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
if (allowReset && event.shiftKey) {
|
|
1135
|
-
update(null);
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
update(!isEnabled);
|
|
1139
|
-
};
|
|
1140
|
-
const active = !isAutoset;
|
|
1141
|
-
return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
|
|
1142
|
-
active: active,
|
|
1143
|
-
...rest,
|
|
1144
|
-
icon: icon,
|
|
1145
|
-
onClick: onClick
|
|
334
|
+
const resetState = (0, $Zz0sd$useCallback)(()=>{
|
|
335
|
+
_setState(initialState);
|
|
336
|
+
storage.remove();
|
|
1146
337
|
}, [
|
|
1147
|
-
|
|
1148
|
-
isEnabled ? "Light" : "Dark"
|
|
1149
|
-
]),
|
|
1150
|
-
children,
|
|
338
|
+
initialState
|
|
1151
339
|
]);
|
|
1152
|
-
|
|
340
|
+
return [
|
|
341
|
+
state1,
|
|
342
|
+
setState,
|
|
343
|
+
resetState
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
1153
348
|
|
|
1154
349
|
|
|
1155
350
|
|
|
1156
351
|
var $439cdbb36f71c7cb$exports = {};
|
|
1157
352
|
|
|
1158
|
-
$parcel$export($439cdbb36f71c7cb$exports, "
|
|
1159
|
-
$parcel$export($439cdbb36f71c7cb$exports, "flex-row", () => $439cdbb36f71c7cb$export$1ec2a4762acd7aec, (v) => $439cdbb36f71c7cb$export$1ec2a4762acd7aec = v);
|
|
353
|
+
$parcel$export($439cdbb36f71c7cb$exports, "json-view-container", () => $439cdbb36f71c7cb$export$34a5cf3b4678f4f4, (v) => $439cdbb36f71c7cb$export$34a5cf3b4678f4f4 = v);
|
|
1160
354
|
$parcel$export($439cdbb36f71c7cb$exports, "root-hidden", () => $439cdbb36f71c7cb$export$e525b52bb498dd65, (v) => $439cdbb36f71c7cb$export$e525b52bb498dd65 = v);
|
|
1161
355
|
$parcel$export($439cdbb36f71c7cb$exports, "flex-col", () => $439cdbb36f71c7cb$export$39076b5dbe08a0a4, (v) => $439cdbb36f71c7cb$export$39076b5dbe08a0a4 = v);
|
|
1162
|
-
$parcel$export($439cdbb36f71c7cb$exports, "
|
|
1163
|
-
|
|
1164
|
-
var $439cdbb36f71c7cb$export$
|
|
356
|
+
$parcel$export($439cdbb36f71c7cb$exports, "flex-row", () => $439cdbb36f71c7cb$export$1ec2a4762acd7aec, (v) => $439cdbb36f71c7cb$export$1ec2a4762acd7aec = v);
|
|
357
|
+
$parcel$export($439cdbb36f71c7cb$exports, "flex-spacer", () => $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c, (v) => $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c = v);
|
|
358
|
+
var $439cdbb36f71c7cb$export$34a5cf3b4678f4f4;
|
|
1165
359
|
var $439cdbb36f71c7cb$export$e525b52bb498dd65;
|
|
1166
360
|
var $439cdbb36f71c7cb$export$39076b5dbe08a0a4;
|
|
1167
|
-
var $439cdbb36f71c7cb$export$
|
|
1168
|
-
$439cdbb36f71c7cb$export$b3bb2ed7c69eb53c
|
|
1169
|
-
$439cdbb36f71c7cb$export$
|
|
361
|
+
var $439cdbb36f71c7cb$export$1ec2a4762acd7aec;
|
|
362
|
+
var $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c;
|
|
363
|
+
$439cdbb36f71c7cb$export$34a5cf3b4678f4f4 = `_39DLrq_json-view-container`;
|
|
1170
364
|
$439cdbb36f71c7cb$export$e525b52bb498dd65 = `_39DLrq_root-hidden`;
|
|
1171
365
|
$439cdbb36f71c7cb$export$39076b5dbe08a0a4 = `_39DLrq_flex-col`;
|
|
1172
|
-
$439cdbb36f71c7cb$export$
|
|
366
|
+
$439cdbb36f71c7cb$export$1ec2a4762acd7aec = `_39DLrq_flex-row`;
|
|
367
|
+
$439cdbb36f71c7cb$export$b3bb2ed7c69eb53c = `_39DLrq_flex-spacer`;
|
|
1173
368
|
|
|
1174
369
|
|
|
1175
370
|
const $e94acad285dc5835$var$h = (0, $Zz0sd$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($439cdbb36f71c7cb$exports))));
|
|
@@ -1194,15 +389,13 @@ const $e94acad285dc5835$var$monokai = {
|
|
|
1194
389
|
base0F: "#cc6633"
|
|
1195
390
|
};
|
|
1196
391
|
function $e94acad285dc5835$export$bb1a5c615d2117e4(props) {
|
|
1197
|
-
const invertTheme = !(0, $70366c8972398d2a$export$da73e849bfb9b978)();
|
|
1198
392
|
return $e94acad285dc5835$var$h("div.json-view-container", {
|
|
1199
393
|
className: (0, $Zz0sd$classnames)(props.className, {
|
|
1200
|
-
"root-hidden": props.hideRoot
|
|
1201
|
-
"invert-theme": invertTheme
|
|
394
|
+
"root-hidden": props.hideRoot
|
|
1202
395
|
})
|
|
1203
396
|
}, $e94acad285dc5835$var$h((0, $Zz0sd$reactjsontree), {
|
|
1204
397
|
theme: $e94acad285dc5835$var$monokai,
|
|
1205
|
-
invertTheme:
|
|
398
|
+
invertTheme: false,
|
|
1206
399
|
...props
|
|
1207
400
|
}));
|
|
1208
401
|
}
|
|
@@ -2924,24 +2117,136 @@ const $33f06e347cd34062$export$9dcd2b1ca4768128 = $33f06e347cd34062$export$7460c
|
|
|
2924
2117
|
|
|
2925
2118
|
|
|
2926
2119
|
|
|
2120
|
+
const $70366c8972398d2a$var$systemDarkMode = ()=>({
|
|
2121
|
+
isEnabled: $70366c8972398d2a$var$matcher?.matches ?? false,
|
|
2122
|
+
isAutoset: true
|
|
2123
|
+
});
|
|
2124
|
+
const $70366c8972398d2a$var$ValueContext = (0, $Zz0sd$createContext)({
|
|
2125
|
+
isEnabled: false,
|
|
2126
|
+
isAutoset: false
|
|
2127
|
+
});
|
|
2128
|
+
const $70366c8972398d2a$var$UpdaterContext = (0, $Zz0sd$createContext)(null);
|
|
2129
|
+
const $70366c8972398d2a$var$matcher = window?.matchMedia("(prefers-color-scheme: dark)");
|
|
2130
|
+
const $70366c8972398d2a$var$_DarkModeProvider = (props)=>{
|
|
2131
|
+
const { addBodyClasses: addBodyClasses = true , isEnabled: isEnabled1 , followSystem: followSystem = false , children: children , } = props;
|
|
2132
|
+
const [storedValue, updateValue, resetState] = (0, $962bc0f04255cfc3$export$8b052fe25089340e)("ui-dark-mode", $70366c8972398d2a$var$systemDarkMode());
|
|
2133
|
+
// Guards so that we don't error on an invalid stored value
|
|
2134
|
+
const value = {
|
|
2135
|
+
isEnabled: storedValue?.isEnabled ?? false,
|
|
2136
|
+
isAutoset: storedValue?.isAutoset ?? false
|
|
2137
|
+
};
|
|
2138
|
+
(0, $Zz0sd$useEffect)(()=>{
|
|
2139
|
+
if (!followSystem) return;
|
|
2140
|
+
updateValue($70366c8972398d2a$var$systemDarkMode());
|
|
2141
|
+
}, []);
|
|
2142
|
+
(0, $Zz0sd$useEffect)(()=>{
|
|
2143
|
+
// Update value if isEnabled is provided
|
|
2144
|
+
if (isEnabled1 == null) return;
|
|
2145
|
+
updateValue({
|
|
2146
|
+
isAutoset: false,
|
|
2147
|
+
isEnabled: isEnabled1
|
|
2148
|
+
});
|
|
2149
|
+
}, [
|
|
2150
|
+
isEnabled1
|
|
2151
|
+
]);
|
|
2152
|
+
// Manage dark mode body classes
|
|
2153
|
+
(0, $Zz0sd$useEffect)(()=>{
|
|
2154
|
+
if (!addBodyClasses) return;
|
|
2155
|
+
if (value.isEnabled) document.body.classList.add("bp4-dark");
|
|
2156
|
+
else document.body.classList.remove("bp4-dark");
|
|
2157
|
+
}, [
|
|
2158
|
+
storedValue
|
|
2159
|
+
]);
|
|
2160
|
+
const update = (enabled)=>{
|
|
2161
|
+
if (enabled == null) return resetState();
|
|
2162
|
+
const isEnabled = enabled ?? !value.isEnabled;
|
|
2163
|
+
updateValue({
|
|
2164
|
+
isAutoset: false,
|
|
2165
|
+
isEnabled: isEnabled
|
|
2166
|
+
});
|
|
2167
|
+
};
|
|
2168
|
+
const onSystemChange = (0, $Zz0sd$useCallback)((e)=>{
|
|
2169
|
+
if (value.isAutoset || followSystem) updateValue($70366c8972398d2a$var$systemDarkMode());
|
|
2170
|
+
}, [
|
|
2171
|
+
value.isAutoset,
|
|
2172
|
+
followSystem
|
|
2173
|
+
]);
|
|
2174
|
+
(0, $Zz0sd$useEffect)(()=>{
|
|
2175
|
+
if ($70366c8972398d2a$var$matcher == null) return;
|
|
2176
|
+
$70366c8972398d2a$var$matcher.addEventListener("change", onSystemChange);
|
|
2177
|
+
return ()=>{
|
|
2178
|
+
$70366c8972398d2a$var$matcher.removeEventListener("change", onSystemChange);
|
|
2179
|
+
};
|
|
2180
|
+
}, [
|
|
2181
|
+
onSystemChange
|
|
2182
|
+
]);
|
|
2183
|
+
return (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$ValueContext.Provider, {
|
|
2184
|
+
value: value
|
|
2185
|
+
}, (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$UpdaterContext.Provider, {
|
|
2186
|
+
value: update
|
|
2187
|
+
}, children));
|
|
2188
|
+
};
|
|
2189
|
+
const $70366c8972398d2a$export$6c869dfd601c964b = (props)=>{
|
|
2190
|
+
// Ensure that only one provider is active for an application
|
|
2191
|
+
const parentCtx = (0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
|
|
2192
|
+
if (parentCtx != null) return props.children ?? null;
|
|
2193
|
+
return (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$_DarkModeProvider, props);
|
|
2194
|
+
};
|
|
2195
|
+
const $70366c8972398d2a$export$4673cbff94e146e2 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$ValueContext);
|
|
2196
|
+
const $70366c8972398d2a$export$da73e849bfb9b978 = ()=>$70366c8972398d2a$export$4673cbff94e146e2()?.isEnabled ?? false;
|
|
2197
|
+
const $70366c8972398d2a$export$2158f0320fd21632 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
|
|
2198
|
+
const $70366c8972398d2a$export$4ca1a7f9e076e79b = (props)=>{
|
|
2199
|
+
const { allowReset: allowReset = true , showText: showText = false , children: children , ...rest } = props;
|
|
2200
|
+
const { isEnabled: isEnabled , isAutoset: isAutoset } = $70366c8972398d2a$export$4673cbff94e146e2();
|
|
2201
|
+
const icon = isEnabled ? "flash" : "moon";
|
|
2202
|
+
const update = $70366c8972398d2a$export$2158f0320fd21632();
|
|
2203
|
+
const onClick = (event)=>{
|
|
2204
|
+
if (update == null) {
|
|
2205
|
+
console.warn("No DarkModeProvider is available");
|
|
2206
|
+
return;
|
|
2207
|
+
}
|
|
2208
|
+
if (allowReset && event.shiftKey) {
|
|
2209
|
+
update(null);
|
|
2210
|
+
return;
|
|
2211
|
+
}
|
|
2212
|
+
update(!isEnabled);
|
|
2213
|
+
};
|
|
2214
|
+
const active = !isAutoset;
|
|
2215
|
+
return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
|
|
2216
|
+
active: active,
|
|
2217
|
+
...rest,
|
|
2218
|
+
icon: icon,
|
|
2219
|
+
onClick: onClick
|
|
2220
|
+
}, [
|
|
2221
|
+
(0, $Zz0sd$macrostrathyper).if(showText)([
|
|
2222
|
+
isEnabled ? "Light" : "Dark"
|
|
2223
|
+
]),
|
|
2224
|
+
children,
|
|
2225
|
+
]);
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
|
|
2927
2232
|
|
|
2928
2233
|
var $4ec1d86cd773cb72$exports = {};
|
|
2929
2234
|
|
|
2930
|
-
$parcel$export($4ec1d86cd773cb72$exports, "bp4-slider-handle", () => $4ec1d86cd773cb72$export$4169bb8e8b0a147a, (v) => $4ec1d86cd773cb72$export$4169bb8e8b0a147a = v);
|
|
2931
|
-
$parcel$export($4ec1d86cd773cb72$exports, "mui-slider-disabled", () => $4ec1d86cd773cb72$export$223d74fd94b8aafd, (v) => $4ec1d86cd773cb72$export$223d74fd94b8aafd = v);
|
|
2932
|
-
$parcel$export($4ec1d86cd773cb72$exports, "nullable-slider", () => $4ec1d86cd773cb72$export$9d79918c5e5ccc23, (v) => $4ec1d86cd773cb72$export$9d79918c5e5ccc23 = v);
|
|
2933
2235
|
$parcel$export($4ec1d86cd773cb72$exports, "bp4-slider", () => $4ec1d86cd773cb72$export$cbeaddd6cc70281e, (v) => $4ec1d86cd773cb72$export$cbeaddd6cc70281e = v);
|
|
2236
|
+
$parcel$export($4ec1d86cd773cb72$exports, "mui-slider-disabled", () => $4ec1d86cd773cb72$export$223d74fd94b8aafd, (v) => $4ec1d86cd773cb72$export$223d74fd94b8aafd = v);
|
|
2237
|
+
$parcel$export($4ec1d86cd773cb72$exports, "bp4-slider-handle", () => $4ec1d86cd773cb72$export$4169bb8e8b0a147a, (v) => $4ec1d86cd773cb72$export$4169bb8e8b0a147a = v);
|
|
2934
2238
|
$parcel$export($4ec1d86cd773cb72$exports, "controls", () => $4ec1d86cd773cb72$export$cc1adf6fb659c762, (v) => $4ec1d86cd773cb72$export$cc1adf6fb659c762 = v);
|
|
2935
|
-
|
|
2936
|
-
var $4ec1d86cd773cb72$export$223d74fd94b8aafd;
|
|
2937
|
-
var $4ec1d86cd773cb72$export$9d79918c5e5ccc23;
|
|
2239
|
+
$parcel$export($4ec1d86cd773cb72$exports, "nullable-slider", () => $4ec1d86cd773cb72$export$9d79918c5e5ccc23, (v) => $4ec1d86cd773cb72$export$9d79918c5e5ccc23 = v);
|
|
2938
2240
|
var $4ec1d86cd773cb72$export$cbeaddd6cc70281e;
|
|
2241
|
+
var $4ec1d86cd773cb72$export$223d74fd94b8aafd;
|
|
2242
|
+
var $4ec1d86cd773cb72$export$4169bb8e8b0a147a;
|
|
2939
2243
|
var $4ec1d86cd773cb72$export$cc1adf6fb659c762;
|
|
2940
|
-
$4ec1d86cd773cb72$export$
|
|
2941
|
-
$4ec1d86cd773cb72$export$223d74fd94b8aafd = `TW5XUq_mui-slider-disabled`;
|
|
2942
|
-
$4ec1d86cd773cb72$export$9d79918c5e5ccc23 = `TW5XUq_nullable-slider`;
|
|
2244
|
+
var $4ec1d86cd773cb72$export$9d79918c5e5ccc23;
|
|
2943
2245
|
$4ec1d86cd773cb72$export$cbeaddd6cc70281e = `TW5XUq_bp4-slider`;
|
|
2246
|
+
$4ec1d86cd773cb72$export$223d74fd94b8aafd = `TW5XUq_mui-slider-disabled`;
|
|
2247
|
+
$4ec1d86cd773cb72$export$4169bb8e8b0a147a = `TW5XUq_bp4-slider-handle`;
|
|
2944
2248
|
$4ec1d86cd773cb72$export$cc1adf6fb659c762 = `TW5XUq_controls`;
|
|
2249
|
+
$4ec1d86cd773cb72$export$9d79918c5e5ccc23 = `TW5XUq_nullable-slider`;
|
|
2945
2250
|
|
|
2946
2251
|
|
|
2947
2252
|
const $23a8c77e45754d90$var$h = (0, $Zz0sd$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($4ec1d86cd773cb72$exports))));
|
|
@@ -3217,42 +2522,42 @@ function $dd30f84b43282b34$export$ae1920fef0a09de8(props) {
|
|
|
3217
2522
|
|
|
3218
2523
|
var $7798de452206f42d$exports = {};
|
|
3219
2524
|
|
|
3220
|
-
$parcel$export($7798de452206f42d$exports, "panel-
|
|
3221
|
-
$parcel$export($7798de452206f42d$exports, "minimal", () => $7798de452206f42d$export$10c083462c34aef3, (v) => $7798de452206f42d$export$10c083462c34aef3 = v);
|
|
3222
|
-
$parcel$export($7798de452206f42d$exports, "expander", () => $7798de452206f42d$export$f194ed9df726ec47, (v) => $7798de452206f42d$export$f194ed9df726ec47 = v);
|
|
2525
|
+
$parcel$export($7798de452206f42d$exports, "panel-column", () => $7798de452206f42d$export$b41821d1dd2069d4, (v) => $7798de452206f42d$export$b41821d1dd2069d4 = v);
|
|
3223
2526
|
$parcel$export($7798de452206f42d$exports, "panel-content", () => $7798de452206f42d$export$8ca81bb4a7c3bee, (v) => $7798de452206f42d$export$8ca81bb4a7c3bee = v);
|
|
3224
2527
|
$parcel$export($7798de452206f42d$exports, "overflow-hidden", () => $7798de452206f42d$export$15ee5781b96cbd33, (v) => $7798de452206f42d$export$15ee5781b96cbd33 = v);
|
|
3225
2528
|
$parcel$export($7798de452206f42d$exports, "panel-container-inner", () => $7798de452206f42d$export$95530b1b29b21d7, (v) => $7798de452206f42d$export$95530b1b29b21d7 = v);
|
|
3226
2529
|
$parcel$export($7798de452206f42d$exports, "panel", () => $7798de452206f42d$export$21f42ab9b6679f44, (v) => $7798de452206f42d$export$21f42ab9b6679f44 = v);
|
|
3227
|
-
$parcel$export($7798de452206f42d$exports, "panel-container", () => $7798de452206f42d$export$9dd9a0eceddf6af6, (v) => $7798de452206f42d$export$9dd9a0eceddf6af6 = v);
|
|
3228
|
-
$parcel$export($7798de452206f42d$exports, "content-panel", () => $7798de452206f42d$export$75659614cf20214d, (v) => $7798de452206f42d$export$75659614cf20214d = v);
|
|
3229
2530
|
$parcel$export($7798de452206f42d$exports, "panel-header", () => $7798de452206f42d$export$90b77e3be608e918, (v) => $7798de452206f42d$export$90b77e3be608e918 = v);
|
|
3230
|
-
$parcel$export($7798de452206f42d$exports, "panel-
|
|
2531
|
+
$parcel$export($7798de452206f42d$exports, "panel-outer", () => $7798de452206f42d$export$e671aa0933ea24f9, (v) => $7798de452206f42d$export$e671aa0933ea24f9 = v);
|
|
3231
2532
|
$parcel$export($7798de452206f42d$exports, "extra-space", () => $7798de452206f42d$export$cd109afefddca7db, (v) => $7798de452206f42d$export$cd109afefddca7db = v);
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
2533
|
+
$parcel$export($7798de452206f42d$exports, "expander", () => $7798de452206f42d$export$f194ed9df726ec47, (v) => $7798de452206f42d$export$f194ed9df726ec47 = v);
|
|
2534
|
+
$parcel$export($7798de452206f42d$exports, "panel-container", () => $7798de452206f42d$export$9dd9a0eceddf6af6, (v) => $7798de452206f42d$export$9dd9a0eceddf6af6 = v);
|
|
2535
|
+
$parcel$export($7798de452206f42d$exports, "minimal", () => $7798de452206f42d$export$10c083462c34aef3, (v) => $7798de452206f42d$export$10c083462c34aef3 = v);
|
|
2536
|
+
$parcel$export($7798de452206f42d$exports, "content-panel", () => $7798de452206f42d$export$75659614cf20214d, (v) => $7798de452206f42d$export$75659614cf20214d = v);
|
|
2537
|
+
var $7798de452206f42d$export$b41821d1dd2069d4;
|
|
3235
2538
|
var $7798de452206f42d$export$8ca81bb4a7c3bee;
|
|
3236
2539
|
var $7798de452206f42d$export$15ee5781b96cbd33;
|
|
3237
2540
|
var $7798de452206f42d$export$95530b1b29b21d7;
|
|
3238
2541
|
var $7798de452206f42d$export$21f42ab9b6679f44;
|
|
3239
|
-
var $7798de452206f42d$export$9dd9a0eceddf6af6;
|
|
3240
|
-
var $7798de452206f42d$export$75659614cf20214d;
|
|
3241
2542
|
var $7798de452206f42d$export$90b77e3be608e918;
|
|
3242
|
-
var $7798de452206f42d$export$
|
|
2543
|
+
var $7798de452206f42d$export$e671aa0933ea24f9;
|
|
3243
2544
|
var $7798de452206f42d$export$cd109afefddca7db;
|
|
3244
|
-
$7798de452206f42d$export$
|
|
3245
|
-
$7798de452206f42d$export$
|
|
3246
|
-
$7798de452206f42d$export$
|
|
2545
|
+
var $7798de452206f42d$export$f194ed9df726ec47;
|
|
2546
|
+
var $7798de452206f42d$export$9dd9a0eceddf6af6;
|
|
2547
|
+
var $7798de452206f42d$export$10c083462c34aef3;
|
|
2548
|
+
var $7798de452206f42d$export$75659614cf20214d;
|
|
2549
|
+
$7798de452206f42d$export$b41821d1dd2069d4 = `TGPwIq_panel-column`;
|
|
3247
2550
|
$7798de452206f42d$export$8ca81bb4a7c3bee = `TGPwIq_panel-content`;
|
|
3248
2551
|
$7798de452206f42d$export$15ee5781b96cbd33 = `TGPwIq_overflow-hidden`;
|
|
3249
2552
|
$7798de452206f42d$export$95530b1b29b21d7 = `TGPwIq_panel-container-inner`;
|
|
3250
2553
|
$7798de452206f42d$export$21f42ab9b6679f44 = `TGPwIq_panel`;
|
|
3251
|
-
$7798de452206f42d$export$9dd9a0eceddf6af6 = `TGPwIq_panel-container`;
|
|
3252
|
-
$7798de452206f42d$export$75659614cf20214d = `TGPwIq_content-panel`;
|
|
3253
2554
|
$7798de452206f42d$export$90b77e3be608e918 = `TGPwIq_panel-header`;
|
|
3254
|
-
$7798de452206f42d$export$
|
|
2555
|
+
$7798de452206f42d$export$e671aa0933ea24f9 = `TGPwIq_panel-outer`;
|
|
3255
2556
|
$7798de452206f42d$export$cd109afefddca7db = `TGPwIq_extra-space`;
|
|
2557
|
+
$7798de452206f42d$export$f194ed9df726ec47 = `TGPwIq_expander`;
|
|
2558
|
+
$7798de452206f42d$export$9dd9a0eceddf6af6 = `TGPwIq_panel-container`;
|
|
2559
|
+
$7798de452206f42d$export$10c083462c34aef3 = `TGPwIq_minimal`;
|
|
2560
|
+
$7798de452206f42d$export$75659614cf20214d = `TGPwIq_content-panel`;
|
|
3256
2561
|
|
|
3257
2562
|
|
|
3258
2563
|
|
|
@@ -3414,22 +2719,22 @@ const $e64decd575080523$export$25c607d6a337a384 = (props)=>$e64decd575080523$var
|
|
|
3414
2719
|
var $d75f5cd4dad80e8f$exports = {};
|
|
3415
2720
|
|
|
3416
2721
|
$parcel$export($d75f5cd4dad80e8f$exports, "expanded", () => $d75f5cd4dad80e8f$export$52105d146316f63c, (v) => $d75f5cd4dad80e8f$export$52105d146316f63c = v);
|
|
2722
|
+
$parcel$export($d75f5cd4dad80e8f$exports, "main-column", () => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb, (v) => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb = v);
|
|
3417
2723
|
$parcel$export($d75f5cd4dad80e8f$exports, "user-interface", () => $d75f5cd4dad80e8f$export$e005ee6dda35184b, (v) => $d75f5cd4dad80e8f$export$e005ee6dda35184b = v);
|
|
3418
2724
|
$parcel$export($d75f5cd4dad80e8f$exports, "spacer", () => $d75f5cd4dad80e8f$export$8cc075c801fd6817, (v) => $d75f5cd4dad80e8f$export$8cc075c801fd6817 = v);
|
|
3419
2725
|
$parcel$export($d75f5cd4dad80e8f$exports, "three-column", () => $d75f5cd4dad80e8f$export$55d10750d58b7b01, (v) => $d75f5cd4dad80e8f$export$55d10750d58b7b01 = v);
|
|
3420
|
-
$parcel$export($d75f5cd4dad80e8f$exports, "main-column", () => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb, (v) => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb = v);
|
|
3421
2726
|
$parcel$export($d75f5cd4dad80e8f$exports, "context-column", () => $d75f5cd4dad80e8f$export$9b1daf63e7965780, (v) => $d75f5cd4dad80e8f$export$9b1daf63e7965780 = v);
|
|
3422
2727
|
var $d75f5cd4dad80e8f$export$52105d146316f63c;
|
|
2728
|
+
var $d75f5cd4dad80e8f$export$9c88f9a435c40ccb;
|
|
3423
2729
|
var $d75f5cd4dad80e8f$export$e005ee6dda35184b;
|
|
3424
2730
|
var $d75f5cd4dad80e8f$export$8cc075c801fd6817;
|
|
3425
2731
|
var $d75f5cd4dad80e8f$export$55d10750d58b7b01;
|
|
3426
|
-
var $d75f5cd4dad80e8f$export$9c88f9a435c40ccb;
|
|
3427
2732
|
var $d75f5cd4dad80e8f$export$9b1daf63e7965780;
|
|
3428
2733
|
$d75f5cd4dad80e8f$export$52105d146316f63c = `tBd70W_expanded`;
|
|
2734
|
+
$d75f5cd4dad80e8f$export$9c88f9a435c40ccb = `tBd70W_main-column`;
|
|
3429
2735
|
$d75f5cd4dad80e8f$export$e005ee6dda35184b = `tBd70W_user-interface`;
|
|
3430
2736
|
$d75f5cd4dad80e8f$export$8cc075c801fd6817 = `tBd70W_spacer`;
|
|
3431
2737
|
$d75f5cd4dad80e8f$export$55d10750d58b7b01 = `tBd70W_three-column`;
|
|
3432
|
-
$d75f5cd4dad80e8f$export$9c88f9a435c40ccb = `tBd70W_main-column`;
|
|
3433
2738
|
$d75f5cd4dad80e8f$export$9b1daf63e7965780 = `tBd70W_context-column`;
|
|
3434
2739
|
|
|
3435
2740
|
|
|
@@ -3718,13 +3023,13 @@ function $4fae2d573d730db8$export$58bfb4f6ec5aa58d(props) {
|
|
|
3718
3023
|
|
|
3719
3024
|
const $427faf94283514d4$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($29ab0212ea6844d0$exports))));
|
|
3720
3025
|
function $427faf94283514d4$var$PositionButton({ position: position }) {
|
|
3721
|
-
const focusState = (0, $
|
|
3026
|
+
const focusState = (0, $Zz0sd$useFocusState)(position);
|
|
3722
3027
|
return $427faf94283514d4$var$h("div.position-controls", [
|
|
3723
|
-
$427faf94283514d4$var$h((0, $
|
|
3028
|
+
$427faf94283514d4$var$h((0, $Zz0sd$LocationFocusButton), {
|
|
3724
3029
|
location: position,
|
|
3725
3030
|
focusState: focusState
|
|
3726
3031
|
}, []),
|
|
3727
|
-
(0, $
|
|
3032
|
+
(0, $Zz0sd$isCentered)(focusState) ? $427faf94283514d4$var$h($427faf94283514d4$var$CopyLinkButton, {
|
|
3728
3033
|
itemName: "position"
|
|
3729
3034
|
}) : null,
|
|
3730
3035
|
]);
|
|
@@ -3833,7 +3138,7 @@ $parcel$export($64ee2eed3ed5ffbc$exports, "buildInspectorStyle", () => $64ee2eed
|
|
|
3833
3138
|
|
|
3834
3139
|
async function $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d(baseStyle, params = null) {
|
|
3835
3140
|
const { inDarkMode: inDarkMode = false , color: color = "rgb(74, 242, 161)" , mapboxToken: mapboxToken , xRaySources: xRaySources } = params;
|
|
3836
|
-
const style = await (0, $
|
|
3141
|
+
const style = await (0, $Zz0sd$getMapboxStyle)(baseStyle, {
|
|
3837
3142
|
access_token: mapboxToken
|
|
3838
3143
|
});
|
|
3839
3144
|
const sources = xRaySources ?? Object.keys(style.sources);
|
|
@@ -3883,14 +3188,14 @@ function $64ee2eed3ed5ffbc$var$transformMapboxLayer(layer, color, inDarkMode) {
|
|
|
3883
3188
|
async function $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6(baseStyle, overlayStyle = null, params = {}) {
|
|
3884
3189
|
const { mapboxToken: mapboxToken , xRay: xRay = false , xRaySources: _xRaySources , ...rest } = params;
|
|
3885
3190
|
let xRaySources = _xRaySources;
|
|
3886
|
-
let style = await (0, $
|
|
3191
|
+
let style = await (0, $Zz0sd$getMapboxStyle)(baseStyle, {
|
|
3887
3192
|
access_token: mapboxToken
|
|
3888
3193
|
});
|
|
3889
3194
|
if (overlayStyle != null) {
|
|
3890
|
-
const overlay = await (0, $
|
|
3195
|
+
const overlay = await (0, $Zz0sd$getMapboxStyle)(overlayStyle, {
|
|
3891
3196
|
access_token: mapboxToken
|
|
3892
3197
|
});
|
|
3893
|
-
style = (0, $
|
|
3198
|
+
style = (0, $Zz0sd$mergeStyles)(style, overlay);
|
|
3894
3199
|
xRaySources ??= Object.keys(overlay.sources);
|
|
3895
3200
|
}
|
|
3896
3201
|
if (xRay) {
|
|
@@ -4077,7 +3382,7 @@ function $91d5aa004eeb2226$var$ScaleControl(props) {
|
|
|
4077
3382
|
maxWidth: 200,
|
|
4078
3383
|
unit: "metric"
|
|
4079
3384
|
});
|
|
4080
|
-
return $91d5aa004eeb2226$var$h((0, $
|
|
3385
|
+
return $91d5aa004eeb2226$var$h((0, $Zz0sd$MapControlWrapper), {
|
|
4081
3386
|
className: "map-scale-control",
|
|
4082
3387
|
control: (0, $Zz0sd$ScaleControl),
|
|
4083
3388
|
options: optionsRef.current,
|
|
@@ -4093,7 +3398,7 @@ function $91d5aa004eeb2226$var$GeolocationControl(props) {
|
|
|
4093
3398
|
enableHighAccuracy: true
|
|
4094
3399
|
}
|
|
4095
3400
|
});
|
|
4096
|
-
return $91d5aa004eeb2226$var$h((0, $
|
|
3401
|
+
return $91d5aa004eeb2226$var$h((0, $Zz0sd$MapControlWrapper), {
|
|
4097
3402
|
control: (0, $Zz0sd$GeolocateControl),
|
|
4098
3403
|
options: optionsRef.current,
|
|
4099
3404
|
...props
|
|
@@ -4102,13 +3407,13 @@ function $91d5aa004eeb2226$var$GeolocationControl(props) {
|
|
|
4102
3407
|
function $91d5aa004eeb2226$export$db1a2e058a06fb5c() {
|
|
4103
3408
|
return $91d5aa004eeb2226$var$h("div.map-controls", [
|
|
4104
3409
|
$91d5aa004eeb2226$var$h($91d5aa004eeb2226$var$ScaleControl),
|
|
4105
|
-
$91d5aa004eeb2226$var$h((0, $
|
|
3410
|
+
$91d5aa004eeb2226$var$h((0, $Zz0sd$ThreeDControl), {
|
|
4106
3411
|
className: "map-3d-control"
|
|
4107
3412
|
}),
|
|
4108
|
-
$91d5aa004eeb2226$var$h((0, $
|
|
3413
|
+
$91d5aa004eeb2226$var$h((0, $Zz0sd$CompassControl), {
|
|
4109
3414
|
className: "compass-control"
|
|
4110
3415
|
}),
|
|
4111
|
-
$91d5aa004eeb2226$var$h((0, $
|
|
3416
|
+
$91d5aa004eeb2226$var$h((0, $Zz0sd$GlobeControl), {
|
|
4112
3417
|
className: "globe-control"
|
|
4113
3418
|
}),
|
|
4114
3419
|
$91d5aa004eeb2226$var$h($91d5aa004eeb2226$var$GeolocationControl, {
|
|
@@ -4163,7 +3468,7 @@ function $4bdfa9cd8240b2fd$var$_MapAreaContainer({ children: children , classNam
|
|
|
4163
3468
|
children ?? mainPanel,
|
|
4164
3469
|
$4bdfa9cd8240b2fd$var$h("div.detail-stack.infodrawer-container", detailStackProps, [
|
|
4165
3470
|
detailPanel,
|
|
4166
|
-
$4bdfa9cd8240b2fd$var$h((0, $
|
|
3471
|
+
$4bdfa9cd8240b2fd$var$h((0, $Zz0sd$ZoomControl), {
|
|
4167
3472
|
className: "zoom-control"
|
|
4168
3473
|
}),
|
|
4169
3474
|
$4bdfa9cd8240b2fd$var$h("div.spacer"),
|
|
@@ -4173,12 +3478,12 @@ function $4bdfa9cd8240b2fd$var$_MapAreaContainer({ children: children , classNam
|
|
|
4173
3478
|
$4bdfa9cd8240b2fd$var$h("div.bottom", null, bottomPanel),
|
|
4174
3479
|
]);
|
|
4175
3480
|
}
|
|
4176
|
-
const $4bdfa9cd8240b2fd$var$MapProviders = ({ children: children })=>$4bdfa9cd8240b2fd$var$h((0, $c8a29764c15c7584$export$9194c0aa0cd7a9ff), $4bdfa9cd8240b2fd$var$h((0, $
|
|
3481
|
+
const $4bdfa9cd8240b2fd$var$MapProviders = ({ children: children })=>$4bdfa9cd8240b2fd$var$h((0, $c8a29764c15c7584$export$9194c0aa0cd7a9ff), $4bdfa9cd8240b2fd$var$h((0, $Zz0sd$MapboxMapProvider), children));
|
|
4177
3482
|
const $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290 = (props)=>$4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$var$MapProviders, $4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$var$_MapAreaContainer, props));
|
|
4178
3483
|
function $4bdfa9cd8240b2fd$export$fa395a37c3898ae3({ className: className , children: children }) {
|
|
4179
|
-
const { mapPosition: mapPosition } = (0, $
|
|
3484
|
+
const { mapPosition: mapPosition } = (0, $Zz0sd$useMapStatus)();
|
|
4180
3485
|
if (mapPosition != null) {
|
|
4181
|
-
const { mapIsRotated: mapIsRotated , mapUse3D: mapUse3D , mapIsGlobal: mapIsGlobal } = (0, $
|
|
3486
|
+
const { mapIsRotated: mapIsRotated , mapUse3D: mapUse3D , mapIsGlobal: mapIsGlobal } = (0, $Zz0sd$mapViewInfo)(mapPosition);
|
|
4182
3487
|
className = (0, $Zz0sd$classnames)(className, {
|
|
4183
3488
|
"map-is-rotated": mapIsRotated,
|
|
4184
3489
|
"map-3d-available": mapUse3D,
|
|
@@ -4245,7 +3550,7 @@ function $82fe09613877ffc2$export$278090850f6b3a9f(mapRef, markerRef, markerPosi
|
|
|
4245
3550
|
|
|
4246
3551
|
|
|
4247
3552
|
function $4bc3dd5f0732eed3$export$31b2e088aff2dc5d({ containerRef: containerRef }) {
|
|
4248
|
-
const mapRef = (0, $
|
|
3553
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4249
3554
|
const debouncedResize = (0, $Zz0sd$useRef)((0, $Zz0sd$debounce)(()=>{
|
|
4250
3555
|
mapRef.current?.resize();
|
|
4251
3556
|
}, 100));
|
|
@@ -4256,7 +3561,7 @@ function $4bc3dd5f0732eed3$export$31b2e088aff2dc5d({ containerRef: containerRef
|
|
|
4256
3561
|
return null;
|
|
4257
3562
|
}
|
|
4258
3563
|
function $4bc3dd5f0732eed3$export$2ab96428dea558d6({ containerRef: containerRef , parentRef: parentRef , infoMarkerPosition: infoMarkerPosition }) {
|
|
4259
|
-
const mapRef = (0, $
|
|
3564
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4260
3565
|
const [padding, setPadding] = (0, $Zz0sd$useState)((0, $82fe09613877ffc2$export$bb78f9f01775eef1)(containerRef, parentRef));
|
|
4261
3566
|
const updateMapPadding = (0, $Zz0sd$useCallback)(()=>{
|
|
4262
3567
|
const newPadding = (0, $82fe09613877ffc2$export$bb78f9f01775eef1)(containerRef, parentRef);
|
|
@@ -4279,16 +3584,16 @@ function $4bc3dd5f0732eed3$export$2ab96428dea558d6({ containerRef: containerRef
|
|
|
4279
3584
|
updateMapPadding();
|
|
4280
3585
|
}
|
|
4281
3586
|
});
|
|
4282
|
-
(0, $
|
|
3587
|
+
(0, $Zz0sd$useMapEaseToCenter)(infoMarkerPosition, padding);
|
|
4283
3588
|
return null;
|
|
4284
3589
|
}
|
|
4285
3590
|
function $4bc3dd5f0732eed3$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = null }) {
|
|
4286
|
-
const mapRef = (0, $
|
|
4287
|
-
const dispatch = (0, $
|
|
3591
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
3592
|
+
const dispatch = (0, $Zz0sd$useMapDispatch)();
|
|
4288
3593
|
const mapMovedCallback = (0, $Zz0sd$useCallback)(()=>{
|
|
4289
3594
|
const map = mapRef.current;
|
|
4290
3595
|
if (map == null) return;
|
|
4291
|
-
const mapPosition = (0, $
|
|
3596
|
+
const mapPosition = (0, $Zz0sd$getMapPosition)(map);
|
|
4292
3597
|
dispatch({
|
|
4293
3598
|
type: "map-moved",
|
|
4294
3599
|
payload: mapPosition
|
|
@@ -4317,9 +3622,9 @@ function $4bc3dd5f0732eed3$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = nu
|
|
|
4317
3622
|
return null;
|
|
4318
3623
|
}
|
|
4319
3624
|
function $4bc3dd5f0732eed3$export$e57f9eaa51773f82({ ignoredSources: ignoredSources , onMapLoading: onMapLoading = null , onMapIdle: onMapIdle = null , mapIsLoading: mapIsLoading1 , }) {
|
|
4320
|
-
const mapRef = (0, $
|
|
3625
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4321
3626
|
const loadingRef = (0, $Zz0sd$useRef)(false);
|
|
4322
|
-
const dispatch = (0, $
|
|
3627
|
+
const dispatch = (0, $Zz0sd$useMapDispatch)();
|
|
4323
3628
|
(0, $Zz0sd$useEffect)(()=>{
|
|
4324
3629
|
const map = mapRef.current;
|
|
4325
3630
|
const mapIsLoading = loadingRef.current;
|
|
@@ -4359,7 +3664,7 @@ function $4bc3dd5f0732eed3$export$e57f9eaa51773f82({ ignoredSources: ignoredSour
|
|
|
4359
3664
|
return null;
|
|
4360
3665
|
}
|
|
4361
3666
|
function $4bc3dd5f0732eed3$export$5c90a91c7455938c({ position: position , setPosition: setPosition , centerMarker: centerMarker = true }) {
|
|
4362
|
-
const mapRef = (0, $
|
|
3667
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4363
3668
|
const markerRef = (0, $Zz0sd$useRef)(null);
|
|
4364
3669
|
(0, $82fe09613877ffc2$export$278090850f6b3a9f)(mapRef, markerRef, position);
|
|
4365
3670
|
const handleMapClick = (0, $Zz0sd$useCallback)((event)=>{
|
|
@@ -4486,8 +3791,8 @@ function $9e150e311a3261e9$export$ab1e7a67d6ec5ad8(props) {
|
|
|
4486
3791
|
const { enableTerrain: enableTerrain = true , style: style , transformRequest: transformRequest , mapPosition: mapPosition = $9e150e311a3261e9$var$defaultMapPosition , children: children , accessToken: accessToken , infoMarkerPosition: infoMarkerPosition , projection: projection , } = props;
|
|
4487
3792
|
if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
|
|
4488
3793
|
if (accessToken != null) (0, $Zz0sd$mapboxgl).accessToken = accessToken;
|
|
4489
|
-
const dispatch = (0, $
|
|
4490
|
-
let mapRef = (0, $
|
|
3794
|
+
const dispatch = (0, $Zz0sd$useMapDispatch)();
|
|
3795
|
+
let mapRef = (0, $Zz0sd$useMapRef)();
|
|
4491
3796
|
const ref = (0, $Zz0sd$useRef)();
|
|
4492
3797
|
const parentRef = (0, $Zz0sd$useRef)();
|
|
4493
3798
|
// Keep track of map position for reloads
|
|
@@ -4528,12 +3833,12 @@ function $9e150e311a3261e9$export$ab1e7a67d6ec5ad8(props) {
|
|
|
4528
3833
|
(0, $Zz0sd$useEffect)(()=>{
|
|
4529
3834
|
const map = mapRef.current;
|
|
4530
3835
|
if (map == null || mapPosition == null) return;
|
|
4531
|
-
(0, $
|
|
3836
|
+
(0, $Zz0sd$setMapPosition)(map, mapPosition);
|
|
4532
3837
|
}, [
|
|
4533
3838
|
mapRef.current
|
|
4534
3839
|
]);
|
|
4535
|
-
const { mapPosition: _computedMapPosition } = (0, $
|
|
4536
|
-
const { mapUse3D: mapUse3D , mapIsRotated: mapIsRotated } = (0, $
|
|
3840
|
+
const { mapPosition: _computedMapPosition } = (0, $Zz0sd$useMapStatus)();
|
|
3841
|
+
const { mapUse3D: mapUse3D , mapIsRotated: mapIsRotated } = (0, $Zz0sd$mapViewInfo)(_computedMapPosition);
|
|
4537
3842
|
// Get map projection
|
|
4538
3843
|
const _projection = mapRef.current?.getProjection()?.name ?? "mercator";
|
|
4539
3844
|
const className = (0, $Zz0sd$classnames)({
|
|
@@ -4570,7 +3875,7 @@ function $9e150e311a3261e9$export$ab1e7a67d6ec5ad8(props) {
|
|
|
4570
3875
|
]);
|
|
4571
3876
|
}
|
|
4572
3877
|
function $9e150e311a3261e9$export$cee395a8a2a00b29({ mapUse3D: mapUse3D , terrainSourceID: terrainSourceID }) {
|
|
4573
|
-
const mapRef = (0, $
|
|
3878
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4574
3879
|
(0, $Zz0sd$useEffect)(()=>{
|
|
4575
3880
|
const map = mapRef.current;
|
|
4576
3881
|
if (map == null) return;
|
|
@@ -4663,8 +3968,8 @@ function $1d4d29ef2725aa16$export$86c09739b12f23cd({ tile: tile , color: color =
|
|
|
4663
3968
|
}, [
|
|
4664
3969
|
color
|
|
4665
3970
|
]);
|
|
4666
|
-
const map1 = (0, $
|
|
4667
|
-
(0, $
|
|
3971
|
+
const map1 = (0, $Zz0sd$useMapRef)();
|
|
3972
|
+
(0, $Zz0sd$useMapConditionalStyle)(map1, tile, styleCallback);
|
|
4668
3973
|
return null;
|
|
4669
3974
|
}
|
|
4670
3975
|
|
|
@@ -4887,8 +4192,8 @@ function $b8c84b63e75fe4f2$export$dc87b4d46cea200d({ feature: feature }) {
|
|
|
4887
4192
|
]);
|
|
4888
4193
|
}
|
|
4889
4194
|
function $b8c84b63e75fe4f2$export$214daccdda0f4ac6({ selectedLocation: selectedLocation , setFeatures: setFeatures , radius: radius = 2 }) {
|
|
4890
|
-
const mapRef = (0, $
|
|
4891
|
-
const { isLoading: isLoading } = (0, $
|
|
4195
|
+
const mapRef = (0, $Zz0sd$useMapRef)();
|
|
4196
|
+
const { isLoading: isLoading } = (0, $Zz0sd$useMapStatus)();
|
|
4892
4197
|
const prevLocation = $b8c84b63e75fe4f2$var$usePrevious(selectedLocation);
|
|
4893
4198
|
(0, $Zz0sd$useEffect)(()=>{
|
|
4894
4199
|
const map = mapRef?.current;
|
|
@@ -4941,7 +4246,7 @@ function $b8c84b63e75fe4f2$var$KeyValue({ label: label , value: value }) {
|
|
|
4941
4246
|
]);
|
|
4942
4247
|
}
|
|
4943
4248
|
function $b8c84b63e75fe4f2$var$LoadingAwareFeatureSet({ features: features , sourceID: sourceID }) {
|
|
4944
|
-
const map = (0, $
|
|
4249
|
+
const map = (0, $Zz0sd$useMapRef)();
|
|
4945
4250
|
if (map?.current == null) return null;
|
|
4946
4251
|
const [isLoaded1, setIsLoaded] = (0, $Zz0sd$useState)(false);
|
|
4947
4252
|
const sourceFeatures = features.filter((d)=>d.source == "burwell");
|
|
@@ -5194,10 +4499,10 @@ function $a281a0612311d660$export$2391061fbdfb71ef({ title: title = "Map inspect
|
|
|
5194
4499
|
|
|
5195
4500
|
|
|
5196
4501
|
|
|
5197
|
-
$parcel$exportWildcard($b6d2ac1192949c28$exports, $
|
|
4502
|
+
$parcel$exportWildcard($b6d2ac1192949c28$exports, $a281a0612311d660$exports);
|
|
5198
4503
|
$parcel$exportWildcard($b6d2ac1192949c28$exports, $1d4d29ef2725aa16$exports);
|
|
5199
4504
|
$parcel$exportWildcard($b6d2ac1192949c28$exports, $b8c84b63e75fe4f2$exports);
|
|
5200
|
-
$parcel$exportWildcard($b6d2ac1192949c28$exports, $
|
|
4505
|
+
$parcel$exportWildcard($b6d2ac1192949c28$exports, $64ee2eed3ed5ffbc$exports);
|
|
5201
4506
|
|
|
5202
4507
|
|
|
5203
4508
|
|
|
@@ -5209,5 +4514,5 @@ $parcel$exportWildcard($b6d2ac1192949c28$exports, $a281a0612311d660$exports);
|
|
|
5209
4514
|
|
|
5210
4515
|
|
|
5211
4516
|
|
|
5212
|
-
export {$6e914c81c8e053da$export$4ec83e90d030b2f3 as LoadingButton, $6e914c81c8e053da$export$9e3bae3c08bde368 as MapLoadingButton, $6e914c81c8e053da$export$a8cc0062d02a3841 as FloatingNavbar, $f50c3537aaff0cff$export$83f9a19cf91c2d06 as InfoDrawerContainer, $f50c3537aaff0cff$export$aa4baff5242ea6e1 as LocationPanel, $
|
|
5213
|
-
//# sourceMappingURL=
|
|
4517
|
+
export {$6e914c81c8e053da$export$4ec83e90d030b2f3 as LoadingButton, $6e914c81c8e053da$export$9e3bae3c08bde368 as MapLoadingButton, $6e914c81c8e053da$export$a8cc0062d02a3841 as FloatingNavbar, $f50c3537aaff0cff$export$83f9a19cf91c2d06 as InfoDrawerContainer, $f50c3537aaff0cff$export$aa4baff5242ea6e1 as LocationPanel, $a281a0612311d660$export$dce4b6e67bb5f25a as MacrostratVectorTileset, $a281a0612311d660$export$cc7c195070dfb906 as MacrostratRasterTileset, $a281a0612311d660$export$dda1d9f60106f0e9 as h, $a281a0612311d660$export$2391061fbdfb71ef as DevMapPage, $1d4d29ef2725aa16$export$86c09739b12f23cd as TileExtentLayer, $b8c84b63e75fe4f2$export$dc87b4d46cea200d as FeatureRecord, $b8c84b63e75fe4f2$export$214daccdda0f4ac6 as FeatureSelectionHandler, $b8c84b63e75fe4f2$export$43c75dec9d0b96c as TileInfo, $b8c84b63e75fe4f2$export$43277c51a01761c1 as FeaturePanel, $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d as buildXRayStyle, $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6 as buildInspectorStyle, $4bdfa9cd8240b2fd$export$57b87f3e07d4bb90 as MapInterface, $4bdfa9cd8240b2fd$export$ec68dd77edbe678b as PanelCard, $4bdfa9cd8240b2fd$export$fa395a37c3898ae3 as MapStyledContainer, $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290 as MapAreaContainer, $9e150e311a3261e9$export$ab1e7a67d6ec5ad8 as MapView, $9e150e311a3261e9$export$cee395a8a2a00b29 as MapTerrainManager, $91d5aa004eeb2226$export$db1a2e058a06fb5c as MapBottomControls, $4bc3dd5f0732eed3$export$31b2e088aff2dc5d as MapResizeManager, $4bc3dd5f0732eed3$export$2ab96428dea558d6 as MapPaddingManager, $4bc3dd5f0732eed3$export$f6eeee399afc4e9a as MapMovedReporter, $4bc3dd5f0732eed3$export$e57f9eaa51773f82 as MapLoadingReporter, $4bc3dd5f0732eed3$export$5c90a91c7455938c as MapMarker, $82fe09613877ffc2$export$bb78f9f01775eef1 as getMapPadding, $82fe09613877ffc2$export$278090850f6b3a9f as useMapMarker, $4fae2d573d730db8$export$716098b85fd0efdf as ValueWithUnit, $4fae2d573d730db8$export$af8082af0bea3eb1 as DegreeCoord, $4fae2d573d730db8$export$f195b3550849e560 as LngLatCoords, $4fae2d573d730db8$export$58bfb4f6ec5aa58d as Elevation, $d570ac304373e71c$export$cea00a9d724d5a32 as ExpansionPanelSummary, $d570ac304373e71c$export$39c134eb0b07cf0e as InfoPanelSection, $d570ac304373e71c$export$40e646e38e6ed100 as ExpansionPanel, $d570ac304373e71c$export$d7160281aff7c3b8 as SubExpansionPanel, $d570ac304373e71c$export$44ad9ff780615135 as ExpandableDetailsPanel, $d570ac304373e71c$export$263416b670b3f129 as ExpansionBody};
|
|
4518
|
+
//# sourceMappingURL=module.js.map
|