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 school icons #689

Merged
merged 8 commits into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions icons/poi_school.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions scripts/taginfo_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,34 @@
"object_types": ["area"],
"description": "Intermittent lakes are translucent with a dashed line representing the lakeshore.",
"doc_url": "https://openmaptiles.org/schema/#water"
},
{
"key": "amenity",
"value": "school",
"object_types": ["node", "area"],
"description": "Schools are represented by an icon.",
"doc_url": "https://openmaptiles.org/schema/#poi"
},
{
"key": "amenity",
"value": "kindergarten",
"object_types": ["node", "area"],
"description": "Schools are represented by an icon.",
"doc_url": "https://openmaptiles.org/schema/#poi"
},
{
"key": "amenity",
"value": "college",
"object_types": ["node", "area"],
"description": "Schools are represented by an icon.",
"doc_url": "https://openmaptiles.org/schema/#poi"
},
{
"key": "amenity",
"value": "university",
"object_types": ["node", "area"],
"description": "Schools are represented by an icon.",
"doc_url": "https://openmaptiles.org/schema/#poi"
}
]
}
12 changes: 10 additions & 2 deletions src/layer/poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var iconDefs = {
hospital: "hospital",
medical: ["doctors", "clinic"],
parking: "parking",
school: ["kindergarten", "school", "college", "university"],
};

export const poi = {
Expand All @@ -23,7 +24,7 @@ export const poi = {
["get", "subclass"],
[...iconDefs.bar, ...iconDefs.coffee],
Color.poi.consumer,
["hospital", "parking"],
["hospital", "parking", "school"],
Color.poi.infrastructure,
Color.poi.infrastructure,
],
Expand All @@ -34,7 +35,7 @@ export const poi = {
[
"match",
["get", "subclass"],
"hospital",
["hospital", ...iconDefs.school],
15,
[...iconDefs.bar, ...iconDefs.coffee],
16,
Expand Down Expand Up @@ -66,6 +67,8 @@ export const poi = {
"poi_hospital",
iconDefs.parking,
"poi_p",
iconDefs.school,
"poi_school",
"poi_square_dot", //icon for generic POI, not currently used
],
"icon-size": 1.0,
Expand Down Expand Up @@ -108,4 +111,9 @@ export const legendEntries = [
layers: [poi.id],
filter: ["==", ["get", "subclass"], iconDefs.parking],
},
{
description: "School",
layers: [poi.id],
filter: ["in", ["get", "subclass"], ["literal", iconDefs.school]],
},
];