-
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 #226 from CannonLock/map-viewer
Map viewer
- Loading branch information
Showing
19 changed files
with
518 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ docker-compose.yaml | |
!.yarn/versions | ||
|
||
# IntelliJ | ||
.idea | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
|
||
|
Submodule cesium-martini
updated
4 files
+0 −1 | src/heightmap-resource.ts | |
+5 −7 | src/mapbox-resource.ts | |
+4 −10 | src/terrain-provider.ts | |
+0 −2 | src/worker-util.ts |
Submodule cesium-viewer
updated
4 files
+3 −3 | src/layers/index.ts | |
+2 −2 | src/layers/terrain/hillshade.ts | |
+17 −18 | src/layers/terrain/provider.ts | |
+1 −0 | src/viewer.ts |
Submodule web-components
updated
238 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
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,32 @@ | ||
import { default as h } from "@macrostrat/hyper"; | ||
// Page for a list of maps | ||
import { AnchorButton, ButtonGroup } from "@blueprintjs/core"; | ||
import { ContentPage } from "~/layouts"; | ||
import { PageHeader, DevLinkButton } from "~/components"; | ||
import { useData } from "vike-react/useData"; | ||
|
||
export function Page() { | ||
const data = useData(); | ||
const { sources } = data; | ||
|
||
console.log(sources); | ||
|
||
return h(ContentPage, [ | ||
h(PageHeader, { title: "CDR Maps", showSiteName: false }), | ||
h( | ||
"ul.maps-list", | ||
sources.map((d) => h(SourceItem, { source: d, key: d.source_id })) | ||
), | ||
]); | ||
} | ||
|
||
function SourceItem({ source }) { | ||
const { cog_id, system, system_version } = source; | ||
const href = `./maps/${cog_id}/${system}/${system_version}`; | ||
|
||
return h("li", [ | ||
h("span.source-id", {}, cog_id), | ||
" ", | ||
h("a", { href }, [system, system_version]), | ||
]); | ||
} |
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,10 @@ | ||
export default { | ||
meta: { | ||
Page: { | ||
env: { | ||
client: true, | ||
server: false, | ||
}, | ||
}, | ||
}, | ||
}; |
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,12 @@ | ||
export async function data(pageContext): Promise<any> { | ||
// `.page.server.js` files always run in Node.js; we could use SQL/ORM queries here. | ||
|
||
// Fetch data from local api | ||
const url = `http://localhost:3000/tiles/sources`; | ||
const res = await fetch(url); | ||
const data = await res.json(); | ||
|
||
const nullFilteredData = data.filter((source) => source.web_geom !== null); | ||
|
||
return { sources: nullFilteredData }; | ||
} |
Oops, something went wrong.