Skip to content

Draw our own base map and make it a mariner preference - #63

Open
bkeepers wants to merge 1 commit into
mainfrom
own-the-base-map
Open

Draw our own base map and make it a mariner preference#63
bkeepers wants to merge 1 commit into
mainfrom
own-the-base-map

Conversation

@bkeepers

@bkeepers bkeepers commented Aug 17, 2026

Copy link
Copy Markdown
Member

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 new basemap option — a mariner preference, on by default — at style generation time (style({ basemap }), ?basemap=true|false on the worker's style.json, ?basemap=false in 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):

  • Water with no depth data draws grey with sparse dashes (the partly-surveyed convention) from seascape's depare polygons, replacing the invented blue-stipple pattern.
  • The tiles' wetland layer — 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.
  • Glaciers draw white with scattered blue strokes (the paper convention) instead of vanishing into water or land fills.
  • Fill patterns fade in between z6 and z8: fixed-size pattern glyphs read as noise at small scales, so overview zooms get the flat tint alone.

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).

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
Copilot AI lite review requested due to automatic review settings August 17, 2026 01:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 basemap as 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/style dependency 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.

Comment thread style/index.test.ts
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).
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.

Island names are missing from the chart

2 participants