Skip to content

Commit

Permalink
Unified rendering of leisure=fitness_station and leisure=fitness_centre
Browse files Browse the repository at this point in the history
  • Loading branch information
kocio-pl committed Oct 15, 2017
1 parent d229cd3 commit 3601cef
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
17 changes: 15 additions & 2 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,14 @@
marker-clip: false;
}

[feature = 'leisure_fitness_centre'][zoom >= 17],
[feature = 'leisure_fitness_station'][zoom >= 17] {
marker-file: url('symbols/fitness.svg');
marker-placement: interior;
marker-fill: @leisure-green;
marker-clip: false;
}

[feature = 'leisure_dog_park'][zoom >= 17] {
marker-file: url('symbols/shop/pet.svg');
marker-placement: interior;
Expand Down Expand Up @@ -1365,7 +1373,9 @@
}

[feature = 'leisure_playground'],
[feature = 'leisure_dog_park'] {
[feature = 'leisure_dog_park'],
[feature = 'leisure_fitness_centre'],
[feature = 'leisure_fitness_station'] {
[way_area >= 150000][zoom >= 14],
[way_area >= 80000][zoom >= 15],
[way_area >= 20000][zoom >= 16],
Expand Down Expand Up @@ -1521,6 +1531,7 @@
[feature = 'natural_shoal'],
[feature = 'natural_reef'],
[feature = 'leisure_fitness_centre'],
[feature = 'leisure_fitness_station'],
[feature = 'leisure_sports_centre'],
[feature = 'leisure_stadium'],
[feature = 'leisure_track'],
Expand Down Expand Up @@ -1640,11 +1651,13 @@
[feature = 'natural_shoal'] {
text-fill: darken(@beach, 60%);
}
[feature = 'leisure_fitness_centre'],
[feature = 'leisure_sports_centre'],
[feature = 'leisure_stadium'] {
text-fill: darken(@stadium, 70%);
}
[feature = 'leisure_dog_park'],
[feature = 'leisure_fitness_centre'],
[feature = 'leisure_fitness_station'],
[feature = 'leisure_dog_park'] {
text-fill: @leisure-green;
text-halo-radius: @standard-halo-radius * 1.5; /* Extra halo needed to stand out from paw pattern. */
Expand Down
14 changes: 7 additions & 7 deletions landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@mud: rgba(203,177,154,0.3); // produces #e6dcd1 over @land
@place_of_worship: #cdccc9;
@place_of_worship_outline: #111;
@playground: lighten(@park, 5%);
@leisure: lighten(@park, 5%);
@power: darken(@industrial, 5%);
@power-line: darken(@industrial-line, 5%);
@sand: #f5e9c6;
Expand All @@ -61,7 +61,7 @@

@pitch: #aae0cb; // also track
@track: @pitch;
@stadium: @societal_amenities; // also fitness_centre and sports_centre
@stadium: @societal_amenities; // also sports_centre
@golf_course: #b5e3b5;

#landcover-low-zoom[zoom < 10],
Expand Down Expand Up @@ -97,9 +97,10 @@
[way_pixels >= 64] { polygon-gamma: 0.3; }
}

[feature = 'leisure_playground'][zoom >= 13] {
polygon-fill: @playground;
line-color: darken(@playground, 60%);
[feature = 'leisure_playground'][zoom >= 13],
[feature = 'leisure_fitness_station'][zoom >= 13] {
polygon-fill: @leisure;
line-color: darken(@leisure, 60%);
line-width: 0.3;
[way_pixels >= 4] { polygon-gamma: 0.75; }
[way_pixels >= 64] { polygon-gamma: 0.3; }
Expand Down Expand Up @@ -260,7 +261,7 @@

[feature = 'leisure_dog_park'] {
[zoom >= 10] {
polygon-fill: @playground;
polygon-fill: @leisure;
[way_pixels >= 4] { polygon-gamma: 0.75; }
[way_pixels >= 64] { polygon-gamma: 0.3; }
}
Expand Down Expand Up @@ -578,7 +579,6 @@
polygon-fill: @railway;
}

[feature = 'leisure_fitness_centre'],
[feature = 'leisure_sports_centre'],
[feature = 'leisure_stadium'] {
[zoom >= 10] {
Expand Down
15 changes: 8 additions & 7 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Layer:
'brownfield', 'landfill', 'construction', 'plant_nursery', 'religious') THEN landuse ELSE NULL END)) AS landuse,
('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden',
'golf_course', 'miniature_golf', 'picnic_table', 'fitness_centre', 'sports_centre', 'stadium', 'pitch',
'track', 'dog_park') THEN leisure ELSE NULL END)) AS leisure,
'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure,
('man_made_' || (CASE WHEN man_made IN ('works') THEN man_made ELSE NULL END)) AS man_made,
('military_' || (CASE WHEN military IN ('danger_area') THEN military ELSE NULL END)) AS military,
('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural",
Expand Down Expand Up @@ -1411,7 +1411,8 @@ Layer:
'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility',
'charging_station', 'arts_centre', 'ferry_terminal') THEN amenity ELSE NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') THEN leisure ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'fitness_centre', 'fitness_station') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('spring') THEN "natural" ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site')
Expand Down Expand Up @@ -1445,7 +1446,7 @@ Layer:
'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR shop IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table')
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre', 'fitness_station')
OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
OR "natural" IN ('spring')
OR historic IN ('memorial', 'monument', 'archaeological_site')
Expand Down Expand Up @@ -1499,7 +1500,7 @@ Layer:
'emergency_' || CASE WHEN tags->'emergency' IN ('phone') THEN tags->'emergency' ELSE NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park') THEN leisure ELSE NULL END,
'dog_park', 'fitness_centre', 'fitness_station') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') THEN "natural" ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site')
Expand Down Expand Up @@ -1545,7 +1546,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR shop IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park')
'dog_park', 'fitness_centre', 'fitness_station')
OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance')
OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross')
Expand Down Expand Up @@ -1923,7 +1924,7 @@ Layer:
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'picnic_table', 'dog_park') THEN leisure ELSE NULL END,
'picnic_table', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END,
'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,
'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery',
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland',
Expand Down Expand Up @@ -2056,7 +2057,7 @@ Layer:
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'slipway', 'picnic_table', 'dog_park') THEN leisure ELSE NULL END,
'slipway', 'picnic_table', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END,
'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END,
'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery',
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland',
Expand Down
30 changes: 30 additions & 0 deletions symbols/fitness.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 3601cef

Please sign in to comment.