ADR 0007: Style References (required_styles/optional_styles) as an Alternative to Layer-Level Composition
Status: Proposed
Date: 2026-07-21
Deciders: Staccato spec maintainers, Cartographer implementers
map-intent-vnext.md §4 only lets Staff express a user's request as a set of individual source_ids, via required_layers/optional_layers. In practice, some requests are naturally a request for a complete, pre-designed thematic map rather than a pile of layers — for example, "I want to see Hokkaido's volcanic land condition map" (火山土地条件図を見たい). When Staff tries to decompose such a request into source_ids, a mismatch appears: the user's intent is the finished map product itself, but the only vocabulary Staff has is individual data sources. This gap was identified and worked through concretely in hfu/faceless-cartographer#6.
Separately, a martin-type catalog (catalog-integration.md §3.1) is not only a tile-service publisher — Martin (the reference tile server used by this ecosystem's Library implementations) can also publish complete MapLibre Style Spec documents, exposed via GET {base}/style/{style_id}, alongside its existing GET {base}/{source_id} TileJSON endpoint. catalog-integration.md currently has no concept of this at all — map-intent-vnext.md and catalog-integration.md are both silent on "style" as a Map Intent concept.
hfu/faceless-cartographer implemented and deployed required_styles/optional_styles as an intentional deviation from current spec text (its own DECISIONS.md D39, following the same append-then-propose pattern as ADR 0003's D18 and ADR 0004–0006's D32/D34–D36). Concretely:
- Two thematic-only styles (extracted from
hfu/kitavolca's combined basemap+thematic style, keeping only thevlcm-*/vbm-*layers and theirvlcm/vbmsources) are published live athttps://stars.optgeo.org/style/vlcmand/style/vbm. - A Map Intent can reference either with
required_styles: [{style_id: "vlcm"}], andfaceless-cartographerresolves and renders it end-to-end, verified in a real browser against the live server (no mocking). - Notably, the published styles are deliberately thematic-only — they omit the background sources (
bvmap,mapterhorn,seamlessphoto) thathfu/kitavolca's own combined style bundles for its own standalone use. Cartographer already draws its own background unconditionally (a project-local convention,hfu/faceless-cartographerD24); including a second, redundant background inside a resolved style would double-render it.
We extend the Map Intent schema and the martin catalog type to support style-level references, as an alternative (not a replacement) to layer-level composition.
Add required_styles/optional_styles, structurally parallel to required_layers/optional_layers:
required_styles:
- style_id: "vlcm"
label: "Volcanic Land Condition Map"
optional_styles:
- style_id: "vbm"
label: "Volcanic Basic Map"style_idis a new canonical term (extendsarchitecture-principles.md§3): the canonical style identifier emitted intorequired_styles/optional_styles, resolved against amartin-type catalog'sGET {base}/style/{style_id}endpoint.labelis optional, same semantics asrequired_layers[*].label.
- At least one of
required_layersorrequired_stylesMUST be a non-empty array. Neither is unconditionally mandatory on its own anymore. required_styles/optional_stylesentries MUST each have a stringstyle_id, mirroring the existingsource_idshape rule.
- A
martin-type catalog MAY expose astylesobject alongsidetiles(Martin's own catalog root shape:{"tiles": {...}, "styles": {...}}). Style resolution MUST only be attempted againstmartin-type catalogs. layers_txtcatalogs have no equivalent endpoint concept and MUST NOT be attempted for style resolution — this is a structural limitation of that catalog type (a static mirror with no server-side style-publishing capability), not a policy choice.- A resolved style's
sources/layersare composed into the Cartographer's rendered map in the same position as layer-level thematic content, not as a replacement for whatever fixed background (if any) a given Cartographer implementation always draws.
A style published for required_styles/optional_styles consumption SHOULD be thematic-only: it SHOULD NOT bundle its own basemap/background sources and layers. A Library may separately publish a different, complete standalone style (background included) for its own direct use (e.g. a project's own demo page) — the two are different artifacts with different consumers, and conflating them causes duplicate rendering when the complete one is composed into a Cartographer that already draws its own background.
This is a SHOULD, not a MUST, because a Cartographer implementation that draws no background of its own would have no such conflict — but any Cartographer following the common pattern of an always-on background (as hfu/faceless-cartographer D24 does) will double-render if given a style that bundles one.
- Requests for a complete, pre-designed thematic product ("give me the volcanic land condition map") can be expressed directly, without Staff reconstructing it from individual
source_ids. - Library implementers can publish curated cartographic products — including layer ordering, symbology, and color design already reviewed and approved — as a first-class, independently referenceable resource, not just raw data sources.
- Matches (and is enabled by) an existing, real Martin server capability (
GET /style/{style_id}), rather than inventing a project-specific protocol (architecture-principles.md§2.3, convention over custom protocol).
- A second resolution path (alongside
source_id) that Staff, Cartographer, and Library implementers must all support; increases the surface area of the Map Intent schema. - The thematic-only publishing convention (Decision §4) is an extra authoring/maintenance burden for Library implementers who already maintain a complete standalone style for their own use — two artifacts to keep in sync instead of one.
- Martin's own operational note applies: style additions require a server restart to take effect (removals/changes are immediate), an operational quirk Library operators need to plan around.
- Testing must cover an unresolved
style_id(reported as missing, not a hard error — same posture as an unresolvedsource_id) and a resolved-but-empty-layersstyle (treated as unrenderable, not a crash). catalog-integration.md§7's futurecatalog_bindingsextension, if adopted, should be able to track style resolution provenance the same way it would tracksource_idprovenance.
-
Always decompose into
required_layers, even for "give me a complete map" requests. Rejected — this is the status quo that motivated this ADR; it structurally cannot express the user's actual intent for a pre-designed product, and pushes composition/design work onto Staff that a Library has already done and curated. -
A single unified array (e.g.
required_resources) with akind: "layer" | "style"discriminator, instead of two parallel array pairs. Considered, and would be more extensible if more resource kinds are added later. Not adopted here: the reference implementation keptrequired_styles/optional_stylesstructurally parallel to the already-establishedrequired_layers/optional_layersprecedent, prioritizing reviewability and minimal schema churn over generality. A future ADR could revisit unification if a third resource kind emerges. -
Embed style content directly in Map Intent (inline style JSON) instead of a
style_idreference. Rejected — breaks the reproducibility-via-catalog-provenance model thatsource_idalready relies on, and bloats Map Intent (styles can carry many layers) againstarchitecture-principles.md§2.5 (least disclosure / minimal payload).
- Formal guidance for Library implementers on authoring "thematic-only" styles (Decision §4) could grow into its own guidance document if more Library implementations start publishing styles.
- Whether
stac-type catalogs could someday expose an equivalent concept is left open; no such mapping is proposed here.
- ADR 0001: Faceless Cartographer
- ADR 0002: Enforce Staff Startup Catalog Contract and Ban Hidden Fallback
map-intent-vnext.md§4 (Schema), §6 (Validation Rules)catalog-integration.md§3.1 (martincatalog type)architecture-principles.md§3 (Canonical Terminology), §2.3 (Convention over custom protocol), §2.5 (Least disclosure)- Origin:
hfu/faceless-cartographer#6 - Implementation reference:
hfu/faceless-cartographerDECISIONS.mdD39; live deployment athttps://stars.optgeo.org/style/vlcmand/style/vbm - Style source material:
hfu/kitavolca