-
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.
- Loading branch information
1 parent
0daac21
commit ebd6116
Showing
7 changed files
with
63 additions
and
80 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
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,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 }; | ||
} |
This file was deleted.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
src/pages/dev/maps/@cog_id/@system/@system_version/+data.ts
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,16 @@ | ||
import { PageContext } from "vike/types"; | ||
|
||
export async function data(pageContext: PageContext) { | ||
const { cog_id, system, system_version } = pageContext.routeParams; | ||
|
||
const url = `http://localhost:3000/tiles/cog/${cog_id}/system/${system}/system_version/${system_version}`; | ||
const res = await fetch(url); | ||
const data = await res.json(); | ||
|
||
return { | ||
cog_id, | ||
system, | ||
system_version, | ||
envelope: data.web_geom, | ||
}; | ||
} |
27 changes: 0 additions & 27 deletions
27
src/pages/dev/maps/@cog_id/@system/@system_version/+onBeforeRender.ts
This file was deleted.
Oops, something went wrong.