Skip to content

Commit

Permalink
Merge pull request #999 from whubsch/fuel-poi
Browse files Browse the repository at this point in the history
Add gas stations
  • Loading branch information
ZeLonewolf authored Dec 5, 2023
2 parents c5c4f05 + 058ad86 commit 0d7f123
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions icons/poi_fuel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions scripts/taginfo_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@
"description": "Intermittent lakes are translucent with a dashed line representing the lakeshore.",
"doc_url": "https://openmaptiles.org/schema/#water"
},
{
"key": "amenity",
"value": "fuel",
"object_types": ["node", "area"],
"description": "Fuel stations are marked by an icon representing a gas pump.",
"doc_url": "https://openmaptiles.org/schema/#poi",
"icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_fuel.svg"
},
{
"key": "amenity",
"value": "school",
Expand Down
17 changes: 15 additions & 2 deletions src/layer/poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ var iconDefs = {
color: Color.poi.consumer,
description: "Coffee shop",
},
fuel: {
classes: {
fuel: ["fuel"],
},
sprite: "poi_fuel",
color: Color.poi.consumer,
description: "Gas station",
},
hospital: {
classes: {
hospital: ["hospital"],
Expand Down Expand Up @@ -238,7 +246,11 @@ export const poi = {
"text-color": [
"match",
["get", "subclass"],
[...getSubclasses(iconDefs.bar), ...getSubclasses(iconDefs.coffee)],
[
...getSubclasses(iconDefs.fuel),
...getSubclasses(iconDefs.bar),
...getSubclasses(iconDefs.coffee),
],
Color.poi.consumer,
[
"bus_station",
Expand Down Expand Up @@ -284,6 +296,7 @@ export const poi = {
"hospital",
"museum",
"police",
...getSubclasses(iconDefs.fuel),
...getSubclasses(iconDefs.pow_buddhist),
...getSubclasses(iconDefs.pow_christian),
...getSubclasses(iconDefs.pow_hindu),
Expand Down Expand Up @@ -322,7 +335,7 @@ export const poi = {
[
"match",
["get", "subclass"],
["bus_stop", "tram_stop"],
["bus_stop", "tram_stop", "fuel"],
"",
label.localizedName,
],
Expand Down

0 comments on commit 0d7f123

Please sign in to comment.