-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Design Proposal: Adjust Text size / Glyphs based on latitude #857
Comments
How would this proposal work with the other text manipulation abilities? |
Layout properties that would result in individual letters to stay at a specific longitude/latitude should scale according to latitude: Properties where this behaviour should apply:
Properties where this behaviour should not apply:
text alignments and offsets are affected depending on the properties above. For example with "text-pitch-alignment": "map":
|
It is still not clear (to me) how this would behave in all kind of possible scenarios. |
Is there a specific combination that is unclear? |
For me, all of them... |
Well, "all of them" might be a bit too much to visualize. Essentially, it boils down to one key point: if the text is projected on the map, it should maintain the same size regardless of its position on the map. Let’s take an extreme case with the current implementation:
|
Can you please share a jsbin that reproduces this. I tend to think there are ways currently to achieve what you want or something close to it. If not, then we should be able to add some property to the existing one instead of adding yet another confusing property. |
I don't think it's possible to achieve this look without modifying the code. To get the result shown above, I had to calculate distances using the Haversine formula instead of Mercator (in placeGlyphAlongLine). Without this, I couldn't achieve consistent spacing and would also get slightly different anchor centers. Additionally, I had to slightly modify symbol_sdf.vertex.glsl to adjust the glyph sizes. So, instead of "text-projection": "globe", would you prefer something like "text-pitch-alignment": "globe-map"? (I'm open to other suggestions.) |
Is the following what you are after? |
It's also worth noting, due to how globe works that when panning the map closes to the poles the zoom changes, so if you want to style something that will work for poles and everywhere else you need to be cautious about how you use the zoom. |
It is close, but not quite there. I need the text to align with the map and not with the viewport: |
CC: @kubapelc - it is possible that there's an issue with the text close to the poles? |
Whether it's an issue or a bug depends on your perspective: It’s a feature if you want to maintain visual consistency between the Mercator and globe projections (the text may appear distorted, but its position remains consistent). It’s a bug if you expect the text size to remain constant. (Personally, I lean towards labeling this as a bug, but it's not for me to decide.) |
I think the following bug described this issue, right? |
I would suggest continueing the discussion in the other repo. |
Motivation
For a topological map in globe projection a consistent text size would improve the visual appeareance.
Texts appear smaller the closer they get to the poles. This can result in tapered labels, when a feature runs from north to south. For example a mountain range. This effect gets stronger closer to the poles.
Proposed Change
Each letter needs to be invidually scaled depending on latitude.
The text was updated successfully, but these errors were encountered: