-
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.
* map-page: Added skeletal map marker. May not keep this Added legend info Map now works OK basic source maps works Uodated map interface Server seems to work OK Basic page for each map Added a skeletal index page for maps
- Loading branch information
Showing
11 changed files
with
456 additions
and
18 deletions.
There are no files selected for viewing
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
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
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,36 @@ | ||
import { PageContextBuiltInServer } from "vite-plugin-ssr/types"; | ||
import { SETTINGS } from "~/map-interface/settings"; | ||
import h from "@macrostrat/hyper"; | ||
import { ClientOnly } from "~/renderer/client-only"; | ||
|
||
const apiAddress = SETTINGS.apiDomain + "/api/v2/defs/sources"; | ||
|
||
export async function onBeforeRender(pageContext: PageContextBuiltInServer) { | ||
const { id } = pageContext.routeParams; | ||
|
||
const params = new URLSearchParams({ | ||
format: "geojson", | ||
source_id: id, | ||
}); | ||
const response = await fetch(apiAddress + "?" + params); | ||
const data: any = await response.json(); | ||
const map = data?.success?.data?.features[0]; | ||
|
||
return { | ||
pageContext: { | ||
pageProps: { | ||
map, | ||
}, | ||
documentProps: { | ||
// The page's <title> | ||
title: map.properties.name, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
const MapInterface = () => import("./map-interface"); | ||
|
||
export function Page({ map }) { | ||
return h("div.single-map", h(ClientOnly, { component: MapInterface, map })); | ||
} |
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,34 @@ | ||
body | ||
margin: 0 | ||
padding: 0 | ||
|
||
.single-map | ||
width: 100vh | ||
height: 100vh | ||
margin: 0 | ||
--map-context-stack-width: 16em | ||
|
||
.map-legend-container | ||
overflow-y: scroll | ||
|
||
.map-legend | ||
margin: 1em | ||
|
||
.legend-entry | ||
margin: 0.5em 0 | ||
|
||
.legend-title | ||
display: flex | ||
flex-direction: row | ||
&:hover | ||
cursor: pointer | ||
background: #eee | ||
h4 | ||
margin: 0 | ||
margin-right: 0.5em | ||
|
||
.legend-swatch | ||
width: 1em | ||
height: 1em | ||
display: inline-block | ||
margin-right: 0.5em |
Oops, something went wrong.