Draw our own base map and make it a mariner preference - #63
Open
bkeepers wants to merge 1 commit into
Open
Conversation
Replace @versatiles/style's colorful() with chart-styled layers authored against the VersaTiles shortbread tiles. The chart is now the host document and the base map an optional block behind a new basemap option (default on), exposed as ?basemap= on the worker's style.json and the viewer. Always-on chart topography keeps what charts require from the land side: urban extent, airports, bridges over navigable water, glaciers, national boundaries, and place, island, and locality names. The preference bucket carries the going-ashore context: roads, railways, minor streets, buildings, landcover, beaches, street names. Shortbread POIs, ferries, piers, transit, and addresses are deliberately not ported. New chart portrayals landed alongside, since the palette finally reaches the whole style: partly-surveyed water (NODTA grey with sparse PRTSUR01 dashes) drawn from seascape's depare polygons, marsh and tidal flats from the tiles' previously undrawn wetland layer, and paper-convention white glaciers. Fill patterns split into a flat base and a strokes-only overlay that fades in over z6-8, since fixed-size pattern glyphs read as noise at small scales. Removes the @versatiles/style dependency and the patch layer that fought its output. Base-map labels place before chart labels so chart labels win every collision. Closes #29
There was a problem hiding this comment.
Pull request overview
This PR replaces the previously imported VersaTiles “colorful” base-map style builder with an in-repo set of MapLibre style layers, and introduces a new basemap mariner preference (default on) that toggles non-chart land context while keeping chart topography always rendered.
Changes:
- Add
basemapas a style-generation option and propagate it end-to-end (style({ basemap }), worker?basemap=true|false, viewer?basemap=false). - Author new owned style layers for chart topography and optional base-map context; add wetlands portrayals and new fill-pattern sprites.
- Remove the
@versatiles/styledependency and update sprite generation/tests accordingly.
Reviewed changes
Copilot reviewed 13 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| worker/src/route.ts | Adds basemap parsing/validation to the style query parser. |
| worker/src/route.test.mjs | Adds test coverage for basemap query parsing. |
| worker/src/index.ts | Documents ?basemap=true|false on /style.json and relies on spreading validated query options into style generation. |
| viewer/src/main.js | Adds ?basemap=false support and passes basemap through to style(). |
| style/sprites/icons/unsurveyed.svg | Removes the old unsurveyed stipple pattern sprite. |
| style/sprites/icons/partly-surveyed.svg | Adds the new partly-surveyed dash pattern sprite. |
| style/sprites/icons/marsh.svg | Adds marsh tuft pattern sprite for wetland rendering. |
| style/sprites/icons/glacier.svg | Adds glacier stroke pattern sprite. |
| style/README.md | Updates package description, options list, and documents new layer modules/topography vs basemap split. |
| style/package.json | Removes @versatiles/style dependency. |
| style/layers/wetlands.ts | Introduces wetlands layers (tidal flats fill + marsh overlay pattern). |
| style/layers/topography.ts | Adds always-on chart topography layers sourced from shortbread tiles, including island/locality labels. |
| style/layers/palette.ts | Extends the day palette with new land/topography/basemap colors and no-data/glacier/intertidal colors. |
| style/layers/index.ts | Integrates wetlands into chart layer ordering (tidal flats under areas; marsh overlay under hazards). |
| style/layers/basemap.ts | Adds optional basemap preference layers (roads/rails/buildings/landcover/street labels). |
| style/index.ts | Rebuilds whole-style assembly without @versatiles/style, adds basemap option and new sources/layers wiring. |
| style/index.test.ts | Updates tests for new patterns, hillshade behavior, layer ordering, and basemap preference toggling. |
| style/bin/sprites | Updates the list of pattern icons to include newly introduced pattern sprites. |
| package-lock.json | Removes @versatiles/style and transitive deps from the lockfile. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| expect(ids).not.toContain(id); | ||
| // The base map is a mariner preference: turning it off removes exactly the | ||
| // basemap-* layers, never the chart's topography (place names, urban extent, | ||
| // and the unsurveyed stipple are chart content). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chart's base map is now drawn by our own style layers instead of @versatiles/style's
colorful()builder, and everything that isn't chart content sits behind a newbasemapoption — a mariner preference, on by default — at style generation time (style({ basemap }),?basemap=true|falseon the worker's style.json,?basemap=falsein the viewer). The VersaTiles infrastructure stays: shortbread tiles, glyphs, and elevation are still the data; only the styling is ours.Why
colorful()is a general-purpose topographic style, and a chart wants nearly the opposite: land as a subdued background in a small palette, most land detail omitted, and the mariner deciding how much context to show. Getting there meant maintaining a growing patch layer keyed to colorful's internal layer ids, which broke silently on upstream renames — and the palette could never reach the base map at all, which matters for the planned dusk/night modes. The owned layer set is small (charts omit most of what a topographic map draws), written once against the stable shortbread schema.What's in the base map now
Always-on chart topography, drawn even with
basemap=false: urban extent, airports, bridges over navigable water, glaciers, national boundaries, and place names — including island and locality names, which closes #29. Behind the preference: roads and railways, minor streets, buildings, landcover, beaches, and street names, all styled subdued so they never compete with chart content. Shortbread POIs, ferries, piers, transit symbols, and addresses are deliberately not ported.Base-map labels place before chart labels, so chart labels win every collision.
New chart portrayals
With the palette reaching the whole style, a few portrayals moved to their chart conventions (S-4/INT1/S-52):
wetlandlayer — carried since the fork but never drawn by any style — now renders: salt marshes as a tuft-pattern overlay, tidal flats in the drying tint. Salt-marsh estuaries no longer read as solid dry land.Known issue
Hairline seams and shore slivers are visible in partly-surveyed water (Great Salt Lake, Lake Peipus, Icelandic coast). These are geometry gaps in the seascape depare tiles — polygons stopping short of tile edges and of the OSM coastline — newly exposed because the old style painted a second water fill underneath. A seascape fix is in progress; nothing in this PR changes when it lands.
Follow-ups
Filed as issues: #24 (bridges and their clearances), #64 (overhead crossings and their clearances), #66 (cliffs), #68 (maritime boundaries), #69 (water-body names).