Skip to content

Commit 2eade52

Browse files
authored
Merge pull request #5 from 0PandaDEV/main
feat: add gray flavor and update dependencies
2 parents 8c57c58 + 52fc200 commit 2eade52

File tree

3 files changed

+116
-14
lines changed

3 files changed

+116
-14
lines changed

app/App.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import maplibregl from "maplibre-gl";
55
import { StyleSpecification } from "maplibre-gl";
66
import { Flavor, layers } from "@protomaps/basemaps";
77

8-
const FLAVORS = ["bio", "dusk_rose", "iris_bloom","rainforest", "seafoam"];
8+
const FLAVORS = ["bio", "dusk_rose", "iris_bloom","rainforest", "seafoam", "flat"];
99

1010
const nameToFlavor = new Map<string, Flavor>();
1111

@@ -19,15 +19,18 @@ import seafoam from "../flavors/seafoam.ts";
1919
nameToFlavor.set("seafoam", seafoam);
2020

2121
// import sol from "../flavors/sol.ts";
22-
// themeToLayers.set("sol", sol);
22+
// nameToFlavor.set("sol", sol);
23+
24+
import flat from "../flavors/flat.ts";
25+
nameToFlavor.set("flat", flat);
2326

2427
import dusk_rose from "../flavors/dusk_rose.ts";
2528
nameToFlavor.set("dusk_rose", dusk_rose);
2629

2730
import rainforest from "../flavors/rainforest.ts";
2831
nameToFlavor.set("rainforest", rainforest);
2932

30-
const getStyle = (index: number, showLabels: boolean):StyleSpecification => {
33+
const getStyle = (index: number, showLabels: boolean): StyleSpecification => {
3134
let flavorName = FLAVORS[index];
3235
return {
3336
version: 8,
@@ -39,13 +42,13 @@ const getStyle = (index: number, showLabels: boolean):StyleSpecification => {
3942
url: "https://api.protomaps.com/tiles/v4.json?key=1003762824b9687f",
4043
},
4144
},
42-
layers: layers("protomaps", nameToFlavor.get(flavorName)!, {lang: showLabels ? "en" : undefined}),
45+
layers: layers("protomaps", nameToFlavor.get(flavorName)!, { lang: showLabels ? "en" : undefined }),
4346
};
4447
};
4548

46-
const FlavorRow: Component<{name: string, flavor: Flavor}> = (props) => {
49+
const FlavorRow: Component<{ name: string, flavor: Flavor }> = (props) => {
4750
return (
48-
<div class="flavorRow" style={{"background-color":props.flavor.background,"color":props.flavor.city_label}}>
51+
<div class="flavorRow" style={{ "background-color": props.flavor.background, "color": props.flavor.city_label }}>
4952
{props.name}
5053
</div>
5154
)
@@ -65,12 +68,12 @@ function App() {
6568

6669
map = new maplibregl.Map({
6770
container: "map",
68-
style: getStyle(selectedIndex(),showLabels()),
71+
style: getStyle(selectedIndex(), showLabels()),
6972
});
7073
});
7174

7275
createEffect(() => {
73-
map.setStyle(getStyle(selectedIndex(),showLabels()));
76+
map.setStyle(getStyle(selectedIndex(), showLabels()));
7477
});
7578

7679
const selectFlavor = (i: number) => {

flavors/flat.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import { Flavor } from "@protomaps/basemaps";
2+
3+
export default <Flavor>{
4+
background: "#2e2e2e",
5+
earth: "#2e2e2e",
6+
park_a: "#383838",
7+
park_b: "#383838",
8+
hospital: "#404040",
9+
industrial: "#383838",
10+
school: "#404040",
11+
wood_a: "#383838",
12+
wood_b: "#383838",
13+
pedestrian: "#404040",
14+
scrub_a: "#2e2e2e",
15+
scrub_b: "#2e2e2e",
16+
glacier: "#666666",
17+
sand: "#404040",
18+
beach: "#404040",
19+
aerodrome: "#383838",
20+
runway: "#666666",
21+
water: "#1d1d1d",
22+
zoo: "#383838",
23+
military: "#383838",
24+
25+
tunnel_other_casing: "#2e2e2e",
26+
tunnel_minor_casing: "#2e2e2e",
27+
tunnel_link_casing: "#2e2e2e",
28+
tunnel_major_casing: "#2e2e2e",
29+
tunnel_highway_casing: "#2e2e2e",
30+
tunnel_other: "#454545",
31+
tunnel_minor: "#454545",
32+
tunnel_link: "#454545",
33+
tunnel_major: "#4b4b4b",
34+
tunnel_highway: "#494949",
35+
36+
pier: "#2e2e2e",
37+
buildings: "#525252",
38+
39+
minor_service_casing: "#2e2e2e",
40+
minor_casing: "#2e2e2e",
41+
link_casing: "#2e2e2e",
42+
major_casing_late: "#2e2e2e",
43+
highway_casing_late: "#2e2e2e",
44+
other: "#454545",
45+
minor_service: "#454545",
46+
minor_a: "#454545",
47+
minor_b: "#454545",
48+
link: "#454545",
49+
major_casing_early: "#2e2e2e",
50+
major: "#4b4b4b",
51+
highway_casing_early: "#2e2e2e",
52+
highway: "#494949",
53+
54+
railway: "#737373",
55+
boundaries: "#999999",
56+
waterway_label: "#b3b3b3",
57+
58+
bridges_other_casing: "#2e2e2e",
59+
bridges_minor_casing: "#2e2e2e",
60+
bridges_link_casing: "#2e2e2e",
61+
bridges_major_casing: "#2e2e2e",
62+
bridges_highway_casing: "#2e2e2e",
63+
bridges_other: "#454545",
64+
bridges_minor: "#454545",
65+
bridges_link: "#454545",
66+
bridges_major: "#4b4b4b",
67+
bridges_highway: "#494949",
68+
69+
roads_label_minor: "#e6e6e6",
70+
roads_label_minor_halo: "#262626",
71+
roads_label_major: "#e6e6e6",
72+
roads_label_major_halo: "#262626",
73+
ocean_label: "#b3b3b3",
74+
peak_label: "#d9d9d9",
75+
subplace_label: "#d9d9d9",
76+
subplace_label_halo: "#262626",
77+
city_label: "#f2f2f2",
78+
city_label_halo: "#262626",
79+
state_label: "#b3b3b3",
80+
state_label_halo: "#262626",
81+
country_label: "#b3b3b3",
82+
83+
regular: "Roboto Regular",
84+
bold: "Roboto Medium",
85+
italic: "Roboto Italic",
86+
87+
landcover: {
88+
grassland: "#323232",
89+
barren: "#323232",
90+
urban_area: "#323232",
91+
farmland: "#323232",
92+
glacier: "#323232",
93+
scrub: "#323232",
94+
forest: "#323232",
95+
},
96+
97+
address_label: "#d9d9d9",
98+
address_label_halo: "#262626",
99+
};

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"build-ghpages": "tsc -b && vite build --base=/basemaps-flavors/"
1111
},
1212
"dependencies": {
13-
"maplibre-gl": "^5.3.0",
14-
"@protomaps/basemaps": "5.1.0",
15-
"solid-js": "^1.9.5"
13+
"maplibre-gl": "5.4.0",
14+
"@protomaps/basemaps": "5.3.0",
15+
"solid-js": "1.9.5"
1616
},
1717
"devDependencies": {
18-
"typescript": "~5.6.2",
19-
"vite": "^5.4.16",
20-
"vite-plugin-solid": "^2.10.2"
18+
"typescript": "5.8.3",
19+
"vite": "6.3.3",
20+
"vite-plugin-solid": "2.11.6"
2121
}
2222
}

0 commit comments

Comments
 (0)