-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Finish Map Styling in Protomaps #20
Comments
I have almost completed the styling of the Protomaps with the QTM colour scheme ~ will pop the code in here once it is finished. @nielsbom the only thing I could not figure out is adding the sprites for the metro systems to the map. Would you be able to help me with this? |
@queeringthemap, have you asked about the metro sprites on the Protomaps slack channel? |
Lucas and I will look at the metro sprites together (right now). |
I just asked in the maplibre-gl-js thread, and Ni and I were working on this this morning. Have almost got a .json file finished that can be used for the PMTiles instance, yahoo! |
Great. Will we host that .json in this repo? |
After some flailing of mine yesterday I discovered today that there's a tool for creating styles: https://maplibre.org/maputnik/ (https://github.com/maplibre/maputnik). How it works exactly, esp around sources is not clear to me yet. But I'll dive into that more tomorrow. |
Yes, because it's part of the configuration we do in the browser. Example: const map = new maplibregl.Map({
container: 'map',
style: // This here
'https://api.maptiler.com/maps/streets/style.json?key=get_your_own',
center: [12.550343, 55.665957],
zoom: 8
}); |
I've learned a lot today about MapLibre styling. If helpful I can add some notes to Notion. Styling in MapLibre GL JS is not just styling. Very short:
So to style (verb) the map we need to have both 1..n sources and then let the layers (which contain most of the design) use those sources. What nowThe styling file that Lucas worked on (and I helped a bit with) unfortunately doesn't load in Maputnik. That work was based on this code. I'm gonna see if I can use the sources that are currently used on https://queeringthemap.netlify.app/. And then when we have a tileserver running somewhere we can switch to that. The tileserver does not need to generate the data we're styling tho 😃. |
So what I'm (slowly) doing now is:
I'm probably gonna work on it tomorrow a bit too. qtm_generate_styles.jsconst t = {
background: "#ecbfd7",
earth: "#ecbfd7",
park_a: "#B8C08C",
park_b: "#B8C08C",
hospital: "#e4dad9",
industrial: "#dd89b7",
school: "#e4ded7",
wood_a: "#B8C08C",
wood_b: "#B8C08C",
pedestrian: "#e3e0d4",
scrub_a: "#B8C08C",
scrub_b: "#B8C08C",
glacier: "#FFE5F3",
sand: "#FFE5F3",
beach: "#e8e4d0",
aerodrome: "#dadbdf",
runway: "#e9e9ed",
water: "#788BF2",
pier: "#e0e0e0",
zoo: "#c6dcdc",
military: "#dcdcdc",
tunnel_other_casing: "#e0e0e0",
tunnel_minor_casing: "#e0e0e0",
tunnel_link_casing: "#e0e0e0",
tunnel_medium_casing: "#e0e0e0",
tunnel_major_casing: "#e0e0e0",
tunnel_highway_casing: "#e0e0e0",
tunnel_other: "#d5d5d5",
tunnel_minor: "#d5d5d5",
tunnel_link: "#d5d5d5",
tunnel_medium: "#d5d5d5",
tunnel_major: "#d5d5d5",
tunnel_highway: "#d5d5d5",
transit_pier: "#e0e0e0",
buildings: "#f2a0cd",
minor_service_casing: "#e0e0e0",
minor_casing: "#f2a0cd",
link_casing: "#e0e0e0",
medium_casing: "#e0e0e0",
major_casing_late: "#e0e0e0",
highway_casing_late: "#e88749",
other: "#ebebeb",
minor_service: "#F3D8E9",
minor_a: "#F3D8E9",
minor_b: "#F3D8E9",
link: "#ffffff",
medium: "#f5f5f5",
major_casing_early: "#e0e0e0",
major: "#ffffff",
highway_casing_early: "#e88749",
highway: "#fcc68d",
railway: "red",
boundaries: "#adadad",
waterway_label: "#ffffff",
bridges_other_casing: "#e0e0e0",
bridges_minor_casing: "#e0e0e0",
bridges_link_casing: "#e0e0e0",
bridges_medium_casing: "#e0e0e0",
bridges_major_casing: "#e0e0e0",
bridges_highway_casing: "#e0e0e0",
bridges_other: "#ebebeb",
bridges_minor: "#ffffff",
bridges_link: "#ffffff",
bridges_medium: "#f0eded",
bridges_major: "#f5f5f5",
bridges_highway: "#ffffff",
roads_label_minor: "#974367",
roads_label_minor_halo: "#F3D8E9",
roads_label_major: "#000000",
roads_label_major_halo: "#ffffff",
ocean_label: "#ffffff",
peak_label: "#7e9aa0",
subplace_label: "#974367",
subplace_label_halo: "#F3D8E9",
city_circle: "#ffffff",
city_circle_stroke: "#a3a3a3",
city_label: "#000000",
city_label_halo: "#e0e0e0",
state_label: "#000000",
state_label_halo: "#e0e0e0",
country_label: "#000000",
};
const source = "maplibre";
const style = {
version: 8,
name: "qtm",
layers: [
{
id: "background",
type: "background",
paint: {
"background-color": t.background,
},
},
{
id: "earth",
type: "fill",
source: source,
"source-layer": "earth",
paint: {
"fill-color": t.earth,
},
},
{
id: "landuse_park",
type: "fill",
source: source,
"source-layer": "landuse",
filter: [
"any",
[
"in",
"pmap:kind",
"national_park",
"park",
"cemetery",
"protected_area",
"nature_reserve",
"forest",
"golf_course",
],
],
paint: {
"fill-color": [
"interpolate",
["linear"],
["zoom"],
0,
t.park_a,
12,
t.park_b,
],
},
},
{
id: "landuse_urban_green",
type: "fill",
source: source,
"source-layer": "landuse",
filter: [
"any",
["in", "pmap:kind", "allotments", "village_green", "playground"],
],
paint: {
"fill-color": t.park_b,
"fill-opacity": 0.7,
},
},
{
id: "landuse_hospital",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["==", "pmap:kind", "hospital"]],
paint: {
"fill-color": t.hospital,
},
},
{
id: "landuse_industrial",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["==", "pmap:kind", "industrial"]],
paint: {
"fill-color": t.industrial,
},
},
{
id: "landuse_school",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["in", "pmap:kind", "school", "university", "college"]],
paint: {
"fill-color": t.school,
},
},
{
id: "landuse_beach",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["in", "pmap:kind", "beach"]],
paint: {
"fill-color": t.beach,
},
},
{
id: "landuse_zoo",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["in", "pmap:kind", "zoo"]],
paint: {
"fill-color": t.zoo,
},
},
{
id: "landuse_military",
type: "fill",
source: source,
"source-layer": "landuse",
filter: [
"any",
["in", "pmap:kind", "military", "naval_base", "airfield"],
],
paint: {
"fill-color": t.zoo,
},
},
{
id: "natural_wood",
type: "fill",
source: source,
"source-layer": "natural",
filter: ["any", ["in", "pmap:kind", "wood", "nature_reserve", "forest"]],
paint: {
"fill-color": [
"interpolate",
["linear"],
["zoom"],
0,
t.wood_a,
12,
t.wood_b,
],
},
},
{
id: "natural_scrub",
type: "fill",
source: source,
"source-layer": "natural",
filter: ["in", "pmap:kind", "scrub", "grassland", "grass"],
paint: {
"fill-color": [
"interpolate",
["linear"],
["zoom"],
0,
t.scrub_a,
12,
t.scrub_b,
],
},
},
{
id: "natural_glacier",
type: "fill",
source: source,
"source-layer": "natural",
filter: ["==", "pmap:kind", "glacier"],
paint: {
"fill-color": t.glacier,
},
},
{
id: "natural_sand",
type: "fill",
source: source,
"source-layer": "natural",
filter: ["==", "pmap:kind", "sand"],
paint: {
"fill-color": t.sand,
},
},
{
id: "landuse_aerodrome",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["in", "pmap:kind", "aerodrome"]],
paint: {
"fill-color": t.aerodrome,
},
},
{
id: "transit_runway",
type: "line",
source: source,
"source-layer": "transit",
filter: ["any", ["in", "pmap:kind_detail", "runway"]],
paint: {
"line-color": t.runway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
10,
0,
12,
4,
18,
30,
],
},
},
{
id: "transit_taxiway",
type: "line",
source: source,
"source-layer": "transit",
minzoom: 13,
filter: ["any", ["in", "pmap:kind_detail", "taxiway"]],
paint: {
"line-color": t.runway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
15,
6,
],
},
},
// {
// id: "landuse_runway",
// type: "fill",
// source: source,
// "source-layer": "landuse",
// minzoom: 14,
// filter: [
// "any",
// ["in", "pmap:kind_detail", "runway", "taxiway"],
// ],
// paint: {
// "fill-color": t.runway,
// },
// },
{
id: "water",
type: "fill",
source: source,
"source-layer": "water",
paint: {
"fill-color": t.water,
},
},
{
id: "physical_line_stream",
type: "line",
source: source,
"source-layer": "physical_line",
minzoom: 14,
filter: ["all", ["in", "pmap:kind", "stream"]],
paint: {
"line-color": t.water,
"line-width": 0.5,
},
},
{
id: "physical_line_river",
type: "line",
source: source,
"source-layer": "physical_line",
minzoom: 9,
filter: ["all", ["in", "pmap:kind", "river"]],
paint: {
"line-color": t.water,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1.0,
18,
12,
],
},
},
{
id: "landuse_pedestrian",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["==", "pmap:kind", "pedestrian"]],
paint: {
"fill-color": t.pedestrian,
},
},
{
id: "landuse_pier",
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["any", ["==", "pmap:kind", "pier"]],
paint: {
"fill-color": t.pier,
},
},
{
id: "roads_tunnels_other_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["in", "pmap:kind", "other", "path"],
],
paint: {
"line-color": t.tunnel_other_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7,
],
},
},
{
id: "roads_tunnels_minor_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
],
paint: {
"line-color": t.tunnel_minor_casing,
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1,
],
},
},
{
id: "roads_tunnels_link_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: ["all", ["<", "pmap:level", 0], ["==", "pmap:link", 1]],
paint: {
"line-color": t.tunnel_link_casing,
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1,
],
},
},
{
id: "roads_tunnels_medium_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.tunnel_medium_casing,
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
0.5,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
10,
0,
10.5,
1,
],
},
},
{
id: "roads_tunnels_major_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.tunnel_major_casing,
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
0.5,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1,
],
},
},
{
id: "roads_tunnels_highway_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.tunnel_highway_casing,
"line-dasharray": [6, 0.5],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
3.5,
0.5,
18,
15,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
1,
20,
15,
],
},
},
{
id: "roads_tunnels_other",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["in", "pmap:kind", "other", "path"],
],
paint: {
"line-color": t.tunnel_other,
"line-dasharray": [4.5, 0.5],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7,
],
},
},
{
id: "roads_tunnels_minor",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
],
paint: {
"line-color": t.tunnel_minor,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
},
},
{
id: "roads_tunnels_link",
type: "line",
source: source,
"source-layer": "roads",
filter: ["all", ["<", "pmap:level", 0], ["==", "pmap:link", 1]],
paint: {
"line-color": t.tunnel_minor,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
},
},
{
id: "roads_tunnels_medium",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.tunnel_medium,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
12,
1.2,
15,
3,
18,
13,
],
},
},
{
id: "roads_tunnels_major",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.tunnel_major,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
6,
0,
12,
1.6,
15,
3,
18,
13,
],
},
},
{
id: "roads_tunnels_highway",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["<", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.tunnel_highway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
6,
1.1,
12,
1.6,
15,
5,
18,
15,
],
},
},
{
id: "buildings",
type: "fill",
source: source,
"source-layer": "buildings",
paint: {
"fill-color": t.buildings,
"fill-opacity": 0.5,
},
},
{
id: "transit_pier",
type: "line",
source: source,
"source-layer": "transit",
filter: ["any", ["==", "pmap:kind", "pier"]],
paint: {
"line-color": t.transit_pier,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
0.5,
20,
16,
],
},
},
{
id: "roads_minor_service_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 13,
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
["==", "pmap:kind_detail", "service"],
],
paint: {
"line-color": t.minor_service_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
18,
8,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
0.8,
],
},
},
{
id: "roads_minor_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
["!=", "pmap:kind_detail", "service"],
],
paint: {
"line-color": t.minor_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1,
],
},
},
{
id: "roads_link_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 13,
filter: ["all", ["==", "pmap:link", 1]],
paint: {
"line-color": t.minor_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1.5,
],
},
},
{
id: "roads_medium_casing",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.medium_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
12,
1.2,
15,
3,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
10,
0,
10.5,
1.5,
],
},
},
{
id: "roads_major_casing_late",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.major_casing_late,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
6,
0,
12,
1.6,
15,
3,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1,
],
},
},
{
id: "roads_highway_casing_late",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.highway_casing_late,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
3.5,
0.5,
18,
15,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
1,
20,
15,
],
},
},
{
id: "roads_other",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["in", "pmap:kind", "other", "path"],
],
paint: {
"line-color": t.other,
"line-dasharray": [3, 1],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7,
],
},
},
{
id: "roads_link",
type: "line",
source: source,
"source-layer": "roads",
filter: ["all", ["==", "pmap:link", 1]],
paint: {
"line-color": t.link,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
},
},
{
id: "roads_minor_service",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
["==", "pmap:kind_detail", "service"],
],
paint: {
"line-color": t.minor_service,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
18,
8,
],
},
},
{
id: "roads_minor",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
["!=", "pmap:kind_detail", "service"],
],
paint: {
"line-color": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
t.minor_a,
16,
t.minor_b,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
},
},
{
id: "roads_medium",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.medium,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
12,
1.2,
15,
3,
18,
13,
],
},
},
{
id: "roads_major_casing_early",
type: "line",
source: source,
"source-layer": "roads",
maxzoom: 12,
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.major_casing_early,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
0.5,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1,
],
},
},
{
id: "roads_major",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.major,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
6,
0,
12,
1.6,
15,
3,
18,
13,
],
},
},
{
id: "roads_highway_casing_early",
type: "line",
source: source,
"source-layer": "roads",
maxzoom: 12,
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.highway_casing_early,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
3.5,
0.5,
18,
15,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
1,
],
},
},
{
id: "roads_highway",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
["==", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.highway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
6,
1.1,
12,
1.6,
15,
5,
18,
15,
],
},
},
{
id: "transit_railway",
type: "line",
source: source,
"source-layer": "transit",
filter: ["all", ["==", "pmap:kind", "rail"]],
paint: {
"line-dasharray": [0.3, 0.75],
"line-opacity": 0.5,
"line-color": t.railway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
6,
0.15,
18,
9,
],
},
},
// {
// id: "transit_railway_tracks",
// type: "line",
// source: source,
// "source-layer": "transit",
// filter: ["all", ["==", "pmap:kind", "rail"]],
// paint: {
// "line-color": t.railway_tracks,
// "line-width": 0.8,
// "line-dasharray": [6, 10],
// },
// },
{
id: "boundaries_country",
type: "line",
source: source,
"source-layer": "boundaries",
filter: ["<=", "pmap:min_admin_level", 2],
paint: {
"line-color": t.boundaries,
"line-width": 1,
"line-dasharray": [3, 2],
},
},
{
id: "boundaries",
type: "line",
source: source,
"source-layer": "boundaries",
filter: [">", "pmap:min_admin_level", 2],
paint: {
"line-color": t.boundaries,
"line-width": 0.5,
"line-dasharray": [3, 2],
},
},
{
id: "roads_bridges_other_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["in", "pmap:kind", "other", "path"],
],
paint: {
"line-color": t.bridges_other_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7,
],
},
},
{
id: "roads_bridges_link_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: ["all", [">", "pmap:level", 0], ["==", "pmap:link", 1]],
paint: {
"line-color": t.bridges_minor_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1.5,
],
},
},
{
id: "roads_bridges_minor_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
],
paint: {
"line-color": t.bridges_minor_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
0.8,
],
},
},
{
id: "roads_bridges_medium_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.bridges_medium_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
12,
1.2,
15,
3,
18,
13,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
10,
0,
10.5,
1.5,
],
},
},
{
id: "roads_bridges_major_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.bridges_major_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
0.5,
18,
10,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1.5,
],
},
},
// {
// id: "roads_bridges_highway_casing",
// type: "line",
// source: source,
// "source-layer": "roads",
// minzoom: 12,
// filter: ["all", [">", "pmap:level", 0], ["==", "pmap:kind", "highway"], ["!=", "pmap:link", 1]],
// paint: {
// "line-color": t.bridges_highway_casing,
// "line-gap-width": [
// "interpolate",
// ["exponential", 1.6],
// ["zoom"],
// 3,
// 0,
// 3.5,
// 0.5,
// 18,
// 32,
// ],
// "line-width": [
// "interpolate",
// ["exponential", 1.6],
// ["zoom"],
// 7,
// 0,
// 7.5,
// 1,
// ],
// },
// layout: {
// visibility: casingVisibility,
// },
// },
{
id: "roads_bridges_other",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["in", "pmap:kind", "other", "path"],
],
paint: {
"line-color": t.bridges_other,
"line-dasharray": [2, 1],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7,
],
},
},
{
id: "roads_bridges_minor",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "minor_road"],
],
paint: {
"line-color": t.bridges_minor,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11,
],
},
},
{
id: "roads_bridges_link",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: ["all", [">", "pmap:level", 0], ["==", "pmap:link", 1]],
paint: {
"line-color": t.bridges_minor,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11,
],
},
},
{
id: "roads_bridges_medium",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "medium_road"],
],
paint: {
"line-color": t.bridges_medium,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
12,
1.2,
15,
3,
18,
13,
],
},
},
{
id: "roads_bridges_major",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "major_road"],
],
paint: {
"line-color": t.bridges_major,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
6,
0,
12,
1.6,
15,
3,
18,
13,
],
},
},
{
id: "roads_bridges_highway_casing",
type: "line",
source: source,
"source-layer": "roads",
minzoom: 12,
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.bridges_highway_casing,
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
3.5,
0.5,
18,
15,
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
1,
20,
15,
],
},
},
{
id: "roads_bridges_highway",
type: "line",
source: source,
"source-layer": "roads",
filter: [
"all",
[">", "pmap:level", 0],
["==", "pmap:kind", "highway"],
["!=", "pmap:link", 1],
],
paint: {
"line-color": t.bridges_highway,
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
6,
1.1,
12,
1.6,
15,
5,
18,
15,
],
},
},
],
sources: {
maplibre: {
url: "https://demotiles.maplibre.org/tiles/tiles.json",
type: "vector",
},
},
};
console.log(JSON.stringify(style)); |
Wow, what an adventure! And all for a few icons of metro stations 🚂 |
Have the styling 95% finished, in the correct format: Still remaining is:
![]() |
2 is now solved :) |
I guess the image you're showing for 3 is made through Maputnik? I'm not familiar with it as a tool but looking at it, it doesn't look like it's pulling in a leisure layer. And for some reason it doesn't look like it's an option to add a 'leisure' layer from the input options. So 3 might be more a feature of Maputnik than an issue with your json. |
a fabulous idea, i like it better than the current one ;) |
the image is being pulled through the Sprite source layer, so I think it can be customized, I just have to figure out how to make my own sprite sheet. |
hmm so if it is a Maputnik issue, do you think it will display the parks correctly once it is live via the json? |
This week I'll move the tiles to use the free tier of Protomaps while we are developing and we can find out :) |
Amazing, thank you :)
|
I've configured Cloudflare to allow requests from MapLibre.org (for now) so we can use Maputnik to edit the styles with the right datasource. To do this in Maputnik:
|
The branch for PR #33 now uses the new tileserver, so that branch can now be used to develop the |
I did a first LLM-based adaption of @queeringthemap's qtm_styles_april24_morning.json to follow the style spec required from Protomaps: style.json. There are a bunch of things it didn't carry over correctly but it is a start and will probably be a better point to continue from, using Maputnik. |
I worked with Lucas today, gave them a high level overview of how Maplibre is connected to the style file and the PMTiles Cloudflare business. We also looked at how to explore and style the source layers that the PMTiles provide. The step-by-step process for styling is:
Lucas now feels enlightened and empowered and is roaring to apply the styles to the PMTiles. They'll drop the updated styles here. |
Thanks for collecting and making sense of all of that information. Love having a diagram for this too! Would be great to include one with mermaid.js in the documentation. |
Hiya! Almost finished with all of the polygons and lines in the new style :) I am having trouble figuring out how to add the labels (for countries, roads, etc) from the Protomaps documentation. Do you know how this is done? |
I don't know but I can help figure it out tomorrow. |
Oh and please drop any progress here pls, then I can work with that. |
here is where I am at so far! Going to continue adding details tomorrow, but dropping this here now for progress~ |
Hey nice, looking good! I've added this WIP to the branch and consequently the PR. |
Thanks! Here is a new version of the .json file: A few issues I am having:
|
Hi!
This is because under "Text layout properties" you set it to interpolate from zoomlevel 7. Changing that to 4 will show city names at zoomlevel 4.
I think the best way to do this is with an expression. Click the expression icon ( As an example I think this is the JSON that says "if there's an {name:en} use that, else use {name}": ["string", ["get", "name:en"], ["get", "name"]]
Jo and I noticed this too. I'll investigate, I'll put a bit of time into that Friday morning. |
My solution in the previous comment wrt |
Can we split this into separate issues to help track what's going on here? It seems to be tracking a few different things at the moment. |
Update on the sprite styling: #31 (comment) |
The " |
I've created #50 for PMTiles tiles speed. I don't think there are other open (sub-)issues flowing out of this issue right now. |
here is the final .json, with everything working well :) |
Do you want to commit this to the pull request #33? I can do it but thought you might like to claim all of that work with a commit in your name :) |
No description provided.
The text was updated successfully, but these errors were encountered: