Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pages/lex/intervals/@id/+Page.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export function Page() {
h(ColumnsTable, {
resData,
colData,
fossilsData
fossilsData,
mapUrl: "intervals=" + id
}),
h(Charts, { features }),
h(PrevalentTaxa, { taxaData }),
Expand Down
3 changes: 2 additions & 1 deletion pages/lex/lithologies/@id/+Page.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export function Page() {
h(ColumnsTable, {
resData,
colData,
fossilsData
fossilsData,
mapUrl: "lithologies=" + id
}),
h(Charts, { features }),
h(PrevalentTaxa, { taxaData }),
Expand Down
4 changes: 2 additions & 2 deletions pages/lex/strat-concepts/@id/+Page.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export function Page() {
h(ColumnsTable, {
resData,
colData,
fossilsData
fossilsData,
mapUrl: "strat_name_concept=" + id
}),
h(Charts, { features }),
h(PrevalentTaxa, { taxaData }),
h(Timescales, { timescales }),
h(ConceptBody, { concept_id: id }),
h.if(unitsData.length > 0)(Units, { href: "strat_name_concept_id=" + id + "&name=" + resData?.name }),
h.if(fossilsData.length > 0)(Fossils, { href: "strat_name_concept_id=" + id + "&name=" + resData?.name }),
h(TextExtractions, { concept_id: id, href: "autoselect=" + resData?.name + "&concept_id=" + id }),
];

return LexItemPage({
Expand Down
6 changes: 1 addition & 5 deletions pages/lex/strat-names/@id/+Page.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ export function Page() {
h(ColumnsTable, {
resData,
colData,
fossilsData
fossilsData,
}),
h(Charts, { features }),
h(PrevalentTaxa, { taxaData }),
h(Timescales, { timescales }),
h(TextExtractions, {
strat_name_id: id,
href: "autoselect=" + resData?.strat_name_long + "&strat_name_id=" + id,
}),
h.if(unitsData.length > 0)(Units, { href: "strat_name_id=" + id + "&name=" + resData?.strat_name }),
// h.if(mapsData?.length > 0)(Maps, { href: "strat_name_id=" + id + "&name=" + resData?.name }), (add strat names to legends view first)
h.if(fossilsData.features.length > 0)(Fossils, { href: "strat_name_id=" + id + "&name=" + resData?.name }),
Expand Down
6 changes: 3 additions & 3 deletions src/components/lex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function ColumnMapContainer(props) {
{
load: () => import("./map.client").then((d) => d.ColumnsMapContainer),
fallback: h("div.loading", "Loading map..."),
deps: [props.columns, props.projectID, props.fossilData, props.filters],
deps: [props.columns, props.projectID, props.fossilData, props.filters, props.mapUrl],
},
(component) => h(component, props)
);
Expand Down Expand Up @@ -100,7 +100,7 @@ function LexItemPageInner(props: LexItemPageProps) {
]);
}

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

Expand Down Expand Up @@ -201,7 +201,7 @@ export function ColumnsTable({ resData, colData, fossilsData }) {
columns: colData,
className: "column-map-container",
fossilsData,
lex: true
mapUrl,
}),
]);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/lex/map.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import mapboxgl from "mapbox-gl"
import { pbdbDomain, tileserverDomain } from "@macrostrat-web/settings";
import { buildMacrostratStyle } from "@macrostrat/map-styles";
import { getExpressionForFilters } from "./filter-helper";
import { navigate } from "vike/client/router";

const _macrostratStyle = buildMacrostratStyle({
tileserverDomain,
Expand All @@ -35,9 +36,9 @@ function ColumnsMapInner({
columnIDs = null,
className = "map-container",
columns = null,
lex = false,
fossilsData = [],
filters = [],
mapUrl = ""
}) {
const [showSatellite, setShowSatellite] = useState(true);
const [showFossils, setShowFossils] = useState(false);
Expand All @@ -59,8 +60,10 @@ function ColumnsMapInner({
setShowOutcrop(!showOutcrop);
}

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

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