Add a Sport Pitch Type¶
Playground maps often include sports pitches — football fields, basketball courts, skate parks, BMX tracks, and many more. Each pitch type is identified by the OSM sport tag on a leisure=pitch feature. Adding a new sport type means adding translations to both locale files so the app shows a readable label instead of a tidied-up tag value (roller_hockey → "Roller hockey").
Step 1 — Find the OSM tag value¶
OSM uses the tag sport=<value> on leisure=pitch features. The full list of documented values is at:
For example, a roller hockey rink uses sport=roller_hockey.
Finding pitches with a specific sport in OSM
Use Overpass Turbo — search for leisure=pitch + sport=roller_hockey (replace with your value) to confirm the tag is used in the wild.
Step 2 — Add the translation keys¶
Open locales/en.json and add a new entry under equipment.pitches:
"pitches": {
"soccer": "Football pitch",
"basketball": "Basketball court",
...
"roller_hockey": "Roller hockey rink"
}
The key must exactly match the OSM sport tag value (case-sensitive, underscores preserved).
Then open locales/de.json and add the German translation at the same path:
"pitches": {
"soccer": "Bolzplatz",
"basketball": "Basketballfeld",
...
"roller_hockey": "Rollhockeyfeld"
}
Both files must be updated — a key missing from de.json shows the English text (fallbackLocale: 'en'); only a key missing from en.json too falls back to the tag value with underscores replaced and the first letter capitalised.
There is a second namespace for the sport on its own, pitch.sports.<value> ("Roller hockey" rather than "Roller hockey rink"). The panel of a pitch outside a playground (PitchPanel) shows its sports as chips from it, and the hover tooltip uses it when equipment.pitches has no entry. Add the key there too, in both files:
Two optional extras, both code changes: a sport-specific pin symbol in BY_SPORT in app/src/lib/sportGlyphs.js (otherwise the generic flag), and an illustration in pitchImages in app/src/lib/equipmentAttributes.js, which then needs make equipment-images (Update Generated Assets).
Step 3 — Handle multi-value sport tags (no extra work needed)¶
OSM allows semicolon-separated multi-values on sport (e.g. sport=cycling;bmx). The equipment list automatically splits on ;, translates each part using the keys above, and joins them with /. Unknown values fall back to the raw OSM string. You only need to add the individual keys — no extra code changes are required.
Check it¶
Open the app at http://localhost:5173, navigate to a playground that contains a pitch with your sport tag, and check the equipment list. The pitch should show your translated label. For a pitch outside any playground, turn on Sports pitches (outside playgrounds) in the filter panel and open it.
Finding a playground with a specific pitch
Use Overpass Turbo to locate an OSM node or way with leisure=pitch and sport=<your_value>, note its coordinates, and navigate there in the app.
Open a pull request¶
Branch, commit and open the pull request as described in Local Development → Start here. The change touches only locales/en.json and locales/de.json.