Skip to content

Commit

Permalink
Improve address label rendering.
Browse files Browse the repository at this point in the history
Render addr:unit and addr:housename even if addr:housenumber is missing.

Render only addr:unit, when render = "unit-only" has been set in SQL,
i.e. render only addr:unit on entrances which have the same
addr:housenumber as the building they overlap with.
  • Loading branch information
tpikonen committed Nov 19, 2017
1 parent 3abe0cf commit 0ca006f
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions addressing.mss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@

#addresses {
[zoom >= 17] {
text-name: "";
text-placement: interior;
text-face-name: @book-fonts;
text-fill: @address-color;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-size: 10;
text-wrap-width: 30; // 3.0 em
text-line-spacing: -1.5; // -0.15 em
text-margin: 3; // 0.3 em
text-name: "[addr_housename]";
["addr_housenumber" != null] {
["addr_housenumber" != null]["render" = null] {
text-name: [addr_housenumber];
["addr_housename" != null] {
text-name: [addr_housenumber] + "\n" + [addr_housename];
Expand All @@ -25,16 +35,13 @@
}
}
}
text-placement: interior;
text-face-name: @book-fonts;
text-fill: @address-color;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-size: 10;
text-wrap-width: 30; // 3.0 em
text-line-spacing: -1.5; // -0.15 em
text-margin: 3; // 0.3 em
[zoom >= 18]["addr_unit" != null]["addr_housenumber" = null] {
["addr_unit" != null]["addr_housenumber" = null]["render" = null] {
text-name: [addr_unit];
["addr_housename" != null] {
text-name: [addr_unit] + "\n" + [addr_housename];
}
}
["render" = "unit-only"] {
text-name: [addr_unit];
}
[zoom >= 20] {
Expand Down

0 comments on commit 0ca006f

Please sign in to comment.