@macrostrat/map-interface 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/container.72611900.js +134 -0
- package/dist/cjs/container.72611900.js.map +1 -0
- package/dist/cjs/context-panel.8c4b009c.js +88 -0
- package/dist/cjs/context-panel.8c4b009c.js.map +1 -0
- package/dist/cjs/controls.7ce3e95c.js +79 -0
- package/dist/cjs/controls.7ce3e95c.js.map +1 -0
- package/dist/cjs/dev.7499151f.js +33 -0
- package/dist/cjs/dev.7499151f.js.map +1 -0
- package/dist/cjs/expansion-panel.08532cee.js +134 -0
- package/dist/cjs/expansion-panel.08532cee.js.map +1 -0
- package/dist/cjs/hash-string.62e84f08.js +67 -0
- package/dist/cjs/hash-string.62e84f08.js.map +1 -0
- package/dist/cjs/header.58c5c012.js +104 -0
- package/dist/cjs/header.58c5c012.js.map +1 -0
- package/dist/cjs/headers.20eae5f7.js +29 -0
- package/dist/cjs/headers.20eae5f7.js.map +1 -0
- package/dist/cjs/helpers.0f72ddaf.js +190 -0
- package/dist/cjs/helpers.0f72ddaf.js.map +1 -0
- package/dist/cjs/index.js +51 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/location-info.92e70042.js +119 -0
- package/dist/cjs/location-info.92e70042.js.map +1 -0
- package/dist/cjs/location-panel.c95f5e96.js +66 -0
- package/dist/cjs/location-panel.c95f5e96.js.map +1 -0
- package/dist/cjs/main.module.02c4de16.css +86 -0
- package/dist/cjs/main.module.02c4de16.css.map +1 -0
- package/dist/cjs/main.module.3f2b7c9f.js +38 -0
- package/dist/cjs/main.module.3f2b7c9f.js.map +1 -0
- package/dist/cjs/main.module.4ecbaaa5.js +62 -0
- package/dist/cjs/main.module.4ecbaaa5.js.map +1 -0
- package/dist/cjs/main.module.62939ea7.js +167 -0
- package/dist/cjs/main.module.62939ea7.js.map +1 -0
- package/dist/cjs/main.module.92978d8b.css +52 -0
- package/dist/cjs/main.module.92978d8b.css.map +1 -0
- package/dist/cjs/main.module.becc2fe7.css +92 -0
- package/dist/cjs/main.module.becc2fe7.css.map +1 -0
- package/dist/cjs/main.module.ccec47df.js +50 -0
- package/dist/cjs/main.module.ccec47df.js.map +1 -0
- package/dist/cjs/main.module.e958948e.js +26 -0
- package/dist/cjs/main.module.e958948e.js.map +1 -0
- package/dist/{index.css → cjs/main.module.f085a193.css} +9 -397
- package/dist/cjs/main.module.f085a193.css.map +1 -0
- package/dist/cjs/main.module.ff1b1aca.css +179 -0
- package/dist/cjs/main.module.ff1b1aca.css.map +1 -0
- package/dist/cjs/map-page.190b6723.js +182 -0
- package/dist/cjs/map-page.190b6723.js.map +1 -0
- package/dist/cjs/map-view.93363b41.js +167 -0
- package/dist/cjs/map-view.93363b41.js.map +1 -0
- package/dist/cjs/terrain.90f76b4e.js +59 -0
- package/dist/cjs/terrain.90f76b4e.js.map +1 -0
- package/dist/cjs/tile-extent.06a4b2ed.js +51 -0
- package/dist/cjs/tile-extent.06a4b2ed.js.map +1 -0
- package/dist/cjs/utils.09cef979.js +36 -0
- package/dist/cjs/utils.09cef979.js.map +1 -0
- package/dist/cjs/utils.26f02633.js +46 -0
- package/dist/cjs/utils.26f02633.js.map +1 -0
- package/dist/cjs/vector-tile-features.456f887b.js +268 -0
- package/dist/cjs/vector-tile-features.456f887b.js.map +1 -0
- package/dist/cjs/xray.a23f8660.js +89 -0
- package/dist/cjs/xray.a23f8660.js.map +1 -0
- package/dist/esm/container.16bde261.js +126 -0
- package/dist/esm/container.16bde261.js.map +1 -0
- package/dist/esm/context-panel.c288c5cd.js +81 -0
- package/dist/esm/context-panel.c288c5cd.js.map +1 -0
- package/dist/esm/controls.f757ce16.js +74 -0
- package/dist/esm/controls.f757ce16.js.map +1 -0
- package/dist/esm/dev.ccb6e774.js +13 -0
- package/dist/esm/dev.ccb6e774.js.map +1 -0
- package/dist/esm/expansion-panel.feff0e62.js +123 -0
- package/dist/esm/expansion-panel.feff0e62.js.map +1 -0
- package/dist/esm/hash-string.836601b2.js +61 -0
- package/dist/esm/hash-string.836601b2.js.map +1 -0
- package/dist/esm/header.0f535ab1.js +99 -0
- package/dist/esm/header.0f535ab1.js.map +1 -0
- package/dist/esm/headers.b25ff414.js +24 -0
- package/dist/esm/headers.b25ff414.js.map +1 -0
- package/dist/esm/helpers.fb1d7227.js +176 -0
- package/dist/esm/helpers.fb1d7227.js.map +1 -0
- package/dist/{types.d.ts → esm/index.d.ts} +102 -51
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/location-info.5543bb05.js +89 -0
- package/dist/esm/location-info.5543bb05.js.map +1 -0
- package/dist/esm/location-panel.0b1f4ed2.js +58 -0
- package/dist/esm/location-panel.0b1f4ed2.js.map +1 -0
- package/dist/esm/main.module.5eb366de.js +52 -0
- package/dist/esm/main.module.5eb366de.js.map +1 -0
- package/dist/esm/main.module.67a908da.js +40 -0
- package/dist/esm/main.module.67a908da.js.map +1 -0
- package/dist/esm/main.module.89579666.js +64 -0
- package/dist/esm/main.module.89579666.js.map +1 -0
- package/dist/esm/main.module.9c57cc95.js +28 -0
- package/dist/esm/main.module.9c57cc95.js.map +1 -0
- package/dist/esm/main.module.f70e002b.js +169 -0
- package/dist/esm/main.module.f70e002b.js.map +1 -0
- package/dist/esm/map-page.b953c404.js +175 -0
- package/dist/esm/map-page.b953c404.js.map +1 -0
- package/dist/esm/map-view.a3fe6257.js +161 -0
- package/dist/esm/map-view.a3fe6257.js.map +1 -0
- package/dist/esm/terrain.f65cf7c5.js +54 -0
- package/dist/esm/terrain.f65cf7c5.js.map +1 -0
- package/dist/esm/tile-extent.ca526996.js +46 -0
- package/dist/esm/tile-extent.ca526996.js.map +1 -0
- package/dist/esm/utils.122d1f2d.js +28 -0
- package/dist/esm/utils.122d1f2d.js.map +1 -0
- package/dist/esm/utils.d40349f0.js +40 -0
- package/dist/esm/utils.d40349f0.js.map +1 -0
- package/dist/esm/vector-tile-features.e1a24df0.js +258 -0
- package/dist/esm/vector-tile-features.e1a24df0.js.map +1 -0
- package/dist/esm/xray.c0663c25.js +83 -0
- package/dist/esm/xray.c0663c25.js.map +1 -0
- package/dist/node/container.abd6f0d2.js +2 -0
- package/dist/node/container.abd6f0d2.js.map +1 -0
- package/dist/node/context-panel.7c2f42c9.js +2 -0
- package/dist/node/context-panel.7c2f42c9.js.map +1 -0
- package/dist/node/controls.ffb44307.js +2 -0
- package/dist/node/controls.ffb44307.js.map +1 -0
- package/dist/node/dev.15b4cdb0.js +2 -0
- package/dist/node/dev.15b4cdb0.js.map +1 -0
- package/dist/node/expansion-panel.1553938f.js +2 -0
- package/dist/node/expansion-panel.1553938f.js.map +1 -0
- package/dist/node/hash-string.3fc8ceb0.js +2 -0
- package/dist/node/hash-string.3fc8ceb0.js.map +1 -0
- package/dist/node/header.5f15d599.js +2 -0
- package/dist/node/header.5f15d599.js.map +1 -0
- package/dist/node/headers.0d494ac2.js +2 -0
- package/dist/node/headers.0d494ac2.js.map +1 -0
- package/dist/node/helpers.6bda171f.js +2 -0
- package/dist/node/helpers.6bda171f.js.map +1 -0
- package/dist/node/index.js +2 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/location-info.9f59aad3.js +2 -0
- package/dist/node/location-info.9f59aad3.js.map +1 -0
- package/dist/node/location-panel.d22d21fa.js +2 -0
- package/dist/node/location-panel.d22d21fa.js.map +1 -0
- package/dist/node/main.module.24615279.js +2 -0
- package/dist/node/main.module.24615279.js.map +1 -0
- package/dist/node/main.module.29a15f3d.css +2 -0
- package/dist/node/main.module.29a15f3d.css.map +1 -0
- package/dist/node/main.module.2cc98713.css +2 -0
- package/dist/node/main.module.2cc98713.css.map +1 -0
- package/dist/node/main.module.434acaf9.js +2 -0
- package/dist/node/main.module.434acaf9.js.map +1 -0
- package/dist/node/main.module.61b261c8.css +2 -0
- package/dist/node/main.module.61b261c8.css.map +1 -0
- package/dist/node/main.module.78d7f40f.js +2 -0
- package/dist/node/main.module.78d7f40f.js.map +1 -0
- package/dist/node/main.module.89f269c7.css +2 -0
- package/dist/node/main.module.89f269c7.css.map +1 -0
- package/dist/node/main.module.d4e98e60.js +2 -0
- package/dist/node/main.module.d4e98e60.js.map +1 -0
- package/dist/node/main.module.e200d631.js +2 -0
- package/dist/node/main.module.e200d631.js.map +1 -0
- package/dist/node/main.module.f0530add.css +2 -0
- package/dist/node/main.module.f0530add.css.map +1 -0
- package/dist/node/map-page.0b19d49e.js +2 -0
- package/dist/node/map-page.0b19d49e.js.map +1 -0
- package/dist/node/map-view.c6746dca.js +2 -0
- package/dist/node/map-view.c6746dca.js.map +1 -0
- package/dist/node/terrain.96ae432a.js +2 -0
- package/dist/node/terrain.96ae432a.js.map +1 -0
- package/dist/node/tile-extent.28db5d2c.js +2 -0
- package/dist/node/tile-extent.28db5d2c.js.map +1 -0
- package/dist/node/utils.274d0452.js +2 -0
- package/dist/node/utils.274d0452.js.map +1 -0
- package/dist/node/utils.dd92f725.js +2 -0
- package/dist/node/utils.dd92f725.js.map +1 -0
- package/dist/node/vector-tile-features.c02e240c.js +2 -0
- package/dist/node/vector-tile-features.c02e240c.js.map +1 -0
- package/dist/node/xray.bce11e7b.js +2 -0
- package/dist/node/xray.bce11e7b.js.map +1 -0
- package/package.json +28 -36
- package/src/container.ts +29 -21
- package/src/context-panel/index.ts +4 -4
- package/src/context-panel/main.module.sass +1 -1
- package/src/dev/main.module.sass +16 -0
- package/src/dev/map-page.ts +19 -4
- package/src/dev/vector-tile-features.ts +44 -13
- package/src/location-panel/header.ts +27 -8
- package/src/location-panel/index.ts +4 -2
- package/src/location-panel/main.module.sass +7 -0
- package/src/main.module.sass +4 -1
- package/src/map-view/index.ts +1 -1
- package/dist/index.cjs.css +0 -961
- package/dist/index.cjs.css.map +0 -1
- package/dist/index.cjs.js +0 -1954
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -1945
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import $44I7C$mainmodulef70e002bjs from "./main.module.f70e002b.js";
|
|
2
|
+
import "../cjs/main.module.f085a193.css";
|
|
3
|
+
import {enable3DTerrain as $286fbb15f2139dc1$export$b730542ee281c4b1} from "./terrain.f65cf7c5.js";
|
|
4
|
+
import {MapLoadingReporter as $4bc3dd5f0732eed3$export$e57f9eaa51773f82, MapMovedReporter as $4bc3dd5f0732eed3$export$f6eeee399afc4e9a, MapResizeManager as $4bc3dd5f0732eed3$export$31b2e088aff2dc5d, MapPaddingManager as $4bc3dd5f0732eed3$export$2ab96428dea558d6} from "./helpers.fb1d7227.js";
|
|
5
|
+
import {getMapPadding as $82fe09613877ffc2$export$bb78f9f01775eef1} from "./utils.d40349f0.js";
|
|
6
|
+
import $44I7C$macrostrathyper from "@macrostrat/hyper";
|
|
7
|
+
import {useMapDispatch as $44I7C$useMapDispatch, useMapRef as $44I7C$useMapRef, useMapPosition as $44I7C$useMapPosition} from "@macrostrat/mapbox-react";
|
|
8
|
+
import {setMapPosition as $44I7C$setMapPosition, mapViewInfo as $44I7C$mapViewInfo} from "@macrostrat/mapbox-utils";
|
|
9
|
+
import $44I7C$classnames from "classnames";
|
|
10
|
+
import $44I7C$mapboxgl from "mapbox-gl";
|
|
11
|
+
import {useRef as $44I7C$useRef, useEffect as $44I7C$useEffect} from "react";
|
|
12
|
+
import "mapbox-gl/dist/mapbox-gl.css";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
function $parcel$interopDefault(a) {
|
|
16
|
+
return a && a.__esModule ? a.default : a;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const $9e150e311a3261e9$var$h = (0, $44I7C$macrostrathyper).styled((0, ($parcel$interopDefault($44I7C$mainmodulef70e002bjs))));
|
|
30
|
+
function $9e150e311a3261e9$var$defaultInitializeMap(container, args = {}) {
|
|
31
|
+
const { mapPosition: mapPosition, ...rest } = args;
|
|
32
|
+
console.log("Initializing map (default)", args);
|
|
33
|
+
const map = new (0, $44I7C$mapboxgl).Map({
|
|
34
|
+
container: container,
|
|
35
|
+
maxZoom: 18,
|
|
36
|
+
//maxTileCacheSize: 0,
|
|
37
|
+
logoPosition: "bottom-left",
|
|
38
|
+
trackResize: true,
|
|
39
|
+
antialias: true,
|
|
40
|
+
optimizeForTerrain: true,
|
|
41
|
+
...rest
|
|
42
|
+
});
|
|
43
|
+
// set initial map position
|
|
44
|
+
if (mapPosition != null) (0, $44I7C$setMapPosition)(map, mapPosition);
|
|
45
|
+
//setMapPosition(map, mapPosition);
|
|
46
|
+
return map;
|
|
47
|
+
}
|
|
48
|
+
const $9e150e311a3261e9$var$defaultMapPosition = {
|
|
49
|
+
camera: {
|
|
50
|
+
lat: 34,
|
|
51
|
+
lng: -120,
|
|
52
|
+
altitude: 300000
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function $9e150e311a3261e9$export$ab1e7a67d6ec5ad8(props) {
|
|
56
|
+
let { terrainSourceID: terrainSourceID } = props;
|
|
57
|
+
const { enableTerrain: enableTerrain = true, style: style, mapPosition: mapPosition = $9e150e311a3261e9$var$defaultMapPosition, initializeMap: initializeMap = $9e150e311a3261e9$var$defaultInitializeMap, children: children, mapboxToken: mapboxToken, accessToken: // Deprecated
|
|
58
|
+
accessToken, infoMarkerPosition: infoMarkerPosition, transformRequest: transformRequest, projection: projection, onMapLoaded: onMapLoaded = null, onStyleLoaded: onStyleLoaded = null, onMapMoved: onMapMoved = null, ...rest } = props;
|
|
59
|
+
if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
|
|
60
|
+
const _mapboxToken = mapboxToken ?? accessToken;
|
|
61
|
+
if (_mapboxToken != null) (0, $44I7C$mapboxgl).accessToken = _mapboxToken;
|
|
62
|
+
const dispatch = (0, $44I7C$useMapDispatch)();
|
|
63
|
+
let mapRef = (0, $44I7C$useMapRef)();
|
|
64
|
+
const ref = (0, $44I7C$useRef)();
|
|
65
|
+
const parentRef = (0, $44I7C$useRef)();
|
|
66
|
+
(0, $44I7C$useEffect)(()=>{
|
|
67
|
+
if (style == null) return;
|
|
68
|
+
let map = mapRef.current;
|
|
69
|
+
if (map != null) {
|
|
70
|
+
console.log("Setting style", style);
|
|
71
|
+
map.setStyle(style);
|
|
72
|
+
} else {
|
|
73
|
+
console.log("Initializing map", style);
|
|
74
|
+
const map = initializeMap(ref.current, {
|
|
75
|
+
style: style,
|
|
76
|
+
projection: projection,
|
|
77
|
+
mapPosition: mapPosition,
|
|
78
|
+
transformRequest: transformRequest,
|
|
79
|
+
...rest
|
|
80
|
+
});
|
|
81
|
+
dispatch({
|
|
82
|
+
type: "set-map",
|
|
83
|
+
payload: map
|
|
84
|
+
});
|
|
85
|
+
map.setPadding((0, $82fe09613877ffc2$export$bb78f9f01775eef1)(ref, parentRef), {
|
|
86
|
+
animate: false
|
|
87
|
+
});
|
|
88
|
+
onMapLoaded?.(map);
|
|
89
|
+
}
|
|
90
|
+
const loadCallback = ()=>{
|
|
91
|
+
onStyleLoaded?.(map);
|
|
92
|
+
dispatch({
|
|
93
|
+
type: "set-style-loaded",
|
|
94
|
+
payload: true
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
map = mapRef.current;
|
|
98
|
+
if (map.isStyleLoaded()) // Catch a race condition where the style is loaded before the callback is set
|
|
99
|
+
loadCallback();
|
|
100
|
+
map.on("style.load", loadCallback);
|
|
101
|
+
return ()=>{
|
|
102
|
+
map.off("style.load", loadCallback);
|
|
103
|
+
};
|
|
104
|
+
}, [
|
|
105
|
+
style
|
|
106
|
+
]);
|
|
107
|
+
const _computedMapPosition = (0, $44I7C$useMapPosition)();
|
|
108
|
+
const { mapUse3D: mapUse3D, mapIsRotated: mapIsRotated } = (0, $44I7C$mapViewInfo)(_computedMapPosition);
|
|
109
|
+
// Get map projection
|
|
110
|
+
const _projection = mapRef.current?.getProjection()?.name ?? "mercator";
|
|
111
|
+
const className = (0, $44I7C$classnames)({
|
|
112
|
+
"is-rotated": mapIsRotated ?? false,
|
|
113
|
+
"is-3d-available": mapUse3D ?? false
|
|
114
|
+
}, `${_projection}-projection`);
|
|
115
|
+
return $9e150e311a3261e9$var$h("div.map-view-container.main-view", {
|
|
116
|
+
ref: parentRef
|
|
117
|
+
}, [
|
|
118
|
+
$9e150e311a3261e9$var$h("div.mapbox-map#map", {
|
|
119
|
+
ref: ref,
|
|
120
|
+
className: className
|
|
121
|
+
}),
|
|
122
|
+
$9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$e57f9eaa51773f82), {
|
|
123
|
+
ignoredSources: [
|
|
124
|
+
"elevationMarker",
|
|
125
|
+
"crossSectionEndpoints"
|
|
126
|
+
]
|
|
127
|
+
}),
|
|
128
|
+
$9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$f6eeee399afc4e9a), {
|
|
129
|
+
onMapMoved: onMapMoved
|
|
130
|
+
}),
|
|
131
|
+
$9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$31b2e088aff2dc5d), {
|
|
132
|
+
containerRef: ref
|
|
133
|
+
}),
|
|
134
|
+
$9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$2ab96428dea558d6), {
|
|
135
|
+
containerRef: ref,
|
|
136
|
+
parentRef: parentRef,
|
|
137
|
+
infoMarkerPosition: infoMarkerPosition
|
|
138
|
+
}),
|
|
139
|
+
$9e150e311a3261e9$var$h($9e150e311a3261e9$export$cee395a8a2a00b29, {
|
|
140
|
+
mapUse3D: mapUse3D,
|
|
141
|
+
terrainSourceID: terrainSourceID
|
|
142
|
+
}),
|
|
143
|
+
children
|
|
144
|
+
]);
|
|
145
|
+
}
|
|
146
|
+
function $9e150e311a3261e9$export$cee395a8a2a00b29({ mapUse3D: mapUse3D, terrainSourceID: terrainSourceID }) {
|
|
147
|
+
const mapRef = (0, $44I7C$useMapRef)();
|
|
148
|
+
(0, $44I7C$useEffect)(()=>{
|
|
149
|
+
const map = mapRef.current;
|
|
150
|
+
if (map == null) return;
|
|
151
|
+
(0, $286fbb15f2139dc1$export$b730542ee281c4b1)(map, mapUse3D, terrainSourceID);
|
|
152
|
+
}, [
|
|
153
|
+
mapRef.current,
|
|
154
|
+
mapUse3D
|
|
155
|
+
]);
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
export {$9e150e311a3261e9$export$ab1e7a67d6ec5ad8 as MapView, $9e150e311a3261e9$export$cee395a8a2a00b29 as MapTerrainManager};
|
|
161
|
+
//# sourceMappingURL=map-view.a3fe6257.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"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","sources":["packages/map-interface/src/map-view/index.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport {\n useMapRef,\n useMapDispatch,\n useMapPosition,\n} from \"@macrostrat/mapbox-react\";\nimport {\n mapViewInfo,\n MapPosition,\n setMapPosition,\n} from \"@macrostrat/mapbox-utils\";\nimport classNames from \"classnames\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useEffect, useRef, useCallback } from \"react\";\nimport styles from \"../main.module.sass\";\nimport { enable3DTerrain } from \"./terrain\";\nimport {\n MapLoadingReporter,\n MapMovedReporter,\n MapPaddingManager,\n MapResizeManager,\n} from \"../helpers\";\nimport \"mapbox-gl/dist/mapbox-gl.css\";\nimport { getMapPadding } from \"../utils\";\n\nconst h = hyper.styled(styles);\n\ntype MapboxCoreOptions = Omit<mapboxgl.MapboxOptions, \"container\">;\n\nexport interface MapViewProps extends MapboxCoreOptions {\n showLineSymbols?: boolean;\n children?: React.ReactNode;\n mapboxToken?: string;\n // Deprecated\n accessToken?: string;\n terrainSourceID?: string;\n enableTerrain?: boolean;\n infoMarkerPosition?: mapboxgl.LngLatLike;\n mapPosition?: MapPosition;\n initializeMap?: (\n container: HTMLElement,\n args: MapboxOptionsExt\n ) => mapboxgl.Map;\n onMapLoaded?: (map: mapboxgl.Map) => void;\n onStyleLoaded?: (map: mapboxgl.Map) => void;\n onMapMoved?: (mapPosition: MapPosition, map: mapboxgl.Map) => void;\n}\n\nexport interface MapboxOptionsExt extends MapboxCoreOptions {\n mapPosition?: MapPosition;\n}\n\nfunction defaultInitializeMap(container, args: MapboxOptionsExt = {}) {\n const { mapPosition, ...rest } = args;\n console.log(\"Initializing map (default)\", args);\n\n const map = new mapboxgl.Map({\n container,\n maxZoom: 18,\n //maxTileCacheSize: 0,\n logoPosition: \"bottom-left\",\n trackResize: true,\n antialias: true,\n optimizeForTerrain: true,\n ...rest,\n });\n\n // set initial map position\n if (mapPosition != null) {\n setMapPosition(map, mapPosition);\n }\n\n //setMapPosition(map, mapPosition);\n return map;\n}\n\nconst defaultMapPosition: MapPosition = {\n camera: {\n lat: 34,\n lng: -120,\n altitude: 300000,\n },\n};\n\nexport function MapView(props: MapViewProps) {\n let { terrainSourceID } = props;\n const {\n enableTerrain = true,\n style,\n mapPosition = defaultMapPosition,\n initializeMap = defaultInitializeMap,\n children,\n mapboxToken,\n // Deprecated\n accessToken,\n infoMarkerPosition,\n transformRequest,\n projection,\n onMapLoaded = null,\n onStyleLoaded = null,\n onMapMoved = null,\n ...rest\n } = props;\n if (enableTerrain) {\n terrainSourceID ??= \"mapbox-3d-dem\";\n }\n\n const _mapboxToken = mapboxToken ?? accessToken;\n\n if (_mapboxToken != null) {\n mapboxgl.accessToken = _mapboxToken;\n }\n\n const dispatch = useMapDispatch();\n let mapRef = useMapRef();\n const ref = useRef<HTMLDivElement>();\n const parentRef = useRef<HTMLDivElement>();\n\n useEffect(() => {\n if (style == null) return;\n let map = mapRef.current;\n if (map != null) {\n console.log(\"Setting style\", style);\n map.setStyle(style);\n } else {\n console.log(\"Initializing map\", style);\n const map = initializeMap(ref.current, {\n style,\n projection,\n mapPosition,\n transformRequest,\n ...rest,\n });\n dispatch({ type: \"set-map\", payload: map });\n map.setPadding(getMapPadding(ref, parentRef), { animate: false });\n onMapLoaded?.(map);\n }\n\n const loadCallback = () => {\n onStyleLoaded?.(map);\n dispatch({ type: \"set-style-loaded\", payload: true });\n };\n\n map = mapRef.current;\n if (map.isStyleLoaded()) {\n // Catch a race condition where the style is loaded before the callback is set\n loadCallback();\n }\n map.on(\"style.load\", loadCallback);\n return () => {\n map.off(\"style.load\", loadCallback);\n };\n }, [style]);\n\n const _computedMapPosition = useMapPosition();\n const { mapUse3D, mapIsRotated } = mapViewInfo(_computedMapPosition);\n\n // Get map projection\n const _projection = mapRef.current?.getProjection()?.name ?? \"mercator\";\n\n const className = classNames(\n {\n \"is-rotated\": mapIsRotated ?? false,\n \"is-3d-available\": mapUse3D ?? false,\n },\n `${_projection}-projection`\n );\n\n return h(\"div.map-view-container.main-view\", { ref: parentRef }, [\n h(\"div.mapbox-map#map\", { ref, className }),\n h(MapLoadingReporter, {\n ignoredSources: [\"elevationMarker\", \"crossSectionEndpoints\"],\n }),\n h(MapMovedReporter, { onMapMoved }),\n h(MapResizeManager, { containerRef: ref }),\n h(MapPaddingManager, { containerRef: ref, parentRef, infoMarkerPosition }),\n h(MapTerrainManager, { mapUse3D, terrainSourceID }),\n children,\n ]);\n}\n\nexport function MapTerrainManager({\n mapUse3D,\n terrainSourceID,\n}: {\n mapUse3D?: boolean;\n terrainSourceID?: string;\n}) {\n const mapRef = useMapRef();\n\n useEffect(() => {\n const map = mapRef.current;\n if (map == null) return;\n enable3DTerrain(map, mapUse3D, terrainSourceID);\n }, [mapRef.current, mapUse3D]);\n return null;\n}\n"],"names":[],"version":3,"file":"map-view.a3fe6257.js.map"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// We should merge this with code in @macrostrat/mapbox-react/src/terrain.ts:
|
|
2
|
+
function $286fbb15f2139dc1$export$b730542ee281c4b1(map, shouldEnable, sourceID = null) {
|
|
3
|
+
if (!map.style?._loaded) {
|
|
4
|
+
map.once("style.load", ()=>{
|
|
5
|
+
$286fbb15f2139dc1$export$b730542ee281c4b1(map, shouldEnable, sourceID);
|
|
6
|
+
});
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const currentTerrainSource = $286fbb15f2139dc1$var$getTerrainSourceID(map);
|
|
10
|
+
let demSourceID = sourceID ?? currentTerrainSource ?? "mapbox-dem";
|
|
11
|
+
console.log("Enabling 3D terrain with source", demSourceID);
|
|
12
|
+
// Enable or disable terrain depending on our current desires...
|
|
13
|
+
const currentTerrain = map.getTerrain();
|
|
14
|
+
if (!shouldEnable) {
|
|
15
|
+
if (currentTerrain != null) map.setTerrain(null);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (currentTerrain != null) return;
|
|
19
|
+
// Add a DEM source if one is not found already.
|
|
20
|
+
if (map.getSource(demSourceID) == null) map.addSource(demSourceID, {
|
|
21
|
+
type: "raster-dem",
|
|
22
|
+
url: "mapbox://mapbox.mapbox-terrain-dem-v1",
|
|
23
|
+
tileSize: 512,
|
|
24
|
+
maxzoom: 14
|
|
25
|
+
});
|
|
26
|
+
// add a sky layer that will show when the map is highly pitched
|
|
27
|
+
if (map.getLayer("sky") == null) map.addLayer({
|
|
28
|
+
id: "sky",
|
|
29
|
+
type: "sky",
|
|
30
|
+
paint: {
|
|
31
|
+
"sky-type": "atmosphere",
|
|
32
|
+
"sky-atmosphere-sun": [
|
|
33
|
+
0.0,
|
|
34
|
+
0.0
|
|
35
|
+
],
|
|
36
|
+
"sky-atmosphere-sun-intensity": 15
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
map.setTerrain({
|
|
40
|
+
source: demSourceID,
|
|
41
|
+
exaggeration: 1
|
|
42
|
+
});
|
|
43
|
+
console.log(map.getTerrain());
|
|
44
|
+
}
|
|
45
|
+
function $286fbb15f2139dc1$var$getTerrainSourceID(map) {
|
|
46
|
+
for (const [key, source] of Object.entries(map.getStyle().sources)){
|
|
47
|
+
if (source.type == "raster-dem") return key;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export {$286fbb15f2139dc1$export$b730542ee281c4b1 as enable3DTerrain};
|
|
54
|
+
//# sourceMappingURL=terrain.f65cf7c5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA,6EAA6E;AAEtE,SAAS,0CACd,GAAG,EACH,YAAqB,EACrB,WAA0B,IAAI;IAE9B,IAAI,CAAC,IAAI,KAAK,EAAE,SAAS;QACvB,IAAI,IAAI,CAAC,cAAc;YACrB,0CAAgB,KAAK,cAAc;QACrC;QACA;IACF;IAEA,MAAM,uBAAuB,yCAAmB;IAChD,IAAI,cAAc,YAAY,wBAAwB;IAEtD,QAAQ,GAAG,CAAC,mCAAmC;IAE/C,gEAAgE;IAChE,MAAM,iBAAiB,IAAI,UAAU;IAErC,IAAI,CAAC,cAAc;QACjB,IAAI,kBAAkB,MAAM,IAAI,UAAU,CAAC;QAC3C;IACF;IACA,IAAI,kBAAkB,MAAM;IAE5B,gDAAgD;IAChD,IAAI,IAAI,SAAS,CAAC,gBAAgB,MAChC,IAAI,SAAS,CAAC,aAAa;QACzB,MAAM;QACN,KAAK;QACL,UAAU;QACV,SAAS;IACX;IAGF,gEAAgE;IAChE,IAAI,IAAI,QAAQ,CAAC,UAAU,MACzB,IAAI,QAAQ,CAAC;QACX,IAAI;QACJ,MAAM;QACN,OAAO;YACL,YAAY;YACZ,sBAAsB;gBAAC;gBAAK;aAAI;YAChC,gCAAgC;QAClC;IACF;IAGF,IAAI,UAAU,CAAC;QAAE,QAAQ;QAAa,cAAc;IAAE;IACtD,QAAQ,GAAG,CAAC,IAAI,UAAU;AAC5B;AAEA,SAAS,yCAAmB,GAAG;IAC7B,KAAK,MAAM,CAAC,KAAK,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,QAAQ,GAAG,OAAO,EAAG;QAClE,IAAI,OAAO,IAAI,IAAI,cACjB,OAAO;IAEX;IACA,OAAO;AACT","sources":["packages/map-interface/src/map-view/terrain.ts"],"sourcesContent":["// We should merge this with code in @macrostrat/mapbox-react/src/terrain.ts:\n\nexport function enable3DTerrain(\n map,\n shouldEnable: boolean,\n sourceID: string | null = null\n) {\n if (!map.style?._loaded) {\n map.once(\"style.load\", () => {\n enable3DTerrain(map, shouldEnable, sourceID);\n });\n return;\n }\n\n const currentTerrainSource = getTerrainSourceID(map);\n let demSourceID = sourceID ?? currentTerrainSource ?? \"mapbox-dem\";\n\n console.log(\"Enabling 3D terrain with source\", demSourceID);\n\n // Enable or disable terrain depending on our current desires...\n const currentTerrain = map.getTerrain();\n\n if (!shouldEnable) {\n if (currentTerrain != null) map.setTerrain(null);\n return;\n }\n if (currentTerrain != null) return;\n\n // Add a DEM source if one is not found already.\n if (map.getSource(demSourceID) == null) {\n map.addSource(demSourceID, {\n type: \"raster-dem\",\n url: \"mapbox://mapbox.mapbox-terrain-dem-v1\",\n tileSize: 512,\n maxzoom: 14,\n });\n }\n\n // add a sky layer that will show when the map is highly pitched\n if (map.getLayer(\"sky\") == null) {\n map.addLayer({\n id: \"sky\",\n type: \"sky\",\n paint: {\n \"sky-type\": \"atmosphere\",\n \"sky-atmosphere-sun\": [0.0, 0.0],\n \"sky-atmosphere-sun-intensity\": 15,\n },\n });\n }\n\n map.setTerrain({ source: demSourceID, exaggeration: 1 });\n console.log(map.getTerrain());\n}\n\nfunction getTerrainSourceID(map) {\n for (const [key, source] of Object.entries(map.getStyle().sources)) {\n if (source.type == \"raster-dem\") {\n return key;\n }\n }\n return null;\n}\n"],"names":[],"version":3,"file":"terrain.f65cf7c5.js.map"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {useMapRef as $edFMK$useMapRef, useMapConditionalStyle as $edFMK$useMapConditionalStyle} from "@macrostrat/mapbox-react";
|
|
2
|
+
import {tileToGeoJSON as $edFMK$tileToGeoJSON} from "@mapbox/tilebelt";
|
|
3
|
+
import {useCallback as $edFMK$useCallback} from "react";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function $1d4d29ef2725aa16$export$86c09739b12f23cd({ tile: tile, color: color = "red" }) {
|
|
9
|
+
const styleCallback = (0, $edFMK$useCallback)((map, val)=>{
|
|
10
|
+
const style = map.getStyle();
|
|
11
|
+
if (style.layers == null) return;
|
|
12
|
+
style.layers = style.layers.filter((l)=>l.id != "tile-extent");
|
|
13
|
+
if (val == null) return map.setStyle(style);
|
|
14
|
+
const { x: x, y: y, z: z } = val;
|
|
15
|
+
const extent = (0, $edFMK$tileToGeoJSON)([
|
|
16
|
+
x,
|
|
17
|
+
y,
|
|
18
|
+
z
|
|
19
|
+
]);
|
|
20
|
+
const source = {
|
|
21
|
+
type: "geojson",
|
|
22
|
+
data: extent
|
|
23
|
+
};
|
|
24
|
+
const layer = {
|
|
25
|
+
id: "tile-extent",
|
|
26
|
+
type: "line",
|
|
27
|
+
source: "tile-extent",
|
|
28
|
+
paint: {
|
|
29
|
+
"line-color": color,
|
|
30
|
+
"line-width": 2
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
style.sources["tile-extent"] = source;
|
|
34
|
+
style.layers.push(layer);
|
|
35
|
+
map.setStyle(style);
|
|
36
|
+
}, [
|
|
37
|
+
color
|
|
38
|
+
]);
|
|
39
|
+
const map = (0, $edFMK$useMapRef)();
|
|
40
|
+
(0, $edFMK$useMapConditionalStyle)(map, tile, styleCallback);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {$1d4d29ef2725aa16$export$86c09739b12f23cd as TileExtentLayer};
|
|
46
|
+
//# sourceMappingURL=tile-extent.ca526996.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;AAMO,SAAS,0CAAgB,QAC9B,IAAI,SACJ,QAAQ,OAIT;IACC,MAAM,gBAAgB,CAAA,GAAA,kBAAU,EAC9B,CAAC,KAAK;QACJ,MAAM,QAAQ,IAAI,QAAQ;QAC1B,IAAI,MAAM,MAAM,IAAI,MAAM;QAC1B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,IAAM,EAAE,EAAE,IAAI;QAClD,IAAI,OAAO,MACT,OAAO,IAAI,QAAQ,CAAC;QAEtB,MAAM,KAAE,CAAC,KAAE,CAAC,KAAE,CAAC,EAAE,GAAG;QACpB,MAAM,SAAS,CAAA,GAAA,oBAAY,EAAE;YAAC;YAAG;YAAG;SAAE;QACtC,MAAM,SAAS;YACb,MAAM;YACN,MAAM;QACR;QACA,MAAM,QAAQ;YACZ,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO;gBACL,cAAc;gBACd,cAAc;YAChB;QACF;QACA,MAAM,OAAO,CAAC,cAAc,GAAG;QAC/B,MAAM,MAAM,CAAC,IAAI,CAAC;QAClB,IAAI,QAAQ,CAAC;IACf,GACA;QAAC;KAAM;IAET,MAAM,MAAM,CAAA,GAAA,gBAAQ;IACpB,CAAA,GAAA,6BAAqB,EAAE,KAAK,MAAM;IAClC,OAAO;AACT","sources":["packages/map-interface/src/dev/tile-extent.ts"],"sourcesContent":["import { useMapConditionalStyle, useMapRef } from \"@macrostrat/mapbox-react\";\nimport { tileToGeoJSON } from \"@mapbox/tilebelt\";\nimport { useCallback } from \"react\";\n\ntype TileIndex = { x: number; y: number; z: number };\n\nexport function TileExtentLayer({\n tile,\n color = \"red\",\n}: {\n tile: TileIndex | null;\n color?: string;\n}) {\n const styleCallback = useCallback(\n (map, val: TileIndex) => {\n const style = map.getStyle();\n if (style.layers == null) return;\n style.layers = style.layers.filter((l) => l.id != \"tile-extent\");\n if (val == null) {\n return map.setStyle(style);\n }\n const { x, y, z } = val;\n const extent = tileToGeoJSON([x, y, z]);\n const source = {\n type: \"geojson\",\n data: extent,\n };\n const layer = {\n id: \"tile-extent\",\n type: \"line\",\n source: \"tile-extent\",\n paint: {\n \"line-color\": color,\n \"line-width\": 2,\n },\n };\n style.sources[\"tile-extent\"] = source;\n style.layers.push(layer);\n map.setStyle(style);\n },\n [color]\n );\n const map = useMapRef();\n useMapConditionalStyle(map, tile, styleCallback);\n return null;\n}\n"],"names":[],"version":3,"file":"tile-extent.ca526996.js.map"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {format as $9NqSy$format} from "d3-format";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const $3e1bd09be8f70c4c$export$97c1b10e131a836d = (0, $9NqSy$format)(".4~f");
|
|
5
|
+
const $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea = (0, $9NqSy$format)(".3~f");
|
|
6
|
+
const $3e1bd09be8f70c4c$export$4c173b1b2f78faf7 = (0, $9NqSy$format)(".2~f");
|
|
7
|
+
const $3e1bd09be8f70c4c$export$e54bbd2c33d17485 = (0, $9NqSy$format)(".1~f");
|
|
8
|
+
const $3e1bd09be8f70c4c$export$bc135f63e2f56fd4 = (0, $9NqSy$format)(".0f");
|
|
9
|
+
function $3e1bd09be8f70c4c$export$7c4d25c0c3217d8c(val, precision = 0) {
|
|
10
|
+
switch(precision){
|
|
11
|
+
case 4:
|
|
12
|
+
return $3e1bd09be8f70c4c$export$97c1b10e131a836d(val);
|
|
13
|
+
case 3:
|
|
14
|
+
return $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea(val);
|
|
15
|
+
case 2:
|
|
16
|
+
return $3e1bd09be8f70c4c$export$4c173b1b2f78faf7(val);
|
|
17
|
+
case 1:
|
|
18
|
+
return $3e1bd09be8f70c4c$export$e54bbd2c33d17485(val);
|
|
19
|
+
case 0:
|
|
20
|
+
return $3e1bd09be8f70c4c$export$bc135f63e2f56fd4(val);
|
|
21
|
+
default:
|
|
22
|
+
return $3e1bd09be8f70c4c$export$97c1b10e131a836d(val);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export {$3e1bd09be8f70c4c$export$97c1b10e131a836d as fmt4, $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea as fmt3, $3e1bd09be8f70c4c$export$4c173b1b2f78faf7 as fmt2, $3e1bd09be8f70c4c$export$e54bbd2c33d17485 as fmt1, $3e1bd09be8f70c4c$export$bc135f63e2f56fd4 as fmtInt, $3e1bd09be8f70c4c$export$7c4d25c0c3217d8c as formatValue};
|
|
28
|
+
//# sourceMappingURL=utils.122d1f2d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAEO,MAAM,4CAAO,CAAA,GAAA,aAAK,EAAE;AACpB,MAAM,4CAAO,CAAA,GAAA,aAAK,EAAE;AACpB,MAAM,4CAAO,CAAA,GAAA,aAAK,EAAE;AACpB,MAAM,4CAAO,CAAA,GAAA,aAAK,EAAE;AACpB,MAAM,4CAAS,CAAA,GAAA,aAAK,EAAE;AAEtB,SAAS,0CAAY,GAAW,EAAE,YAAoB,CAAC;IAC5D,OAAQ;QACN,KAAK;YACH,OAAO,0CAAK;QACd,KAAK;YACH,OAAO,0CAAK;QACd,KAAK;YACH,OAAO,0CAAK;QACd,KAAK;YACH,OAAO,0CAAK;QACd,KAAK;YACH,OAAO,0CAAO;QAChB;YACE,OAAO,0CAAK;IAChB;AACF","sources":["packages/map-interface/src/location-info/utils.ts"],"sourcesContent":["import { format } from \"d3-format\";\n\nexport const fmt4 = format(\".4~f\");\nexport const fmt3 = format(\".3~f\");\nexport const fmt2 = format(\".2~f\");\nexport const fmt1 = format(\".1~f\");\nexport const fmtInt = format(\".0f\");\n\nexport function formatValue(val: number, precision: number = 0): string {\n switch (precision) {\n case 4:\n return fmt4(val);\n case 3:\n return fmt3(val);\n case 2:\n return fmt2(val);\n case 1:\n return fmt1(val);\n case 0:\n return fmtInt(val);\n default:\n return fmt4(val);\n }\n}\n"],"names":[],"version":3,"file":"utils.122d1f2d.js.map"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {useEffect as $38k5Q$useEffect} from "react";
|
|
2
|
+
import {Marker as $38k5Q$Marker} from "mapbox-gl";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $82fe09613877ffc2$var$calcMapPadding(rect, childRect) {
|
|
7
|
+
return {
|
|
8
|
+
left: Math.max(rect.left - childRect.left, 0),
|
|
9
|
+
top: Math.max(rect.top - childRect.top, 0),
|
|
10
|
+
right: Math.max(childRect.right - rect.right, 0),
|
|
11
|
+
bottom: Math.max(childRect.bottom - rect.bottom, 0)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function $82fe09613877ffc2$export$bb78f9f01775eef1(ref, parentRef) {
|
|
15
|
+
const rect = parentRef.current?.getBoundingClientRect();
|
|
16
|
+
const childRect = ref.current?.getBoundingClientRect();
|
|
17
|
+
if (rect == null || childRect == null) return;
|
|
18
|
+
return $82fe09613877ffc2$var$calcMapPadding(rect, childRect);
|
|
19
|
+
}
|
|
20
|
+
function $82fe09613877ffc2$export$278090850f6b3a9f(mapRef, markerRef, markerPosition) {
|
|
21
|
+
(0, $38k5Q$useEffect)(()=>{
|
|
22
|
+
const map = mapRef.current;
|
|
23
|
+
if (map == null) return;
|
|
24
|
+
if (markerPosition == null) {
|
|
25
|
+
markerRef.current?.remove();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const marker = markerRef.current ?? new (0, $38k5Q$Marker)();
|
|
29
|
+
marker.setLngLat(markerPosition).addTo(map);
|
|
30
|
+
markerRef.current = marker;
|
|
31
|
+
return ()=>marker.remove();
|
|
32
|
+
}, [
|
|
33
|
+
mapRef.current,
|
|
34
|
+
markerPosition
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export {$82fe09613877ffc2$export$bb78f9f01775eef1 as getMapPadding, $82fe09613877ffc2$export$278090850f6b3a9f as useMapMarker};
|
|
40
|
+
//# sourceMappingURL=utils.d40349f0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;AAGA,SAAS,qCAAe,IAAI,EAAE,SAAS;IACrC,OAAO;QACL,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,GAAG,UAAU,IAAI,EAAE;QAC3C,KAAK,KAAK,GAAG,CAAC,KAAK,GAAG,GAAG,UAAU,GAAG,EAAE;QACxC,OAAO,KAAK,GAAG,CAAC,UAAU,KAAK,GAAG,KAAK,KAAK,EAAE;QAC9C,QAAQ,KAAK,GAAG,CAAC,UAAU,MAAM,GAAG,KAAK,MAAM,EAAE;IACnD;AACF;AAEO,SAAS,0CAAc,GAAG,EAAE,SAAS;IAC1C,MAAM,OAAO,UAAU,OAAO,EAAE;IAChC,MAAM,YAAY,IAAI,OAAO,EAAE;IAC/B,IAAI,QAAQ,QAAQ,aAAa,MAAM;IACvC,OAAO,qCAAe,MAAM;AAC9B;AAEO,SAAS,0CAAa,MAAM,EAAE,SAAS,EAAE,cAAc;IAC5D,CAAA,GAAA,gBAAQ,EAAE;QACR,MAAM,MAAM,OAAO,OAAO;QAC1B,IAAI,OAAO,MAAM;QACjB,IAAI,kBAAkB,MAAM;YAC1B,UAAU,OAAO,EAAE;YACnB;QACF;QACA,MAAM,SAAS,UAAU,OAAO,IAAI,IAAI,CAAA,GAAA,aAAK;QAC7C,OAAO,SAAS,CAAC,gBAAgB,KAAK,CAAC;QACvC,UAAU,OAAO,GAAG;QACpB,OAAO,IAAM,OAAO,MAAM;IAC5B,GAAG;QAAC,OAAO,OAAO;QAAE;KAAe;AACrC","sources":["packages/map-interface/src/utils.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport { Marker } from \"mapbox-gl\";\n\nfunction calcMapPadding(rect, childRect) {\n return {\n left: Math.max(rect.left - childRect.left, 0),\n top: Math.max(rect.top - childRect.top, 0),\n right: Math.max(childRect.right - rect.right, 0),\n bottom: Math.max(childRect.bottom - rect.bottom, 0),\n };\n}\n\nexport function getMapPadding(ref, parentRef) {\n const rect = parentRef.current?.getBoundingClientRect();\n const childRect = ref.current?.getBoundingClientRect();\n if (rect == null || childRect == null) return;\n return calcMapPadding(rect, childRect);\n}\n\nexport function useMapMarker(mapRef, markerRef, markerPosition) {\n useEffect(() => {\n const map = mapRef.current;\n if (map == null) return;\n if (markerPosition == null) {\n markerRef.current?.remove();\n return;\n }\n const marker = markerRef.current ?? new Marker();\n marker.setLngLat(markerPosition).addTo(map);\n markerRef.current = marker;\n return () => marker.remove();\n }, [mapRef.current, markerPosition]);\n}\n"],"names":[],"version":3,"file":"utils.d40349f0.js.map"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import $ddM1H$mainmodule5eb366dejs from "./main.module.5eb366de.js";
|
|
2
|
+
import "../cjs/main.module.becc2fe7.css";
|
|
3
|
+
import {ExpansionPanel as $d570ac304373e71c$export$40e646e38e6ed100} from "./expansion-panel.feff0e62.js";
|
|
4
|
+
import {Button as $ddM1H$Button, Intent as $ddM1H$Intent, Spinner as $ddM1H$Spinner, Switch as $ddM1H$Switch} from "@blueprintjs/core";
|
|
5
|
+
import {useMapRef as $ddM1H$useMapRef, useMapStatus as $ddM1H$useMapStatus} from "@macrostrat/mapbox-react";
|
|
6
|
+
import $ddM1H$macrostrathyper from "@macrostrat/hyper";
|
|
7
|
+
import {useState as $ddM1H$useState, useCallback as $ddM1H$useCallback, useRef as $ddM1H$useRef, useEffect as $ddM1H$useEffect} from "react";
|
|
8
|
+
import {JSONView as $ddM1H$JSONView} from "@macrostrat/ui-components";
|
|
9
|
+
import {group as $ddM1H$group} from "d3-array";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const $b8c84b63e75fe4f2$var$h = (0, $ddM1H$macrostrathyper).styled((0, ($parcel$interopDefault($ddM1H$mainmodule5eb366dejs))));
|
|
24
|
+
function $b8c84b63e75fe4f2$export$2906e7f4b228efe9({ data: data, ...rest }) {
|
|
25
|
+
// Instead of managing hover state with CSS, we use a state variable,
|
|
26
|
+
// so that the button re-renders when the state changes
|
|
27
|
+
const [showControls, setShowControls] = (0, $ddM1H$useState)(false);
|
|
28
|
+
const onMouseEnter = (0, $ddM1H$useCallback)(()=>setShowControls(true), []);
|
|
29
|
+
const onMouseLeave = (0, $ddM1H$useCallback)(()=>setShowControls(false), []);
|
|
30
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-properties", {
|
|
31
|
+
onMouseEnter: onMouseEnter,
|
|
32
|
+
onMouseLeave: onMouseLeave
|
|
33
|
+
}, [
|
|
34
|
+
$b8c84b63e75fe4f2$var$h.if(showControls)("div.controls", $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$CopyJSONButton, {
|
|
35
|
+
data: data
|
|
36
|
+
})),
|
|
37
|
+
$b8c84b63e75fe4f2$var$h((0, $ddM1H$JSONView), {
|
|
38
|
+
data: data,
|
|
39
|
+
hideRoot: true,
|
|
40
|
+
...rest
|
|
41
|
+
})
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
function $b8c84b63e75fe4f2$export$dc87b4d46cea200d({ feature: feature }) {
|
|
45
|
+
const props = feature.properties;
|
|
46
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-record", [
|
|
47
|
+
$b8c84b63e75fe4f2$var$h.if(Object.keys(props).length > 0)($b8c84b63e75fe4f2$export$2906e7f4b228efe9, {
|
|
48
|
+
data: props
|
|
49
|
+
})
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
function $b8c84b63e75fe4f2$var$CopyJSONButton({ data: data }) {
|
|
53
|
+
const [copied, setCopied] = (0, $ddM1H$useState)(false);
|
|
54
|
+
return $b8c84b63e75fe4f2$var$h((0, $ddM1H$Button), {
|
|
55
|
+
icon: copied ? "tick" : "clipboard",
|
|
56
|
+
intent: copied ? (0, $ddM1H$Intent).SUCCESS : (0, $ddM1H$Intent).NONE,
|
|
57
|
+
minimal: true,
|
|
58
|
+
small: true,
|
|
59
|
+
onClick () {
|
|
60
|
+
navigator.clipboard.writeText(JSON.stringify(data, null, 2));
|
|
61
|
+
setCopied(true);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function $b8c84b63e75fe4f2$export$214daccdda0f4ac6({ selectedLocation: selectedLocation, setFeatures: setFeatures, radius: radius = 2 }) {
|
|
66
|
+
const mapRef = (0, $ddM1H$useMapRef)();
|
|
67
|
+
const isLoading = (0, $ddM1H$useMapStatus)((s)=>s.isLoading);
|
|
68
|
+
const isInitialized = (0, $ddM1H$useMapStatus)((s)=>s.isInitialized);
|
|
69
|
+
const prevLocation = (0, $ddM1H$useRef)(null);
|
|
70
|
+
const prevFeatures = (0, $ddM1H$useRef)([]);
|
|
71
|
+
(0, $ddM1H$useEffect)(()=>{
|
|
72
|
+
const map = mapRef?.current;
|
|
73
|
+
if (map == null) return;
|
|
74
|
+
if (selectedLocation == null) {
|
|
75
|
+
setFeatures(null);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!isInitialized) return;
|
|
79
|
+
const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;
|
|
80
|
+
const locationMemo = JSON.stringify(selectedLocation);
|
|
81
|
+
if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures) return;
|
|
82
|
+
prevLocation.current = locationMemo;
|
|
83
|
+
// Don't update if the location hasn't changed
|
|
84
|
+
//if (selectedLocation == prevLocation) return;
|
|
85
|
+
const r = radius;
|
|
86
|
+
const pt = map.project(selectedLocation);
|
|
87
|
+
const bbox = [
|
|
88
|
+
[
|
|
89
|
+
pt.x - r,
|
|
90
|
+
pt.y - r
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
pt.x + r,
|
|
94
|
+
pt.y + r
|
|
95
|
+
]
|
|
96
|
+
];
|
|
97
|
+
const features = map.queryRenderedFeatures(bbox);
|
|
98
|
+
prevFeatures.current = features ?? [];
|
|
99
|
+
setFeatures(features);
|
|
100
|
+
}, [
|
|
101
|
+
isInitialized,
|
|
102
|
+
selectedLocation,
|
|
103
|
+
isLoading
|
|
104
|
+
]);
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
function $b8c84b63e75fe4f2$var$FeatureHeader({ feature: feature }) {
|
|
108
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-header", [
|
|
109
|
+
$b8c84b63e75fe4f2$var$h("h3", [
|
|
110
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
111
|
+
label: "Source",
|
|
112
|
+
value: feature.source
|
|
113
|
+
}),
|
|
114
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
115
|
+
label: "Source layer",
|
|
116
|
+
value: feature.sourceLayer
|
|
117
|
+
})
|
|
118
|
+
])
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
function $b8c84b63e75fe4f2$var$KeyValue({ label: label, value: value }) {
|
|
122
|
+
return $b8c84b63e75fe4f2$var$h("span.key-value", [
|
|
123
|
+
$b8c84b63e75fe4f2$var$h("span.key", label),
|
|
124
|
+
$b8c84b63e75fe4f2$var$h("code.value", value)
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
function $b8c84b63e75fe4f2$var$LoadingAwareFeatureSet({ features: features, sourceID: sourceID }) {
|
|
128
|
+
const map = (0, $ddM1H$useMapRef)();
|
|
129
|
+
if (map?.current == null) return null;
|
|
130
|
+
const [isLoaded, setIsLoaded] = (0, $ddM1H$useState)(false);
|
|
131
|
+
const sourceFeatures = features.filter((d)=>d.source == "burwell");
|
|
132
|
+
(0, $ddM1H$useEffect)(()=>{
|
|
133
|
+
if (sourceFeatures.length > 0) {
|
|
134
|
+
setIsLoaded(true);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const isLoaded = map.current.isSourceLoaded(sourceID);
|
|
138
|
+
setIsLoaded(isLoaded);
|
|
139
|
+
if (!isLoaded) map.current.once("sourcedata", (e)=>{
|
|
140
|
+
if (e.sourceId == sourceID) setIsLoaded(true);
|
|
141
|
+
});
|
|
142
|
+
}, [
|
|
143
|
+
map.current,
|
|
144
|
+
sourceID,
|
|
145
|
+
sourceFeatures.length
|
|
146
|
+
]);
|
|
147
|
+
if (!isLoaded) return $b8c84b63e75fe4f2$var$h((0, $ddM1H$Spinner));
|
|
148
|
+
return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$export$617d79dae526d2cf, {
|
|
149
|
+
features: sourceFeatures
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function $b8c84b63e75fe4f2$export$43c75dec9d0b96c({ feature: feature, showExtent: showExtent, setShowExtent: setShowExtent }) {
|
|
153
|
+
if (feature == null) return null;
|
|
154
|
+
const size = feature._vectorTileFeature._pbf.length;
|
|
155
|
+
return $b8c84b63e75fe4f2$var$h("div.tile-info", [
|
|
156
|
+
$b8c84b63e75fe4f2$var$h("h3", "Tile"),
|
|
157
|
+
$b8c84b63e75fe4f2$var$h("div.tile-index", [
|
|
158
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
159
|
+
label: "x",
|
|
160
|
+
value: feature._x
|
|
161
|
+
}),
|
|
162
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
163
|
+
label: "y",
|
|
164
|
+
value: feature._y
|
|
165
|
+
}),
|
|
166
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
167
|
+
label: "z",
|
|
168
|
+
value: feature._z
|
|
169
|
+
})
|
|
170
|
+
]),
|
|
171
|
+
$b8c84b63e75fe4f2$var$h("div.spacer"),
|
|
172
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
|
|
173
|
+
label: "Size",
|
|
174
|
+
value: $b8c84b63e75fe4f2$var$formatSize(size)
|
|
175
|
+
}),
|
|
176
|
+
$b8c84b63e75fe4f2$var$h((0, $ddM1H$Switch), {
|
|
177
|
+
label: "Show extent",
|
|
178
|
+
alignIndicator: "right",
|
|
179
|
+
checked: showExtent,
|
|
180
|
+
onChange () {
|
|
181
|
+
setShowExtent(!showExtent);
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
function $b8c84b63e75fe4f2$var$formatSize(size) {
|
|
187
|
+
if (size > 1000000) return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$UnitNumber, {
|
|
188
|
+
value: size / 1000000,
|
|
189
|
+
unit: "Mb"
|
|
190
|
+
});
|
|
191
|
+
if (size > 1000) return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$UnitNumber, {
|
|
192
|
+
value: size / 1000,
|
|
193
|
+
unit: "Kb"
|
|
194
|
+
});
|
|
195
|
+
return `${size} bytes`;
|
|
196
|
+
}
|
|
197
|
+
function $b8c84b63e75fe4f2$var$UnitNumber({ value: value, unit: unit, precision: precision = 1 }) {
|
|
198
|
+
return $b8c84b63e75fe4f2$var$h("span.unit-number", [
|
|
199
|
+
$b8c84b63e75fe4f2$var$h("span.number", value.toFixed(precision)),
|
|
200
|
+
$b8c84b63e75fe4f2$var$h("span.unit", unit)
|
|
201
|
+
]);
|
|
202
|
+
}
|
|
203
|
+
function $b8c84b63e75fe4f2$export$43277c51a01761c1({ features: features, focusedSource: focusedSource = null }) {
|
|
204
|
+
if (features == null) return null;
|
|
205
|
+
let focusedSourcePanel = null;
|
|
206
|
+
let filteredFeatures = features;
|
|
207
|
+
let title = "Features";
|
|
208
|
+
if (focusedSource != null) {
|
|
209
|
+
title = "Basemap features";
|
|
210
|
+
focusedSourcePanel = $b8c84b63e75fe4f2$var$h((0, $d570ac304373e71c$export$40e646e38e6ed100), {
|
|
211
|
+
title: "Macrostrat features",
|
|
212
|
+
className: "macrostrat-features",
|
|
213
|
+
expanded: true
|
|
214
|
+
}, [
|
|
215
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$LoadingAwareFeatureSet, {
|
|
216
|
+
features: features,
|
|
217
|
+
sourceID: focusedSource
|
|
218
|
+
})
|
|
219
|
+
]);
|
|
220
|
+
filteredFeatures = features.filter((d)=>d.source != focusedSource);
|
|
221
|
+
}
|
|
222
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-panel", [
|
|
223
|
+
focusedSourcePanel,
|
|
224
|
+
$b8c84b63e75fe4f2$var$h((0, $d570ac304373e71c$export$40e646e38e6ed100), {
|
|
225
|
+
title: title,
|
|
226
|
+
className: "basemap-features",
|
|
227
|
+
expanded: focusedSource == null
|
|
228
|
+
}, [
|
|
229
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$FeatureGroups, {
|
|
230
|
+
features: filteredFeatures
|
|
231
|
+
})
|
|
232
|
+
])
|
|
233
|
+
]);
|
|
234
|
+
}
|
|
235
|
+
function $b8c84b63e75fe4f2$var$FeatureGroups({ features: features }) {
|
|
236
|
+
/** Group features by source and sourceLayer */ if (features == null) return null;
|
|
237
|
+
const groups = (0, $ddM1H$group)(features, (d)=>`${d.source} - ${d.sourceLayer}`);
|
|
238
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-groups", Array.from(groups).map(([key, features])=>{
|
|
239
|
+
return $b8c84b63e75fe4f2$var$h("div.feature-group", [
|
|
240
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$FeatureHeader, {
|
|
241
|
+
feature: features[0]
|
|
242
|
+
}),
|
|
243
|
+
$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$export$617d79dae526d2cf, {
|
|
244
|
+
features: features
|
|
245
|
+
})
|
|
246
|
+
]);
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
function $b8c84b63e75fe4f2$export$617d79dae526d2cf({ features: features }) {
|
|
250
|
+
return $b8c84b63e75fe4f2$var$h("div.features", features.map((feature, i)=>$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$export$dc87b4d46cea200d, {
|
|
251
|
+
key: i,
|
|
252
|
+
feature: feature
|
|
253
|
+
})));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
export {$b8c84b63e75fe4f2$export$2906e7f4b228efe9 as FeatureProperties, $b8c84b63e75fe4f2$export$dc87b4d46cea200d as FeatureRecord, $b8c84b63e75fe4f2$export$214daccdda0f4ac6 as FeatureSelectionHandler, $b8c84b63e75fe4f2$export$617d79dae526d2cf as Features, $b8c84b63e75fe4f2$export$43c75dec9d0b96c as TileInfo, $b8c84b63e75fe4f2$export$43277c51a01761c1 as FeaturePanel};
|
|
258
|
+
//# sourceMappingURL=vector-tile-features.e1a24df0.js.map
|