Skip to content

Commit

Permalink
bump basemap style to v3 [#49] (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored May 30, 2024
1 parent 658c75b commit bc8f97d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"fflate": "^0.7.3",
"maplibre-gl": "3.3.1",
"pbf": "^3.2.1",
"protomaps-themes-base": "2.0.0-alpha.1",
"protomaps-themes-base": "3.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-dropzone": "^14.1.1",
Expand Down
7 changes: 5 additions & 2 deletions app/src/MaplibreMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Protocol } from "../../js/adapters";
import { PMTiles, TileType } from "../../js/index";
import { styled } from "./stitches.config";

const BASEMAP_THEME = "black";

const INITIAL_ZOOM = 0;
const INITIAL_LNG = 0;
const INITIAL_LAT = 0;
Expand Down Expand Up @@ -194,7 +196,7 @@ const rasterStyle = async (file: PMTiles): Promise<StyleSpecification> => {
let layers: LayerSpecification[] = [];

if (metadata.type !== "baselayer") {
layers = baseTheme("basemap", "black");
layers = baseTheme("basemap", BASEMAP_THEME);
}

layers.push({
Expand All @@ -220,6 +222,7 @@ const rasterStyle = async (file: PMTiles): Promise<StyleSpecification> => {
},
},
glyphs: "https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf",
sprite: `https://protomaps.github.io/basemaps-assets/sprites/v3/${BASEMAP_THEME}`,
layers: layers,
};
};
Expand All @@ -236,7 +239,7 @@ const vectorStyle = async (
let baseOpacity = 0.35;

if (metadata.type !== "baselayer") {
layers = baseTheme("basemap", "black");
layers = baseTheme("basemap", BASEMAP_THEME);
baseOpacity = 0.9;
}

Expand Down

0 comments on commit bc8f97d

Please sign in to comment.