-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from UW-Macrostrat/rework-dev
Rework development layers
- Loading branch information
Showing
37 changed files
with
322 additions
and
600 deletions.
There are no files selected for viewing
Submodule web-components
updated
29 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
export { ContentPage as default } from "~/layouts"; | ||
import { PageHeader, PageBreadcrumbs } from "~/components"; | ||
import { PageHeaderV2 } from "~/components"; | ||
|
||
<PageHeader title="Development pages"></PageHeader> | ||
<PageBreadcrumbs></PageBreadcrumbs> | ||
<PageHeaderV2 title="Development" showLogo></PageHeaderV2> | ||
|
||
## Maps | ||
|
||
- [Map development pages](/dev/map) | ||
- [Globe](/dev/globe) | ||
- [Paleogeography](/dev/paleo) | ||
- [User interface tests](/dev/ui-tests) | ||
- [Feedback](/dev/feedback) | ||
- [Map filter](/dev/filtering) | ||
- [CriticalMAAS](/integrations/criticalmaas) | ||
- [Sources](/dev/sources) | ||
|
||
## xDD integration | ||
|
||
- [Map legend affinity](/dev/legend-affinity) | ||
## xDD | ||
|
||
- [Map legend affinity](/dev/map/legend-affinity) | ||
- [Extractions](/integrations/xdd/extractions) | ||
|
||
## Apps | ||
## Concept apps | ||
|
||
- [Concept apps](/dev/concepts) | ||
- [Built with Macrostrat](/dev/apps) | ||
- [Test Site](/dev/test-site/main-page) | ||
- [Concept app index](/dev/concepts) | ||
- [Built with Macrostrat](/dev/test-site/about) | ||
- [New homepage](/dev/test-site/main-page) | ||
- [Documentation](/dev/docs) | ||
|
||
## Miscellaneous | ||
|
||
- [User interface tests](/dev/ui-tests) | ||
- [CriticalMAAS](/integrations/criticalmaas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export { ContentPage as default } from "~/layouts"; | ||
import { PageHeaderV2 } from "~/components"; | ||
|
||
<PageHeaderV2 title="Map pages" showLogo></PageHeaderV2> | ||
|
||
Pages for development of Macrostrat mapping interfaces | ||
|
||
- [Map layers](/dev/map/layers) - core map layers from Macrostrat's tile server | ||
- [Server-side filtering](/dev/map/filter) - Map filtering using Macrostrat's *v3* API | ||
- [Legend affinity](/dev/map/legend-affinity) - xDD integration | ||
- [Sources](/dev/map/sources) - Map data sources and "reference geometries" | ||
- [Color schemes](/dev/map/color-schemes) - Color schemes for map layers | ||
|
||
## Integrations | ||
|
||
- [StraboSpot](/dev/map/strabospot) - StraboSpot development integration | ||
- [Weaver](/dev/map/weaver) - point data experiments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { RasterMapInspectorPage, VectorMapInspectorPage } from "../lib"; | ||
import h from "@macrostrat/hyper"; | ||
import { useData } from "vike-react/useData"; | ||
|
||
export function Page() { | ||
const layerInfo: any = useData(); | ||
|
||
const { title, tileset, type } = layerInfo; | ||
|
||
const component: any = | ||
type == "raster" ? RasterMapInspectorPage : VectorMapInspectorPage; | ||
|
||
return h(component, { title, tileset }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { PageContextServer } from "vike/types"; | ||
import { useConfig } from "vike-react/useConfig"; | ||
import { | ||
MacrostratRasterTileset, | ||
MacrostratVectorTileset, | ||
} from "~/_utils/map-layers"; | ||
import { render } from "vike/abort"; | ||
|
||
export async function data(pageContext: PageContextServer) { | ||
const config = useConfig(); | ||
const { layer } = pageContext.routeParams; | ||
|
||
const layerInfo = layerIndex.find((l) => l.slug == layer); | ||
|
||
if (layerInfo == null) { | ||
throw render(404, "Layer not found"); | ||
} | ||
|
||
const { title, tileset, type } = layerInfo; | ||
|
||
let _title = title; | ||
if (_title == null) { | ||
// Capitalize the first letter | ||
_title = tileset.charAt(0).toUpperCase() + tileset.slice(1); | ||
} | ||
|
||
config({ | ||
title: _title + "– Layer", | ||
}); | ||
|
||
return { title: _title, tileset, type }; | ||
} | ||
|
||
type LayerInfo = { | ||
title?: string; | ||
slug: string; | ||
tileset: MacrostratRasterTileset | MacrostratVectorTileset | string; | ||
type: "raster" | "vector"; | ||
}; | ||
|
||
/** Index of allowed map layers. | ||
* TODO: we could get this from the Macrostrat API somehow | ||
*/ | ||
|
||
const layerIndex: LayerInfo[] = [ | ||
{ slug: "carto", tileset: MacrostratRasterTileset.Carto, type: "vector" }, | ||
{ | ||
slug: "carto-slim", | ||
tileset: MacrostratVectorTileset.CartoSlim, | ||
type: "vector", | ||
}, | ||
{ | ||
slug: "carto-v1", | ||
tileset: "https://tiles.macrostrat.org/carto/{z}/{x}/{y}.mvt", | ||
type: "vector", | ||
}, | ||
{ | ||
slug: "carto-slim-v1", | ||
tileset: "https://tiles.macrostrat.org/carto-slim/{z}/{x}/{y}.mvt", | ||
type: "vector", | ||
}, | ||
{ | ||
slug: "all-maps", | ||
tileset: MacrostratVectorTileset.AllMaps, | ||
type: "vector", | ||
}, | ||
{ | ||
slug: "carto-raster", | ||
tileset: MacrostratRasterTileset.Carto, | ||
type: "raster", | ||
title: "Carto (raster)", | ||
}, | ||
{ | ||
slug: "emphasized", | ||
tileset: MacrostratRasterTileset.Emphasized, | ||
type: "raster", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import h from "@macrostrat/hyper"; | ||
import { PageHeaderV2 } from "~/components"; | ||
import { ContentPage } from "~/layouts"; | ||
|
||
export function Page() { | ||
return h(ContentPage, [ | ||
h(PageHeaderV2, { title: "Layer inspectors", showLogo: true }), | ||
h("h2", "Core layers"), | ||
h("ul.layers", [ | ||
h(LinkItem, { to: "carto" }, "Carto"), | ||
h(LinkItem, { to: "carto-slim" }, "Carto (slim)"), | ||
h(LinkItem, { to: "carto-v1" }, "Carto (v1)"), | ||
h(LinkItem, { to: "carto-slim-v1" }, "Carto (slim, v1)"), | ||
h(LinkItem, { to: "carto-raster" }, "Carto (image)"), | ||
h(LinkItem, { to: "emphasized" }, "Carto (image, emphasized)"), | ||
h(LinkItem, { to: "all-maps" }, "All maps"), | ||
]), | ||
h("h2", h("a", { href: "./layers/tables" }, "Table catalog")), | ||
]); | ||
} | ||
|
||
function LinkItem({ to, children }) { | ||
return h("li", h("a", { href: "./layers/" + to }, children)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.