Skip to content

Commit 5ce89e1

Browse files
committed
Add mappign to intervals, liths, and strat concepts
1 parent 2a20968 commit 5ce89e1

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

pages/lex/intervals/@id/+Page.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export function Page() {
2525
h(ColumnsTable, {
2626
resData,
2727
colData,
28-
fossilsData
28+
fossilsData,
29+
mapUrl: "intervals=" + id
2930
}),
3031
h(Charts, { features }),
3132
h(PrevalentTaxa, { taxaData }),

pages/lex/lithologies/@id/+Page.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export function Page() {
2727
h(ColumnsTable, {
2828
resData,
2929
colData,
30-
fossilsData
30+
fossilsData,
31+
mapUrl: "lithologies=" + id
3132
}),
3233
h(Charts, { features }),
3334
h(PrevalentTaxa, { taxaData }),

pages/lex/strat-concepts/@id/+Page.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export function Page() {
3333
h(ColumnsTable, {
3434
resData,
3535
colData,
36-
fossilsData
36+
fossilsData,
37+
mapUrl: "strat_name_concept=" + id
3738
}),
3839
h(Charts, { features }),
3940
h(PrevalentTaxa, { taxaData }),

pages/lex/strat-names/@id/+Page.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function Page() {
3030
h(ColumnsTable, {
3131
resData,
3232
colData,
33-
fossilsData
33+
fossilsData,
3434
}),
3535
h(Charts, { features }),
3636
h(PrevalentTaxa, { taxaData }),

src/components/lex/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function ColumnMapContainer(props) {
3636
{
3737
load: () => import("./map.client").then((d) => d.ColumnsMapContainer),
3838
fallback: h("div.loading", "Loading map..."),
39-
deps: [props.columns, props.projectID, props.fossilData, props.filters],
39+
deps: [props.columns, props.projectID, props.fossilData, props.filters, props.mapUrl],
4040
},
4141
(component) => h(component, props)
4242
);
@@ -100,7 +100,7 @@ function LexItemPageInner(props: LexItemPageProps) {
100100
]);
101101
}
102102

103-
export function ColumnsTable({ resData, colData, fossilsData }) {
103+
export function ColumnsTable({ resData, colData, fossilsData, mapUrl }) {
104104
if (!colData || !colData.features || colData.features.length === 0) return;
105105
const summary = summarize(colData.features || []);
106106

@@ -201,7 +201,7 @@ export function ColumnsTable({ resData, colData, fossilsData }) {
201201
columns: colData,
202202
className: "column-map-container",
203203
fossilsData,
204-
lex: true
204+
mapUrl,
205205
}),
206206
]);
207207
}

src/components/lex/map.client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import mapboxgl from "mapbox-gl"
1515
import { pbdbDomain, tileserverDomain } from "@macrostrat-web/settings";
1616
import { buildMacrostratStyle } from "@macrostrat/map-styles";
1717
import { getExpressionForFilters } from "./filter-helper";
18+
import { navigate } from "vike/client/router";
1819

1920
const _macrostratStyle = buildMacrostratStyle({
2021
tileserverDomain,
@@ -35,9 +36,9 @@ function ColumnsMapInner({
3536
columnIDs = null,
3637
className = "map-container",
3738
columns = null,
38-
lex = false,
3939
fossilsData = [],
4040
filters = [],
41+
mapUrl = ""
4142
}) {
4243
const [showSatellite, setShowSatellite] = useState(true);
4344
const [showFossils, setShowFossils] = useState(false);
@@ -59,8 +60,10 @@ function ColumnsMapInner({
5960
setShowOutcrop(!showOutcrop);
6061
}
6162

63+
const map = "/map/layers#" + mapUrl
6264

6365
return h('div.lex-controls', [
66+
h.if(mapUrl !== "")('div.btn', { onClick: () => navigate(map) }, h(Icon, { icon: "map", className: 'icon' })),
6467
h.if(fossilsExist)('div.btn', { onClick: handleFossils }, h(Icon, { icon: "mountain", className: 'icon' })),
6568
h.if(filters.length > 0)('div.btn', { onClick: handleOutcrop }, h(Icon, { icon: "excavator", className: 'icon' })),
6669
h('div.btn', { onClick: handleSatellite }, h(Icon, { icon: "satellite", className: 'icon' })),

0 commit comments

Comments
 (0)