-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Including spaces between Magnitude and Unit in Scale Control Formatting #12644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're removing the space, for consistency, we should also remove it in legacySetScale
(that's used when Intl.NumberFormat
isn't available).
However, I'm wondering if it would be better to change it the other way around — looking at the formatting docs, we could replace "narrow"
in options with "short"
and that would add the space. And the non-breaking part could be enforced in CSS (white-space: nowrap
). Not sure. What do you think?
Hey @mourner !! Thanks for the comment (also big fan of your leaflet work, trying to be like you one day!) I think I agree with changing it to the other way around, I like the space between the magnitude and unit ! I will try to draft something up Edit: Seems like there's actually a discrepancy between the legacySetScale and _setscale as the legacysetscale actually includes a non-breaking space (it doesn't use intl.numberFormat) between the magnitude and the unit for all types of units not just nautical, so I like adding the space in _setScale even more now |
Nice! Let's also make sure the label doesn't get wrapped by setting it as |
Hi @mourner ! Thanks again for the review, I should've mentioned it in my update, seems like you guys already added the 'nowrap' property in the CSS file in this pr to tackle the same wrapping issue: https://github.com/mapbox/mapbox-gl-js/pull/11850/files#diff-ddbd4aa8b3bad8f105e53a268b99db49be5ad58f3db5e57719baf9afb9ddc9c3 mapbox-gl-js/src/css/mapbox-gl.css Line 521 in e82dae3
If I need to enforce it somewhere else as well, please let me know! Thank you! |
Tackling Scale Control Formatting Consistency Issue #12620. Decided that including spaces between magnitude and unit in the Scale Control for all units would be the best practice, this will also ensure consistency between the legacySetScale (includes spaces) function and _setScale (currently does not include spaces).
Before:
After:
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes@mapbox/gl-native
if this PR includes shader changes or needs a native portmapbox-gl-js
changelog:<changelog>Adding Spaces between Magnitude and Unit in the Scale Control for all units</changelog>