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

Increased text and shield distances on waterways, railways and roads #3295

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@
@track-oneway-arrow-color: darken(@track-fill, 15%);
@bridleway-oneway-arrow-color: darken(@track-fill, 10%);

@text-repeat-distance: 50;

// Shield’s line wrap is based on OpenStreetMap data and not on line-wrap-width,
// but lines are typically rather short, so we use narrow line spacing.
@shield-size: 10;
Expand All @@ -281,7 +283,8 @@
@shield-size-z18: 12;
@shield-line-spacing-z18: -1.80; // -0.15 em
@shield-spacing: 760;
@shield-min-distance: 40;
@shield-repeat-distance: 400;
@shield-margin: 40;
@shield-font: @book-fonts;
@shield-clip: false;

Expand Down Expand Up @@ -2665,7 +2668,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
shield-line-spacing: @shield-line-spacing;
shield-placement: line;
shield-spacing: @shield-spacing;
shield-min-distance: @shield-min-distance;
shield-repeat-distance: @shield-repeat-distance;
shield-margin: @shield-margin;
shield-face-name: @shield-font;
shield-clip: @shield-clip;

Expand Down Expand Up @@ -2713,7 +2717,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */

shield-placement: line;
shield-spacing: @shield-spacing;
shield-min-distance: @shield-min-distance;
shield-repeat-distance: @shield-repeat-distance;
shield-margin: @shield-margin;
shield-face-name: @shield-font;
shield-clip: @shield-clip;

Expand Down Expand Up @@ -2830,6 +2835,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-clip: false;
text-placement: line;
text-face-name: @book-fonts;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests. It decreases amount of text repetitions, but does it in the same way for all values, no matter what global value is set. However if you make local value, like text-repeat-distance: 50;, it works different way for different values, as it should be. See #3295 (comment).

Proposed solutions:

  • Investigate why global values works as a uniform "small repetitions" switch, while local values work as expected.
  • Make all these values local (and test that they all work as expected).

[tunnel = 'no'] {
text-halo-radius: @standard-halo-radius;
[highway = 'motorway'] { text-halo-fill: @motorway-fill; }
Expand Down Expand Up @@ -2862,6 +2868,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @secondary-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 14] {
text-size: 9;
Expand All @@ -2888,6 +2895,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @tertiary-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 17] {
text-size: 11;
Expand All @@ -2906,6 +2914,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-face-name: @book-fonts;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.


[zoom >= 17] {
text-size: 11;
Expand Down Expand Up @@ -2961,6 +2970,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'raceway'] { text-halo-fill: @raceway-fill; }
[highway = 'service'] { text-halo-fill: @service-fill; }
text-face-name: @book-fonts;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 17] {
text-size: 11;
Expand Down Expand Up @@ -3021,6 +3031,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-face-name: @book-fonts;
text-vertical-alignment: middle;
text-dy: 5;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 16] {
text-size: 9;
Expand Down Expand Up @@ -3049,6 +3060,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-face-name: @book-fonts;
text-vertical-alignment: middle;
text-dy: 7;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 17] {
text-size: 11;
Expand Down Expand Up @@ -3173,10 +3185,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-spacing: 900;
text-clip: false;
text-placement: line;
text-min-distance: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 19] {
text-size: 11;
Expand All @@ -3195,10 +3207,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-spacing: 300;
text-clip: false;
text-placement: line;
text-min-distance: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 13] {
text-dy: 6;
Expand All @@ -3224,10 +3236,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-spacing: 300;
text-clip: false;
text-placement: line;
text-min-distance: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 17] {
text-spacing: 600;
Expand All @@ -3254,10 +3266,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-spacing: 900;
text-clip: false;
text-placement: line;
text-min-distance: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @text-repeat-distance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not working properly in my tests - see my previous comment on text-repeat-distance values.

}
[zoom >= 19] {
text-size: 11;
Expand Down
6 changes: 6 additions & 0 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@glacier: #ddecec;
@glacier-line: #9cf;

@text-repeat-distance: 600;

#water-areas {
[natural = 'glacier']::natural {
[zoom >= 8] {
Expand Down Expand Up @@ -266,6 +268,7 @@
text-halo-fill: @standard-halo-fill;
text-spacing: 400;
text-placement: line;
text-repeat-distance: @text-repeat-distance;
[zoom >= 14] { text-size: 12; }
[int_tunnel = 'yes'] { text-min-distance: 200; }
}
Expand All @@ -278,6 +281,7 @@
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-repeat-distance: @text-repeat-distance;
}

[waterway = 'stream'][zoom >= 15] {
Expand All @@ -288,6 +292,7 @@
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-spacing: 600;
text-repeat-distance: @text-repeat-distance;
text-placement: line;
text-vertical-alignment: middle;
text-dy: 8;
Expand All @@ -303,6 +308,7 @@
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-spacing: 600;
text-repeat-distance: @text-repeat-distance;
text-placement: line;
text-vertical-alignment: middle;
text-dy: 8;
Expand Down