@macrostrat/map-interface 1.0.1 → 1.0.2
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/main.css +951 -0
- package/dist/main.css.map +1 -0
- package/dist/main.js +1916 -0
- package/dist/main.js.map +1 -0
- package/dist/module.css +951 -0
- package/dist/module.css.map +1 -0
- package/dist/module.js +1907 -0
- package/dist/module.js.map +1 -0
- package/dist/types.d.ts +260 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +15 -11
- package/src/dev/map-page.ts +7 -12
- package/src/dev/vector-tile-features.ts +1 -1
- package/src/location-panel/main.module.sass +9 -0
- package/src/main.module.sass +53 -30
package/src/dev/map-page.ts
CHANGED
|
@@ -19,20 +19,9 @@ import {
|
|
|
19
19
|
} from "./vector-tile-features";
|
|
20
20
|
import { MapPosition } from "@macrostrat/mapbox-utils";
|
|
21
21
|
|
|
22
|
-
export enum MacrostratVectorTileset {
|
|
23
|
-
Carto = "carto",
|
|
24
|
-
CartoSlim = "carto-slim",
|
|
25
|
-
IGCPOrogens = "igcp-orogens",
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export enum MacrostratRasterTileset {
|
|
29
|
-
Carto = "carto",
|
|
30
|
-
Emphasized = "emphasized",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
22
|
export const h = hyper.styled(styles);
|
|
34
23
|
|
|
35
|
-
export function
|
|
24
|
+
export function MapInspector({
|
|
36
25
|
title = "Map inspector",
|
|
37
26
|
headerElement = null,
|
|
38
27
|
transformRequest = null,
|
|
@@ -43,6 +32,7 @@ export function DevMapPage({
|
|
|
43
32
|
style,
|
|
44
33
|
focusedSource = null,
|
|
45
34
|
focusedSourceTitle = null,
|
|
35
|
+
fitViewport = true,
|
|
46
36
|
projection = null,
|
|
47
37
|
}: {
|
|
48
38
|
headerElement?: React.ReactElement;
|
|
@@ -56,6 +46,7 @@ export function DevMapPage({
|
|
|
56
46
|
focusedSourceTitle?: string;
|
|
57
47
|
projection?: string;
|
|
58
48
|
mapPosition?: MapPosition;
|
|
49
|
+
fitViewport?: boolean;
|
|
59
50
|
}) {
|
|
60
51
|
/* We apply a custom style to the panel container when we are interacting
|
|
61
52
|
with the search bar, so that we can block map interactions until search
|
|
@@ -154,6 +145,7 @@ export function DevMapPage({
|
|
|
154
145
|
]),
|
|
155
146
|
detailPanel: detailElement,
|
|
156
147
|
contextPanelOpen: isOpen,
|
|
148
|
+
fitViewport,
|
|
157
149
|
},
|
|
158
150
|
h(
|
|
159
151
|
MapView,
|
|
@@ -178,3 +170,6 @@ export function DevMapPage({
|
|
|
178
170
|
)
|
|
179
171
|
);
|
|
180
172
|
}
|
|
173
|
+
|
|
174
|
+
// Legacy export
|
|
175
|
+
export const DevMapPage = MapInspector;
|
|
@@ -60,7 +60,7 @@ export function FeatureSelectionHandler({
|
|
|
60
60
|
];
|
|
61
61
|
const features = map.queryRenderedFeatures(bbox);
|
|
62
62
|
setFeatures(features);
|
|
63
|
-
}, [mapRef?.current, selectedLocation, isLoading]);
|
|
63
|
+
}, [mapRef.current, prevLocation?.current, selectedLocation, isLoading]);
|
|
64
64
|
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.copy-link-button:global(.bp5-minimal.bp5-button)
|
|
2
2
|
color: var(--text-subtle-color)
|
|
3
|
+
|
|
3
4
|
svg
|
|
4
5
|
fill: var(--text-subtle-color)
|
|
5
6
|
|
|
@@ -10,8 +11,10 @@
|
|
|
10
11
|
align-items: center
|
|
11
12
|
gap: 1em
|
|
12
13
|
border-bottom: 1px solid var(--panel-rule-color)
|
|
14
|
+
|
|
13
15
|
.spacer
|
|
14
16
|
flex-grow: 1
|
|
17
|
+
|
|
15
18
|
.left-icon
|
|
16
19
|
padding: 7px
|
|
17
20
|
|
|
@@ -20,6 +23,7 @@
|
|
|
20
23
|
|
|
21
24
|
.infodrawer-header-item
|
|
22
25
|
font-size: 12px
|
|
26
|
+
|
|
23
27
|
:global(.secondary)
|
|
24
28
|
font-size: 0.9em
|
|
25
29
|
color: var(--text-subtle-color)
|
|
@@ -32,14 +36,19 @@
|
|
|
32
36
|
display: flex
|
|
33
37
|
flex-direction: column
|
|
34
38
|
overflow: hidden
|
|
39
|
+
background-color: var(--panel-background-color)
|
|
40
|
+
|
|
35
41
|
&:global(.bp5-card)
|
|
36
42
|
padding: 0
|
|
43
|
+
background-color: var(--panel-background-color)
|
|
44
|
+
|
|
37
45
|
|
|
38
46
|
&.loading
|
|
39
47
|
.infodrawer-body
|
|
40
48
|
overflow-y: hidden
|
|
41
49
|
min-height: 70px
|
|
42
50
|
|
|
51
|
+
|
|
43
52
|
.infodrawer-contents
|
|
44
53
|
padding: 0 1em 1em
|
|
45
54
|
|
package/src/main.module.sass
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
width: 100%
|
|
6
6
|
height: 100%
|
|
7
7
|
overflow: hidden
|
|
8
|
+
|
|
8
9
|
&.show-panel-outlines
|
|
9
10
|
.map-view-container
|
|
10
11
|
outline: 2px dotted dodgerblue
|
|
12
|
+
|
|
11
13
|
&.fit-viewport
|
|
12
14
|
height: 100vh
|
|
13
15
|
width: 100vw
|
|
@@ -17,21 +19,26 @@
|
|
|
17
19
|
// Compass display
|
|
18
20
|
.compass-control
|
|
19
21
|
display: none
|
|
22
|
+
|
|
20
23
|
&.map-is-rotated
|
|
21
24
|
.compass-control
|
|
22
25
|
display: block
|
|
23
26
|
|
|
24
27
|
.map-3d-control
|
|
25
28
|
display: none
|
|
29
|
+
|
|
26
30
|
&.map-3d-available .map-3d-control
|
|
27
31
|
display: block
|
|
32
|
+
|
|
28
33
|
&.map-is-rotated.map-3d-available .map-3d-control
|
|
29
34
|
display: none
|
|
30
35
|
|
|
31
36
|
.globe-control
|
|
32
37
|
display: none
|
|
38
|
+
|
|
33
39
|
svg
|
|
34
40
|
color: var(--secondary-color)
|
|
41
|
+
|
|
35
42
|
&.map-is-global .globe-control
|
|
36
43
|
display: block
|
|
37
44
|
|
|
@@ -42,14 +49,15 @@
|
|
|
42
49
|
|
|
43
50
|
&.detail-panel-fixed
|
|
44
51
|
.detail-panel-holder
|
|
45
|
-
|
|
52
|
+
& > *
|
|
46
53
|
border-radius: unset
|
|
47
54
|
|
|
48
55
|
.detail-panel-holder
|
|
49
56
|
display: flex
|
|
50
57
|
flex-direction: column
|
|
51
58
|
min-height: 0
|
|
52
|
-
|
|
59
|
+
|
|
60
|
+
& > *
|
|
53
61
|
flex: 1
|
|
54
62
|
|
|
55
63
|
.map-control-stack
|
|
@@ -87,28 +95,28 @@
|
|
|
87
95
|
bottom: 0
|
|
88
96
|
left: 0
|
|
89
97
|
right: 0
|
|
98
|
+
|
|
90
99
|
&:global(.mapboxgl-map)
|
|
91
100
|
// override the default mapbox position: relative in all cases
|
|
92
101
|
position: absolute
|
|
93
102
|
|
|
94
103
|
|
|
95
|
-
|
|
96
104
|
.panel-card
|
|
97
105
|
padding: 10px
|
|
98
106
|
background-color: var(--panel-background-color)
|
|
99
107
|
overflow: hidden
|
|
100
108
|
|
|
101
|
-
&
|
|
109
|
+
& > :last-child
|
|
102
110
|
margin-bottom: 0
|
|
103
111
|
|
|
104
112
|
:global(.bp5-dark) .panel-card
|
|
105
113
|
background-color: var(--panel-background-color)
|
|
106
114
|
|
|
107
115
|
.context-stack
|
|
108
|
-
|
|
116
|
+
& > div
|
|
109
117
|
flex-shrink: 1
|
|
110
118
|
|
|
111
|
-
|
|
119
|
+
& > .searchbar
|
|
112
120
|
flex: 0
|
|
113
121
|
|
|
114
122
|
.context-stack,
|
|
@@ -120,7 +128,7 @@
|
|
|
120
128
|
display: flex
|
|
121
129
|
flex-direction: column
|
|
122
130
|
|
|
123
|
-
|
|
131
|
+
& > div
|
|
124
132
|
pointer-events: all
|
|
125
133
|
|
|
126
134
|
.panel-title
|
|
@@ -236,8 +244,12 @@
|
|
|
236
244
|
.mapboxgl-ctrl-logo
|
|
237
245
|
transform: scale(0.9) translate(-8px, 2px)
|
|
238
246
|
|
|
239
|
-
.bp5-dark
|
|
240
|
-
|
|
247
|
+
.bp5-dark
|
|
248
|
+
.mapboxgl-ctrl-group
|
|
249
|
+
background-color: var(--panel-background-color)
|
|
250
|
+
|
|
251
|
+
.mapboxgl-ctrl-logo
|
|
252
|
+
filter: invert(100%)
|
|
241
253
|
|
|
242
254
|
.mapboxgl-ctrl-group button + button
|
|
243
255
|
border-top: 1px solid var(--panel-rule-color) !important
|
|
@@ -259,8 +271,6 @@
|
|
|
259
271
|
|
|
260
272
|
.detail-panel-container, .map-right-controls
|
|
261
273
|
flex: 1
|
|
262
|
-
|
|
263
|
-
|
|
264
274
|
|
|
265
275
|
|
|
266
276
|
.zoom-control
|
|
@@ -278,7 +288,7 @@
|
|
|
278
288
|
gap: 0.5em
|
|
279
289
|
|
|
280
290
|
:global(.map-control)
|
|
281
|
-
|
|
291
|
+
& > :global(.bp5-button)
|
|
282
292
|
padding: 0
|
|
283
293
|
transform: translate(-3.5px, -3.5px)
|
|
284
294
|
width: 22px !important
|
|
@@ -302,8 +312,8 @@
|
|
|
302
312
|
max-width: 22px
|
|
303
313
|
background-position: center center
|
|
304
314
|
padding: 0
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
//background-color: var(--panel-background-color)
|
|
316
|
+
//color: var(--text-color)
|
|
307
317
|
|
|
308
318
|
//.map-controls :global(.mapbox-control) button:hover,
|
|
309
319
|
//.map-controls :global(.map-control-wrapper) button:hover,
|
|
@@ -338,6 +348,7 @@
|
|
|
338
348
|
|
|
339
349
|
.infodrawer-stack
|
|
340
350
|
max-height: 70%
|
|
351
|
+
|
|
341
352
|
&:global(.exit-active)
|
|
342
353
|
max-height: 0
|
|
343
354
|
|
|
@@ -352,7 +363,7 @@
|
|
|
352
363
|
.detail-panel
|
|
353
364
|
border-radius: 0px
|
|
354
365
|
|
|
355
|
-
|
|
366
|
+
|
|
356
367
|
/* Desktop styling is necessarily much more complicated than mobile
|
|
357
368
|
to handle a two-column layout. */
|
|
358
369
|
@media screen and (min-width: 768px)
|
|
@@ -390,13 +401,14 @@
|
|
|
390
401
|
h1, h2, h3
|
|
391
402
|
margin: 0
|
|
392
403
|
|
|
393
|
-
|
|
404
|
+
& > .spacer
|
|
394
405
|
flex-grow: 0
|
|
395
406
|
|
|
396
407
|
.context-panel-holder
|
|
397
408
|
min-height: 0
|
|
398
409
|
position: relative
|
|
399
|
-
|
|
410
|
+
|
|
411
|
+
& > div
|
|
400
412
|
max-height: 100%
|
|
401
413
|
|
|
402
414
|
.detail-stack
|
|
@@ -408,7 +420,7 @@
|
|
|
408
420
|
pointer-events: none
|
|
409
421
|
z-index: 10
|
|
410
422
|
|
|
411
|
-
|
|
423
|
+
& > div
|
|
412
424
|
pointer-events: all
|
|
413
425
|
margin-bottom: 0.5em
|
|
414
426
|
|
|
@@ -433,15 +445,19 @@
|
|
|
433
445
|
.context-panel-holder
|
|
434
446
|
pointer-events: none
|
|
435
447
|
flex: 1
|
|
436
|
-
|
|
448
|
+
|
|
449
|
+
& > div
|
|
437
450
|
pointer-events: all
|
|
438
|
-
transition: opacity 0.8s ease
|
|
451
|
+
transition: opacity 0.8s ease
|
|
452
|
+
//, height 0.8s ease, max-height 0.8s ease, padding 0.8s ease
|
|
439
453
|
|
|
440
|
-
&.context-panel-from .context-panel-holder>div
|
|
454
|
+
&.context-panel-from .context-panel-holder > div
|
|
441
455
|
opacity: 0
|
|
442
|
-
|
|
456
|
+
|
|
457
|
+
&.context-panel-enter .context-panel-holder > div
|
|
443
458
|
opacity: 1
|
|
444
|
-
|
|
459
|
+
|
|
460
|
+
&.context-panel-leave .context-panel-holder > div
|
|
445
461
|
opacity: 0
|
|
446
462
|
|
|
447
463
|
// Detail panel (floating)
|
|
@@ -449,10 +465,13 @@
|
|
|
449
465
|
// We assume that the relevant panel is the first child of the stack.
|
|
450
466
|
&.detail-panel-from .detail-panel-holder
|
|
451
467
|
opacity: 0
|
|
468
|
+
|
|
452
469
|
&.detail-panel-enter .detail-panel-holder
|
|
453
470
|
opacity: 1
|
|
471
|
+
|
|
454
472
|
&.detail-panel-leave .detail-panel-holder
|
|
455
473
|
opacity: 0
|
|
474
|
+
|
|
456
475
|
.detail-panel
|
|
457
476
|
transition: opacity 0.8s ease, height 0.8s ease, max-height 0.8s ease
|
|
458
477
|
|
|
@@ -460,22 +479,25 @@
|
|
|
460
479
|
&.detail-panel-fixed
|
|
461
480
|
.map-ui
|
|
462
481
|
transition: margin-right 0.8s ease
|
|
482
|
+
|
|
463
483
|
.detail-stack
|
|
464
484
|
transition: margin-right 0.8s ease
|
|
465
485
|
|
|
466
486
|
&.detail-panel-from .detail-panel-holder
|
|
467
|
-
margin-right: calc(-1 * var(--map-detail-stack-width, 30em))
|
|
487
|
+
margin-right: calc(-1 * var(--map-detail-stack-width, 30em))
|
|
488
|
+
|
|
468
489
|
&.detail-panel-enter .detail-panel-holder
|
|
469
490
|
margin-right: 0
|
|
491
|
+
|
|
470
492
|
&.detail-panel-leave .detail-panel-holder
|
|
471
|
-
margin-right: calc(-1 * var(--map-detail-stack-width, 30em))
|
|
493
|
+
margin-right: calc(-1 * var(--map-detail-stack-width, 30em))
|
|
472
494
|
|
|
473
495
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
496
|
+
// The max-height transition is a bit jerky because of panel padding.
|
|
497
|
+
// We could probably fix this by pulling the panel container itself into
|
|
498
|
+
// the class.
|
|
499
|
+
//max-height: 0
|
|
500
|
+
//padding: 0i
|
|
479
501
|
|
|
480
502
|
@media only screen and (max-width: 768px)
|
|
481
503
|
.map-container .detail-stack
|
|
@@ -496,6 +518,7 @@
|
|
|
496
518
|
.context-stack
|
|
497
519
|
.context-panel-holder
|
|
498
520
|
flex: 0
|
|
521
|
+
|
|
499
522
|
.spacer
|
|
500
523
|
flex: 1
|
|
501
524
|
|