@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@macrostrat/map-interface",
3
- "version": "0.2.0",
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.0.0",
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;
@@ -9,6 +9,9 @@
9
9
  bottom: 0
10
10
  left: 0
11
11
  right: 0
12
+ &:global(.mapboxgl-map)
13
+ // override the default mapbox position: relative in all cases
14
+ position: absolute
12
15
 
13
16
  /* Desktop styling is necessarily much more complicated than mobile
14
17
  to handle a two-column layout. */