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

Use larger labels for larger cities #32

Open
ZeLonewolf opened this issue Jul 12, 2021 · 1 comment
Open

Use larger labels for larger cities #32

ZeLonewolf opened this issue Jul 12, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ZeLonewolf
Copy link
Owner

For better map readability, more important cities should have larger labels. An analysis of why this is important can be found here:
https://www.justinobeirne.com/google-maps-label-readability

OpenMapTiles has a rank column in the place layer that can be used for the functionality:
https://openmaptiles.org/schema/#place

This can be implemented in a manner similar to how we set the capital and city labels:
https://github.com/ZeLonewolf/openstreetmap-americana/blob/main/style/layer/place.js#L19-L27

@ZeLonewolf ZeLonewolf added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 12, 2021
@1ec5
Copy link
Collaborator

1ec5 commented Feb 23, 2022

Varying the text size is indeed a common technique for making larger cities stand out. Some maps and globes take it to an extreme, putting the text size on such an extreme scale that Los Angeles’ label is larger than many European countries’ landmasses. Another simple technique common on print maps is to set important cities’ labels in ALL CAPS. However, in my opinion, Metropolis Bold is too wide a font for an all-caps label to look polished.

Regarding the other techniques described in Justin O’Beirne’s article:

  • We already vary font weights by place classification.

  • We can easily add white opaque halos around city labels, but while this technique is very effective, it also feels dated. We currently apply translucent, blurred halos, but in some situations, they can reduce legibility instead of improving it. Related to the halo idea, knockouts are a tried-and-true technique for reducing map clutter around labels. I’d jump at the chance to add knockouts around bridges. However, this effect isn’t supported by MapLibre: Inherit text-halo color from underlying fill layers mapbox/mapbox-gl-js#4969.

  • We could massively increase the text-padding on place=city labels, but a less important city could collide out a more important nearby city if we aren’t careful.

  • The article describes “city donuts” that “clear the neighborhood” of nearby cities to make a central metropolitan city stand out. We can achieve this effect to a very limited extent by suppressing place=suburbs under a higher zoom level than place=towns, but this won’t help with the lower zoom levels that O’Beirne describes. If a particular city is causing problems, we could bundle a GeoJSON of a generous polygon around that city and filter the place layer by whether a feature lies within that polygon, but I don’t think this workaround squares with our general goal of reflecting OSM mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants