Skip to content

First version of the style: terrain, water, roads and per-course hole colors (#7)#49

Draft
HuggeK wants to merge 6 commits into
mainfrom
7-write-the-first-version-of-the-style
Draft

First version of the style: terrain, water, roads and per-course hole colors (#7)#49
HuggeK wants to merge 6 commits into
mainfrom
7-write-the-first-version-of-the-style

Conversation

@HuggeK

@HuggeK HuggeK commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Continues #7. Grows the style from 17 to 33 layers and adds 3D terrain:

  • Per-course hole line colorsprocess.lua now precomputes a course_name_color attribute (FNV-1a hash of the course name → hue → #rrggbb) into golf_lines; the Hole lines layer consumes it with a #cccccc fallback.
  • 3D terrain — new terrainSource (Mapterhorn raster-DEM) plus top-level terrain (exaggeration 1.5) and sky; the demo page now starts pitched at 70° with navigation and terrain controls.
  • 16 new layers — facilities base fill, lakes, streams/rivers, waste areas, driving-range labels, numeric tee borders, hole info text (number/par/index/name/course), campsites (new other_areas source-layer), area:highway, parking lots, cartpaths, golf paths, highways, clubhouses, restaurants, buildings.
  • Fixes the Out of bounds lines filter — it previously matched golf=hole instead of golf=out_of_bounds.
  • Documents style/schema behaviors in styles/schema_and_style.md; broadens waterway handling in process.lua to any waterway=* tag.

Second round of fixes (2026-07-05)

Resolves all of the previously listed follow-ups plus three more schema/style mismatches found while auditing the style against process.lua:

  • Labels can render at last — added top-level glyphs pointing at self-hosted Open Sans Regular glyph ranges on GitHub Pages. The font files themselves ship in companion PR Publish the style, samples and fonts to GitHub Pages on release #52 (merge this PR first, then Publish the style, samples and fonts to GitHub Pages on release #52).
  • Streams and Rivers fixed — now reads source-layer: golf_lines, where process.lua actually writes waterway=* features.
  • Area:highway fixed — now filters on area_highway, the attribute key actually written to the tiles (colon → underscore).
  • River polygons render — the Lakes layer (renamed Lakes and rivers) now matches water=lake and water=river; process.lua emits both for natural=water.
  • Hole numbers render — the hole text layer read ref, but the schema renames it to hole_number; "Hole N." now works.
  • index.html hardeningmaplibre-gl pinned to 5.24.0 (was floating latest) and the style is loaded relatively, so local testing serves the branch's own style instead of the deployed golftiles.org copy.
  • All of the above documented in styles/schema_and_style.md.

Verification

  • The style validates and loads cleanly in MapLibre GL JS 5.24.0 (headless-Chrome harness: style.load fired, zero error events — re-run after the second round of fixes).
  • 11 scripted assertions pass: style JSON parses; glyphs template well-formed; every layer's source-layer exists in custom-tilemaker/config.json; the corrected filters (golf_lines waterways, area_highway, lake+river, hole_number, no ref reads); index.html fully pinned and loading the style relatively.
Deployment notes for golftiles.org (read before uploading)
  • golftiles.org currently serves the old 17-layer style; upload styles/golfTilesStyle.json from this branch after merge to publish the improvements.
  • Do not deploy the intermediate 8cb124f version of the style: its ["hsl", ["get", "course_name_hash_hue"], 70, 50] expression is invalid in MapLibre (hsl is not an expression), which fails validation of the whole style and blanks the map. The branch tip replaced it with the precomputed course_name_color.
  • The published tileset (extract 260601) predates the process.lua change — its metadata has no course_name_color field — so hole lines will render the #cccccc fallback until the tiles are regenerated with the new process.lua.
  • Labels appear only once PR Publish the style, samples and fonts to GitHub Pages on release #52 is merged and its Pages publishing runbook is completed (the glyphs URL points at the Pages-hosted fonts).
Known follow-ups (not blocking this PR)

🤖 Generated with Claude Code

HuggeK added 4 commits June 7, 2026 00:01
… compute hue value for a particular course name, (Use route=golf people!) Added lakes, rivers, waste areas, golf hole text info and coloring, roads, paths, to style.
@HuggeK

HuggeK commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Set a release for this too.

claude and others added 2 commits July 5, 2026 23:50
- Add top-level glyphs pointing at GitHub Pages hosted fonts (docs/fonts/, see companion publishing PR); keeps Open Sans Regular so the 5 symbol layers can finally draw text.
- Streams and Rivers: read source-layer golf_lines (process.lua writes waterway=* there, not golf_areas).
- Area:highway: filter on area_highway, the attribute key actually written to the tiles.
- Lakes: also render water=river polygons; layer renamed to 'Lakes and rivers'.
- Hole labels: read hole_number (the renamed ref) so 'Hole N.' renders.
- Document all of the above in styles/schema_and_style.md.

Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>
Unpinned unpkg URLs float to the latest major and can break the page silently; 5.24.0 matches the version the style was verified against. The relative style URL resolves to the same path on golftiles.org while letting local development serve the branch's own style instead of the deployed copy.

Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants