Skip to content

Commit 1e2bf7d

Browse files
committed
Merge branch 'main' of https://github.com/UW-Macrostrat/web
* 'main' of https://github.com/UW-Macrostrat/web: Improve raster tiling examples
2 parents 89ffeee + c04461c commit 1e2bf7d

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

pages/dev/map/layers/@layer/+data.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
MacrostratVectorTileset,
66
} from "~/_utils/map-layers";
77
import { render } from "vike/abort";
8+
import { tileserverDomain } from "@macrostrat-web/settings";
89

910
export async function data(pageContext: PageContextServer) {
1011
const config = useConfig();
@@ -66,10 +67,16 @@ const layerIndex: LayerInfo[] = [
6667
},
6768
{
6869
slug: "carto-raster",
69-
tileset: MacrostratRasterTileset.Carto,
70+
tileset: tileserverDomain + "/legacy/carto/{z}/{x}/{y}.png", //?cache=bypass",
7071
type: "raster",
7172
title: "Carto (raster)",
7273
},
74+
{
75+
slug: "carto-raster-v1",
76+
tileset: "https://tiles.macrostrat.org/carto/{z}/{x}/{y}.png",
77+
type: "raster",
78+
title: "Carto (raster, v1)",
79+
},
7380
{
7481
slug: "emphasized",
7582
tileset: MacrostratRasterTileset.Emphasized,

pages/dev/map/layers/index/+Page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function Page() {
1212
h(LinkItem, { to: "carto-v1" }, "Carto (v1)"),
1313
h(LinkItem, { to: "carto-slim-v1" }, "Carto (slim, v1)"),
1414
h(LinkItem, { to: "carto-raster" }, "Carto (image)"),
15+
h(LinkItem, { to: "carto-raster-v1" }, "Carto (image, v1)"),
1516
h(LinkItem, { to: "emphasized" }, "Carto (image, emphasized)"),
1617
h(LinkItem, { to: "all-maps" }, "All maps"),
1718
]),

src/_utils/map-layers.client.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ export function LineSymbolManager({ showLineSymbols }) {
7878
return null;
7979
}
8080

81-
export function buildRasterStyle(layer: MacrostratRasterTileset) {
82-
const tileDomain = "https://tiles.macrostrat.org";
83-
84-
let tileURL = tileDomain + `/${layer}/{z}/{x}/{y}.png`;
85-
81+
export function buildRasterStyle(layer: MacrostratRasterTileset | string) {
82+
let tileURL = layer;
83+
if (!tileURL.startsWith("http")) {
84+
const tileDomain = "https://tiles.macrostrat.org";
85+
tileURL = tileDomain + `/${layer}/{z}/{x}/{y}.png`;
86+
}
8687
// if (layer == MacrostratRasterTileset.Emphasized) {
8788
// tileURL = `https://next.macrostrat.org/tiles/tiles/carto/{z}/{x}/{y}.png`;
8889
// }

vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ export default defineConfig({
113113
CESIUM_BASE_URL: JSON.stringify("/cesium"),
114114
// If not building for server context
115115
},
116+
server: {
117+
allowedHosts: ["localhost", "dev.macrostrat.local"],
118+
},
116119
ssr: {
117120
noExternal: [
118121
/** All dependencies that cannot be bundled on the server (e.g., due to CSS imports)

0 commit comments

Comments
 (0)