Skip to content

Commit

Permalink
Add rendering of leisure=dog_park
Browse files Browse the repository at this point in the history
Dog parks are rendered in a slightly darker shade of the fill colour
used for parks.

The 'paw' icon is based on work contributed to the public domain by Trac
user Giardia¹.

This closes gravitystorm#341.

1: https://trac.openstreetmap.org/ticket/2482
  • Loading branch information
jdhoek committed Jul 7, 2016
1 parent bd94b6c commit 64c06c5
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 9 deletions.
18 changes: 18 additions & 0 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,13 @@
marker-clip: false;
}

[feature = 'leisure_dog_park'][zoom >= 17] {
marker-file: url('symbols/dog_park.16.svg');
marker-placement: interior;
marker-fill: darken(@park, 60%);
marker-clip: false;
}

[feature = 'leisure_playground'][zoom >= 17] {
marker-file: url('symbols/playground.16.svg');
marker-fill: @amenity-brown;
Expand Down Expand Up @@ -1208,6 +1215,17 @@
text-placement: interior;
}

[feature = 'leisure_dog_park'][zoom >= 17] {
text-name: "[name]";
text-size: @standard-text-size;
text-fill: darken(@park, 60%);
text-face-name: @standard-font;
text-halo-radius: 1.5; /* Extra halo needed to stand out from paw pattern. */
text-halo-fill: rgba(255,255,255,0.6);
text-wrap-width: @standard-wrap-width;
text-placement: interior;
}

[feature = 'amenity_parking'][zoom >= 10][way_pixels > 900],
[feature = 'amenity_bicycle_parking'][zoom >= 10][way_pixels > 900],
[feature = 'amenity_motorcycle_parking'][zoom >= 10][way_pixels > 900] {
Expand Down
14 changes: 14 additions & 0 deletions landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@
}
}

[feature = 'leisure_dog_park'] {
[zoom >= 10] {
polygon-fill: darken(@park, 5%);
[way_pixels >= 4] { polygon-gamma: 0.75; }
[way_pixels >= 64] { polygon-gamma: 0.3; }
}
[zoom >= 16] {
polygon-pattern-file: url('symbols/dog_park.png');
polygon-pattern-alignment: global;
[way_pixels >= 4] { polygon-pattern-gamma: 0.75; }
[way_pixels >= 64] { polygon-pattern-gamma: 0.3; }
}
}

[feature = 'leisure_golf_course'][zoom >= 10],
[feature = 'leisure_miniature_golf'][zoom >= 15] {
polygon-fill: @golf_course;
Expand Down
8 changes: 4 additions & 4 deletions project.mml

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Layer:
'brownfield', 'landfill', 'construction') 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', 'sports_centre', 'stadium', 'pitch',
'track') THEN leisure ELSE NULL END)) AS leisure,
'track', 'dog_park') THEN leisure ELSE NULL END)) AS leisure,
('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",
('wetland_' || (CASE WHEN "natural" IN ('wetland', 'marsh', 'mud') THEN (CASE WHEN "natural" IN ('marsh', 'mud') THEN "natural" ELSE wetland END) ELSE NULL END)) AS wetland,
Expand Down Expand Up @@ -1755,7 +1755,8 @@ Layer:
'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'second_hand', 'sewing', 'shoe_repair', 'shopping_centre',
'solarium', 'souvenir', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'trade', 'tyres',
'vacuum_cleaner', 'video', 'video_games', 'watches', 'wholesale', 'yes') THEN 'other' ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') THEN leisure ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park') 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') THEN historic ELSE NULL END,
Expand Down Expand Up @@ -1793,7 +1794,8 @@ Layer:
'taxi', 'theatre', 'toilets', 'drinking_water', 'prison', 'hunting_stand', 'nightclub',
'veterinary', 'social_facility')
OR shop IS NOT NULL -- skip checking a huge list and use a null check
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway')
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park')
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 @@ -2075,7 +2077,7 @@ Layer:
'yes') THEN 'other' ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track',
'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'picnic_table') THEN leisure ELSE NULL END,
'picnic_table', 'dog_park') 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', 'farm', 'farmland',
Expand Down Expand Up @@ -2217,7 +2219,7 @@ Layer:
'wholesale', 'yes') THEN 'other' ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track',
'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'slipway', 'picnic_table') THEN leisure ELSE NULL END,
'slipway', 'picnic_table', 'dog_park') 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', 'farm', 'farmland',
Expand Down
59 changes: 59 additions & 0 deletions symbols/dog_park.16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added symbols/dog_park.png
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 64c06c5

Please sign in to comment.