-
Notifications
You must be signed in to change notification settings - Fork 831
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
[WIP] Improve country/state label rendering #3056
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,34 +4,22 @@ | |
@state-labels: desaturate(darken(@admin-boundaries, 5%), 20%); | ||
|
||
.country { | ||
[zoom >= 3][way_pixels > 1000][way_pixels < 360000] { | ||
[zoom >= 3][way_pixels > 1000][way_pixels < 192000] { | ||
text-name: "[name]"; | ||
text-size: 10; | ||
text-wrap-width: 35; // 3.5 em | ||
text-line-spacing: -1.5; // -0.15 em | ||
text-size: @landcover-font-size; | ||
text-wrap-width: @landcover-wrap-width-size; | ||
text-line-spacing: @landcover-line-spacing-size; | ||
text-margin: 7.0; // 0.7 em | ||
[zoom >= 4] { | ||
text-size: 11; | ||
text-wrap-width: 40; // 3.6 em | ||
text-line-spacing: -1.4; // -0.13 em | ||
text-margin: 7.7; // 0.7 em | ||
} | ||
[zoom >= 5] { | ||
text-size: 12; | ||
text-wrap-width: 45; // 3.8 em | ||
text-line-spacing: -1.2; // -0.10 em | ||
[way_pixels > 12000] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be a mistake to adjust the text labels based on way_pixel instead of by admin_level. This over-emphasizes areas at high latitudes (where way_pixels is 2 to 4 time larger than way_area at the equator) and over-emphasizes large provinces over small countries. |
||
text-size: @landcover-font-size-big; | ||
text-wrap-width: @landcover-wrap-width-size-big; | ||
text-line-spacing: @landcover-line-spacing-size-big; | ||
text-margin: 8.4; // 0.7 em | ||
} | ||
[zoom >= 7] { | ||
text-size: 13; | ||
text-wrap-width: 50; // 3.8 em | ||
text-line-spacing: -1.0; // -0.08 em | ||
text-margin: 9.1; // 0.7 em | ||
} | ||
[zoom >= 10] { | ||
text-size: 14; | ||
text-wrap-width: 55; // 3.9 em | ||
text-line-spacing: -0.7; // -0.05 em | ||
[way_pixels > 48000] { | ||
text-size: @landcover-font-size-bigger; | ||
text-wrap-width: @landcover-wrap-width-size-bigger; | ||
text-line-spacing: @landcover-line-spacing-size-bigger; | ||
} | ||
text-fill: @country-labels; | ||
text-face-name: @book-fonts; | ||
|
@@ -43,22 +31,27 @@ | |
} | ||
|
||
.state { | ||
[zoom >= 5][way_pixels > 3000][way_pixels < 196000] { | ||
[zoom >= 5][way_pixels > 3000][way_pixels < 192000] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would approve of this minor change, but |
||
text-name: "[name]"; | ||
text-size: 10; | ||
text-wrap-width: 30; // 3.0 em | ||
text-line-spacing: -1.5; // -0.15 em | ||
text-size: @landcover-font-size; | ||
text-wrap-width: @landcover-wrap-width-size; | ||
text-line-spacing: @landcover-line-spacing-size; | ||
text-margin: 7.0; // 0.7 em | ||
text-fill: @state-labels; | ||
text-face-name: @oblique-fonts; | ||
text-halo-fill: @standard-halo-fill; | ||
text-halo-radius: @standard-halo-radius * 1.5; | ||
text-placement: interior; | ||
[zoom >= 7] { | ||
text-size: 11; | ||
text-wrap-width: 50; // 4.5 em | ||
text-line-spacing: -0.6; // -0.05 em | ||
text-margin: 7.7; // 0.7 em | ||
[way_pixels > 12000] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines will make large provinces/states render more prominently than small countries - with "large" and "small" depending on mercator projection as much as actual size. |
||
text-size: @landcover-font-size-big; | ||
text-wrap-width: @landcover-wrap-width-size-big; | ||
text-line-spacing: @landcover-line-spacing-size-big; | ||
text-margin: 8.4; // 0.7 em | ||
} | ||
[way_pixels > 48000] { | ||
text-size: @landcover-font-size-bigger; | ||
text-wrap-width: @landcover-wrap-width-size-bigger; | ||
text-line-spacing: @landcover-line-spacing-size-bigger; | ||
} | ||
} | ||
} | ||
|
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.
This change would require changes to the way_pixels limit in
#admin-text
so that they match for; currently[admin_level = '1'][way_pixels >= 360000], [admin_level = '2'][way_pixels >= 360000],
would need to change to [way_pixels >= 192000]