@macrostrat/map-interface 0.2.0 → 0.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/dist/index.cjs +25 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +29 -32
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/container.ts +0 -4
- package/src/helpers.ts +2 -1
- package/src/map-view/main.module.sass +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macrostrat/map-interface",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Map interface for Macrostrat",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@macrostrat/hyper": "^2.2.1",
|
|
12
12
|
"@macrostrat/mapbox-react": "^2.1.0",
|
|
13
13
|
"@macrostrat/mapbox-utils": "^1.2.1",
|
|
14
|
-
"@macrostrat/ui-components": "^3.
|
|
14
|
+
"@macrostrat/ui-components": "^3.1.0",
|
|
15
15
|
"@mapbox/tilebelt": "^1.0.2",
|
|
16
16
|
"@turf/bbox": "^6.5.0",
|
|
17
17
|
"chroma-js": "^2.4.2",
|
package/src/container.ts
CHANGED
|
@@ -15,10 +15,6 @@ import { Card } from "@blueprintjs/core";
|
|
|
15
15
|
|
|
16
16
|
import { ReactNode } from "react";
|
|
17
17
|
|
|
18
|
-
export function MapInterface() {
|
|
19
|
-
return h("div", "Hello world");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
const h = hyper.styled(styles);
|
|
23
19
|
|
|
24
20
|
type AnyElement = React.ReactNode | React.ReactElement | React.ReactFragment;
|
package/src/helpers.ts
CHANGED
|
@@ -10,7 +10,7 @@ import useResizeObserver from "use-resize-observer";
|
|
|
10
10
|
|
|
11
11
|
import { getMapPosition } from "@macrostrat/mapbox-utils";
|
|
12
12
|
import mapboxgl from "mapbox-gl";
|
|
13
|
-
import { useCallback, useEffect, useState } from "react";
|
|
13
|
+
import { useCallback, useEffect, useState, useLayoutEffect } from "react";
|
|
14
14
|
import { getMapPadding, useMapMarker } from "./utils";
|
|
15
15
|
|
|
16
16
|
export function MapResizeManager({ containerRef }) {
|
|
@@ -66,6 +66,7 @@ export function MapPaddingManager({
|
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
// Ideally, we would not have to do this when we know the infobox is loaded
|
|
69
70
|
useMapEaseToCenter(infoMarkerPosition, padding);
|
|
70
71
|
|
|
71
72
|
return null;
|