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

Add icons for popular sports pitches #3651

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@landform-color: #d08f55;
@leisure-green: darken(@park, 60%);
@religious-icon: #000000;
@sport-icon: #46a083;

@landcover-font-size: 10;
@landcover-wrap-width-size: 30; // 3 em
Expand Down Expand Up @@ -218,6 +219,34 @@
marker-clip: false;
}

[feature = 'leisure_pitch'][sport = 'baseball'][zoom >= 18] {
marker-file: url('symbols/sport/baseball.svg');
marker-fill: @sport-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'leisure_pitch'][sport = 'basketball'][zoom >= 19] {
marker-file: url('symbols/sport/basketball.svg');
marker-fill: @sport-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'leisure_pitch'][sport = 'soccer'][zoom >= 18] {
marker-file: url('symbols/sport/soccer.svg');
marker-fill: @sport-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'leisure_pitch'][sport = 'tennis'][zoom >= 19] {
marker-file: url('symbols/sport/tennis.svg');
marker-fill: @sport-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'tourism_artwork'][zoom >= 17] {
[artwork_type != 'statue'] {
marker-file: url('symbols/tourism/artwork.svg');
Expand Down Expand Up @@ -2565,10 +2594,17 @@
[feature = 'leisure_ice_rink'],
[feature = 'leisure_pitch'] {
text-fill: darken(@pitch, 40%);
[sport = 'baseball'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the SQL query as suggested above, you can change this to [sport != null] instead of writing up a long list, I think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it should be safe enough to add generic text-dy, so please change it.

[sport = 'basketball'],
[sport = 'baseball'],
[sport = 'soccer'],
[sport = 'tennis'] {
text-dy: 10;
}
}
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove trailing spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did what @jeisenbe suggested and it didn't work. Maybe you or him can look over it and tell me what I did wrong. SQL isn't really my area of expertise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to be a jerk or anything, but does it matter what at all what I feel doing with a PR or not? I was fine with it being rejected if the code was to complicated. Now its extra work that I didn't want to do and @jeisenbe could have done himself in another PR. Since he's the one that suggested it and knows how to do that stuff. It does zero good though if I screw the PR up in the process of trying to implement something I don't have the knowledge how to do. Or I probably would have just done it that way in the first place. I'm lucky I got the icons to render as it was.

[feature = 'natural_bay'][zoom >= 14],
[feature = 'natural_spring'][zoom >= 16] {
text-name: "[name]";
Expand Down
12 changes: 6 additions & 6 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ Layer:
'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort',
'bowling_alley', 'outdoor_seating', 'bird_hide', 'amusement_arcade', 'sports_centre', 'swimming_area', 'fishing')
'bowling_alley', 'outdoor_seating', 'bird_hide', 'amusement_arcade', 'sports_centre', 'swimming_area', 'fishing', 'pitch')
THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'telescope', 'chimney', 'crane', 'storage_tank', 'silo')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1557,7 +1557,7 @@ Layer:
OR (tags->'office') IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre',
'fitness_station', 'firepit', 'sauna', 'beach_resort', 'bowling_alley', 'outdoor_seating', 'bird_hide',
'amusement_arcade', 'sports_centre', 'swimming_area', 'fishing')
'amusement_arcade', 'sports_centre', 'swimming_area', 'fishing', 'pitch')
OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'telescope', 'chimney', 'crane', 'storage_tank', 'silo')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
OR "natural" IN ('spring')
Expand Down Expand Up @@ -1629,7 +1629,7 @@ Layer:
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort',
'bowling_alley', 'outdoor_seating', 'bird_hide', 'amusement_arcade', 'sports_centre',
'swimming_area', 'fishing') THEN leisure ELSE NULL END,
'swimming_area', 'fishing', 'pitch') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'telescope',
'chimney', 'crane', 'storage_tank', 'silo')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1720,7 +1720,7 @@ Layer:
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort',
'bowling_alley', 'outdoor_seating', 'bird_hide', 'amusement_arcade', 'sports_centre',
'swimming_area', 'fishing')
'swimming_area', 'fishing', 'pitch')
OR barrier IN ('toll_booth')
OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk', 'communications_tower', 'telescope', 'chimney', 'crane', 'storage_tank', 'silo')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
Expand Down Expand Up @@ -2127,7 +2127,7 @@ Layer:
'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', 'fitness_station', 'firepit', 'sauna', 'beach_resort', 'bowling_alley',
'outdoor_seating', 'bird_hide', 'amusement_arcade', 'swimming_area', 'fishing', 'ice_rink') THEN leisure ELSE NULL END,
'outdoor_seating', 'bird_hide', 'amusement_arcade', 'swimming_area', 'fishing', 'ice_rink', 'pitch') 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 @@ -2328,7 +2328,7 @@ Layer:
'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', 'fitness_station', 'firepit', 'sauna', 'beach_resort', 'bowling_alley',
'outdoor_seating', 'bird_hide', 'amusement_arcade', 'swimming_area', 'fishing', 'ice_rink') THEN leisure ELSE NULL END,
'outdoor_seating', 'bird_hide', 'amusement_arcade', 'swimming_area', 'fishing', 'ice_rink', 'pitch') 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
56 changes: 56 additions & 0 deletions symbols/sport/baseball.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions symbols/sport/basketball.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions symbols/sport/soccer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions symbols/sport/tennis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.