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

WIP Improve low-zoom levels #3074

Closed
120 changes: 66 additions & 54 deletions admin.mss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@admin-boundaries: #ac46ac;
@admin-boundaries: #446644;
@admin-boundaries-maritime: darken(@water-color,30%);

@admin-simplify: 4;
@admin-simplify-algorithm: visvalingam-whyatt;
Expand All @@ -9,58 +10,58 @@ For each zoomlevel, all borders come from a single attachment, to handle
overlapping borders correctly.
*/


#admin-low-zoom[zoom < 11],
#admin-mid-zoom[zoom >= 11][zoom < 13],
#admin-high-zoom[zoom >= 13] {

[admin_level = '2'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 1.2;
background/line-width: 0.6;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 1.2;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.6;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[zoom >= 5] {
background/line-width: 1.5;
line-width: 1.5;
}
[zoom >= 6] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 7] {
background/line-width: 2;
line-width: 2;
background/line-width: 1;
line-width: 1;
}
[zoom >= 10] {
background/line-width: 6;
line-width: 6;
background/line-width: 1;
line-width: 1;
}
}

[admin_level = '3'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.6;
background/line-width: 0.4;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 0.6;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.4;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[zoom >= 7] {
background/line-width: 1.2;
line-width: 1.2;
[zoom >= 6] {
background/line-width: 1;
line-width: 1;
}
[zoom >= 10] {
[zoom >= 9] {
background/line-width: 4;
line-width: 4;
line-dasharray: 4,2;
Expand All @@ -72,42 +73,34 @@ overlapping borders correctly.
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.4;
background/line-width: 0.2;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-join: bevel;
line-width: 0.4;
line-width: 0.2;
line-clip: false;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-clip: false;
}
[zoom >= 5] {
background/line-width: 0.5;
line-width: 0.5;
}
[zoom >= 6] {
background/line-width: 0.6;
line-width: 0.6;
background/line-width: 0.2;
line-width: 0.2;
}
[zoom >= 7] {
background/line-width: 0.3;
line-width: 0.3;
}
[zoom >= 9] {
background/line-width: 1;
line-dasharray: 4,3;
line-width: 1;
}
[zoom >= 9] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 10] {
background/line-width: 2.5;
line-width: 2.5;
}
[zoom >= 12] {
background/line-width: 3;
line-width: 3;
}
}
opacity: 1;
/*
The following code prevents admin boundaries from being rendered on top of
each other. Comp-op works on the entire attachment, not on the individual
Expand All @@ -119,7 +112,6 @@ overlapping borders correctly.
The SQL has `ORDER BY admin_level`, so the boundary with the lowest
admin_level is rendered on top, and therefore the only visible boundary.
*/
opacity: 0.4;
comp-op: darken;
}

Expand All @@ -128,16 +120,21 @@ overlapping borders correctly.
[admin_level = '5'][zoom >= 11] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
background/line-width: 0.8;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.7;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 6,3,2,3,2,3;
line-clip: false;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[admin_level = '6'][zoom >= 11] {
background/line-join: bevel;
Expand All @@ -147,34 +144,44 @@ overlapping borders correctly.
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.7;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 6,3,2,3;
line-clip: false;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
[admin_level = '7'],
[admin_level = '8'] {
[zoom >= 12] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 1.5;
background/line-width: 0.8;
background/line-simplify: @admin-simplify;
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 1.5;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.7;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 5,2;
line-clip: false;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
}
opacity: 0.5;
comp-op: darken;
}

#admin-high-zoom[zoom >= 13] {
#admin-high-zoom[zoom >= 13],
#admin-high-zoom-maritime[zoom >= 13] {
[admin_level = '9'],
[admin_level = '10'] {
[zoom >= 13] {
Expand All @@ -185,25 +192,30 @@ overlapping borders correctly.
background/line-simplify-algorithm: @admin-simplify-algorithm;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.4;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
line-dasharray: 2,3;
line-clip: false;
line-simplify: @admin-simplify;
line-simplify-algorithm: @admin-simplify-algorithm;
}
}
opacity: 0.5;
comp-op: darken;
}

#admin-text[zoom >= 16] {
#admin-text[zoom >= 1][way_pixels > 192000] {
text-name: "[name]";
text-face-name: @book-fonts;
text-fill: @admin-boundaries;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-clip: true;
text-clip: false;
text-spacing: 600;
text-vertical-alignment: middle;
text-dy: -10;
}
Expand Down
9 changes: 4 additions & 5 deletions placenames.mss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@placenames: #222;
@placenames: black;
@placenames-light: #777777;
@country-labels: darken(@admin-boundaries, 15%);
@state-labels: desaturate(darken(@admin-boundaries, 5%), 20%);
@country-labels: @admin-boundaries;
@state-labels: @admin-boundaries;

.country {
[zoom >= 3][way_pixels > 1000][way_pixels < 360000] {
Expand Down Expand Up @@ -34,7 +34,7 @@
text-line-spacing: -0.7; // -0.05 em
}
text-fill: @country-labels;
text-face-name: @book-fonts;
text-face-name: @bold-fonts;
text-halo-fill: @standard-halo-fill;
text-halo-radius: @standard-halo-radius * 1.5;
text-placement: interior;
Expand Down Expand Up @@ -396,4 +396,3 @@
}
}
}

Loading