Skip to content

Commit

Permalink
Adjust aerodrome icon & text by z level
Browse files Browse the repository at this point in the history
Small 8 pixel airport icon at z10, larger 15 and 18 pixel icons at higher zoom levels or larger way_pixels
Also created `is_airport` SQL query in project.mml to simplify CSS
But small airports are not rendering correctly yet
  • Loading branch information
jeisenbe committed Sep 3, 2019
1 parent a0eb31b commit 29cd1f3
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 13 deletions.
87 changes: 74 additions & 13 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1488,16 +1488,39 @@
marker-fill: @airtransport;
}

[feature = 'aeroway_aerodrome']['access' != 'private']['icao' != null]['iata' != null][zoom >= 10][zoom < 16],
[feature = 'aeroway_aerodrome']['access' = 'private'][zoom >= 12][zoom < 17],
[feature = 'aeroway_aerodrome']['icao' = null][zoom >= 12][zoom < 17],
[feature = 'aeroway_aerodrome']['iata' = null][zoom >= 12][zoom < 17] {
[feature = 'aeroway_aerodrome'][is_airport = 'yes'][zoom >= 10][zoom < 16],
[feature = 'aeroway_aerodrome'][is_airport = 'no'][zoom >= 12][zoom < 17] {
[way_pixels <= 192000],
[way_pixels = null] {
marker-file: url('symbols/aerodrome.12.svg');
marker-file: url('symbols/aerodrome.8.svg');
marker-placement: interior;
marker-clip: false;
marker-fill: @airtransport;
[zoom >= 11] {
marker-file: url('symbols/aerodrome.12.svg')
}
[is_airport = 'yes'] {
[zoom >= 14] {
marker-file: url('symbols/aerodrome.15.svg')
}
[zoom >= 15] {
marker-file: url('symbols/aerodrome.18.svg')
}
}
[is_airport = 'no'] {
[zoom >= 15] {
marker-file: url('symbols/aerodrome.15.svg')
}
[zoom >= 16] {
marker-file: url('symbols/aerodrome.18.svg')
}
}
[way_pixels > 12000] {
marker-file: url('symbols/aerodrome.15.svg')
}
[way_pixels > 48000] {
marker-file: url('symbols/aerodrome.18.svg')
}
}
}

Expand Down Expand Up @@ -3116,18 +3139,56 @@
text-placement: interior;
}

[feature = 'aeroway_aerodrome']['access' != 'private']['icao' != null]['iata' != null][zoom >= 11][zoom < 16],
[feature = 'aeroway_aerodrome'][zoom >= 13][zoom < 17]['access' = 'private'],
[feature = 'aeroway_aerodrome'][zoom >= 13][zoom < 17]['icao' = null],
[feature = 'aeroway_aerodrome'][zoom >= 13][zoom < 17]['iata' = null] {
[feature = 'aeroway_aerodrome'][is_airport = 'yes'][zoom >= 11][zoom < 16],
[feature = 'aeroway_aerodrome'][is_airport = 'no'][zoom >= 13][zoom < 17] {
[way_pixels <= 192000],
[way_pixels = null] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
text-line-spacing: @landcover-line-spacing-size;
text-fill: darken(@airtransport, 15%);
text-dy: 10;
text-dy: 9;
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
text-line-spacing: @landcover-line-spacing-size-big;
text-dy: 11;
[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-dy: 13;
}
}
[is_airport = 'yes'] {
[zoom >= 14] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
text-line-spacing: @landcover-line-spacing-size-big;
text-dy: 11;
}
[zoom >= 15][is_airport = 'yes'] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
text-line-spacing: @landcover-line-spacing-size-bigger;
text-dy: 13;
}
}
[is_airport = 'no'] {
[zoom >= 15] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
text-line-spacing: @landcover-line-spacing-size-big;
text-dy: 11;
}
[zoom >= 16] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
text-line-spacing: @landcover-line-spacing-size-bigger;
text-dy: 13;
}
}
text-face-name: @oblique-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
Expand Down
8 changes: 8 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,14 @@ Layer:
ELSE NULL
END AS height,
tags->'location' as location,
CASE
WHEN aeroway = 'aerodrome' THEN
CASE
WHEN tags->'icao' = NULL OR tags->'iata' = NULL OR access = 'private' THEN 'no'
ELSE 'yes'
END
ELSE NULL
END AS is_airport,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
Expand Down
38 changes: 38 additions & 0 deletions symbols/aerodrome.15.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions symbols/aerodrome.18.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions symbols/aerodrome.8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29cd1f3

Please sign in to comment.