Closed queeringthemap closed 4 months ago
@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.
Great. Will we host that .json in this repo?
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:
index.html
loads script.js
script.js
tells MapLibre GL JS to use a "style file" (in this case style.json
)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.
The 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:
style.json
work in progress. I started with this one.tiles.json
to see which vector layers we have to style (examples: aerodrome_label
, aeroway
, boundary
.I'm probably gonna work on it tomorrow a bit too.
Wow, what an adventure! And all for a few icons of metro stations 🚂
Have the styling 95% finished, in the correct format: qtm_styles_april24_morning.json
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.
Idea for 1:
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?
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 style.json
file which is also in that branch of the repository.
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:
==
, in
etcLucas 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:
I've set the places_city to a min zoom of 4, but for some reason they are only appearing on a min zoom of 7, which makes navigating the map significantly more challenging. Is there a way to force them to appear at a min zoom level of 4?
Some of the Labels only have either {name} or {name:en}, or sometimes both. Is there a way to filter so that it displays either one, but not both at the same time?
In this version of the map, both in Maputnik and in the branch, the change in tiles from zooming seems to load very slowly. Is there a way we can increase the speed of this?
Hi!
I've set the places_city to a min zoom of 4, but for some reason they are only appearing on a min zoom of 7, which makes navigating the map significantly more challenging. Is there a way to force them to appear at a min zoom level of 4?
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.
Some of the Labels only have either {name} or {name:en}, or sometimes both. Is there a way to filter so that it displays either one, but not both at the same time?
I think the best way to do this is with an expression. Click the expression icon (fx
) and you can write a bit of JSON in the field.
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"]]
In this version of the map, both in Maputnik and in the branch, the change in tiles from zooming seems to load very slowly. Is there a way we can increase the speed of this?
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 places_city
didn't actually fix it. Lucas and I investigated for an hour but couldn't find a solution. Asked a question here now.
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: https://github.com/radical-data/queering-the-map/issues/31#issuecomment-2145959032
The "places_city
" problem has been solved, see our question and the answer.
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.
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 :) qtm_newstyle_june4_final.json
here is the final .json, with everything working well :) qtm_newstyle_june4_final.json
Do you want to commit this to the pull request https://github.com/radical-data/queering-the-map/pull/33? I can do it but thought you might like to claim all of that work with a commit in your name :)
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?