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
9 changes: 8 additions & 1 deletion pages/dev/map/layers/@layer/+data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
MacrostratVectorTileset,
} from "~/_utils/map-layers";
import { render } from "vike/abort";
import { tileserverDomain } from "@macrostrat-web/settings";

export async function data(pageContext: PageContextServer) {
const config = useConfig();
Expand Down Expand Up @@ -66,10 +67,16 @@ const layerIndex: LayerInfo[] = [
},
{
slug: "carto-raster",
tileset: MacrostratRasterTileset.Carto,
tileset: tileserverDomain + "/legacy/carto/{z}/{x}/{y}.png", //?cache=bypass",
type: "raster",
title: "Carto (raster)",
},
{
slug: "carto-raster-v1",
tileset: "https://tiles.macrostrat.org/carto/{z}/{x}/{y}.png",
type: "raster",
title: "Carto (raster, v1)",
},
{
slug: "emphasized",
tileset: MacrostratRasterTileset.Emphasized,
Expand Down
1 change: 1 addition & 0 deletions pages/dev/map/layers/index/+Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function Page() {
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: "carto-raster-v1" }, "Carto (image, v1)"),
h(LinkItem, { to: "emphasized" }, "Carto (image, emphasized)"),
h(LinkItem, { to: "all-maps" }, "All maps"),
]),
Expand Down
11 changes: 6 additions & 5 deletions src/_utils/map-layers.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ export function LineSymbolManager({ showLineSymbols }) {
return null;
}

export function buildRasterStyle(layer: MacrostratRasterTileset) {
const tileDomain = "https://tiles.macrostrat.org";

let tileURL = tileDomain + `/${layer}/{z}/{x}/{y}.png`;

export function buildRasterStyle(layer: MacrostratRasterTileset | string) {
let tileURL = layer;
if (!tileURL.startsWith("http")) {
const tileDomain = "https://tiles.macrostrat.org";
tileURL = tileDomain + `/${layer}/{z}/{x}/{y}.png`;
}
// if (layer == MacrostratRasterTileset.Emphasized) {
// tileURL = `https://next.macrostrat.org/tiles/tiles/carto/{z}/{x}/{y}.png`;
// }
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ export default defineConfig({
CESIUM_BASE_URL: JSON.stringify("/cesium"),
// If not building for server context
},
server: {
allowedHosts: ["localhost", "dev.macrostrat.local"],
},
ssr: {
noExternal: [
/** All dependencies that cannot be bundled on the server (e.g., due to CSS imports)
Expand Down