Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace cdn.protomaps.com fonts with github pages [#41] #169

Merged
merged 2 commits into from Nov 1, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/MapViewComponent.tsx
Expand Up @@ -77,7 +77,8 @@ function getMaplibreStyle(
} as StyleSpecification;
if (!tiles) return style;
style.layers = [];
style.glyphs = "https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf";
style.glyphs =
"https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf";

if (droppedArchive) {
style.sources = {
Expand Down
3 changes: 2 additions & 1 deletion app/src/VisualTestsComponent.tsx
Expand Up @@ -50,7 +50,8 @@ const createMap = (
version: 8,
center: center,
zoom: zoom,
glyphs: "https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf",
glyphs:
"https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf",
sources: {
protomaps: {
type: "vector",
Expand Down
24 changes: 12 additions & 12 deletions styles/src/base_layers.ts
Expand Up @@ -1631,7 +1631,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
filter: ["all", ["in", "pmap:kind", "river", "stream"]],
layout: {
"symbol-placement": "line",
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-field": ["get", "name"],
"text-size": 12,
"text-letter-spacing": 0.3,
Expand All @@ -1647,7 +1647,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
"source-layer": "physical_point",
filter: ["any", ["==", "pmap:kind", "peak"]],
layout: {
"text-font": ["Roboto Italic"],
"text-font": ["Sans Italic"],
"text-field": ["get", "name"],
"text-size": ["interpolate", ["linear"], ["zoom"], 10, 8, 16, 12],
"text-letter-spacing": 0.1,
Expand All @@ -1668,7 +1668,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
layout: {
"symbol-sort-key": ["get", "pmap:min_zoom"],
"symbol-placement": "line",
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-field": ["get", "name"],
"text-size": 12,
},
Expand Down Expand Up @@ -1721,7 +1721,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
],
],
layout: {
"text-font": ["Roboto Medium"],
"text-font": ["Sans Medium"],
"text-field": ["get", "name"],
"text-size": ["interpolate", ["linear"], ["zoom"], 3, 10, 10, 12],
"text-letter-spacing": 0.1,
Expand All @@ -1739,7 +1739,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
"source-layer": "physical_point",
filter: ["any", ["in", "pmap:kind", "lake", "water"]],
layout: {
"text-font": ["Roboto Medium"],
"text-font": ["Sans Medium"],
"text-field": ["get", "name"],
"text-size": ["interpolate", ["linear"], ["zoom"], 3, 0, 6, 12, 10, 12],
"text-letter-spacing": 0.1,
Expand All @@ -1762,7 +1762,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
layout: {
"symbol-sort-key": ["get", "pmap:min_zoom"],
"symbol-placement": "line",
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-field": ["get", "name"],
"text-size": 12,
},
Expand All @@ -1781,7 +1781,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
layout: {
"symbol-sort-key": ["get", "pmap:min_zoom"],
"text-field": "{name}",
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-max-width": 7,
"text-letter-spacing": 0.1,
"text-padding": [
Expand Down Expand Up @@ -1824,7 +1824,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
filter: ["any", ["<", ["get", "pmap:min_zoom"], 13]],
layout: {
"symbol-sort-key": ["get", "pmap:min_zoom"],
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-field": ["get", "name"],
"text-size": 11,
"text-max-width": 9,
Expand Down Expand Up @@ -1876,8 +1876,8 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
"text-font": [
"case",
["<=", ["get", "pmap:min_zoom"], 5],
["literal", ["Roboto Medium"]],
["literal", ["Roboto Regular"]],
["literal", ["Sans Medium"]],
["literal", ["Sans Regular"]],
],
"text-padding": [
"interpolate",
Expand Down Expand Up @@ -1988,7 +1988,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
5,
["get", "name"],
],
"text-font": ["Roboto Regular"],
"text-font": ["Sans Regular"],
"text-size": ["interpolate", ["linear"], ["zoom"], 3, 11, 7, 24],
"text-radial-offset": 0.2,
"text-anchor": "center",
Expand All @@ -2009,7 +2009,7 @@ export function labels_layers(source: string, t: Theme): LayerSpecification[] {
layout: {
"symbol-sort-key": ["get", "pmap:min_zoom"],
"text-field": "{name}",
"text-font": ["Roboto Medium"],
"text-font": ["Sans Medium"],
"text-size": [
"interpolate",
["linear"],
Expand Down