urls — the same shape as for osm() and satellite(): base resolves relative URLs (tiles,
glyphs, sprites) and defaults to the page origin, or tiles.versatiles.org outside a browser;
glyphsPattern and sprite set where the guessed style loads fonts and icons from.
fetch — used when source is a URL, as for inlineSources() and fetchTileJSON().
schemas — additional schemas to recognise, each the builder from its own subpath.
── Why schemas is an option and a registry was not ─────────────────────────
Auto-dispatch is the one thing one-function-per-subpath does not
get for free. guessStyle lives in the root entry, so importing every schema here would reintroduce
exactly the bundle cost that design avoids — a CDN user who never touches OpenMapTiles would still
download it. Injection keeps the cost with the caller who asked for it:
This is acceptable here precisely where a global registry was not: guessStyle is already
async, already does runtime detection, already takes a function-valued option (fetch), and its
options never pass through minimizeOptions/toCode, so nothing here has to round-trip.
The list is additive: which built-in schema a tileset is comes from guessSchema, which does not
depend on schemas at all — injecting omt only decides whether a tileset already detected as
OpenMapTiles gets its style or the inspector style. A schema of the caller's own (any other
tileset.id) is tried after that, by its sourceLayers, in the order given.
Options for guessStyle.
urls— the same shape as forosm()andsatellite():baseresolves relative URLs (tiles, glyphs, sprites) and defaults to the page origin, or tiles.versatiles.org outside a browser;glyphsPatternandspriteset where the guessed style loads fonts and icons from.fetch— used whensourceis a URL, as forinlineSources()andfetchTileJSON().schemas— additional schemas to recognise, each the builder from its own subpath.── Why
schemasis an option and a registry was not ─────────────────────────Auto-dispatch is the one thing one-function-per-subpath does not get for free.
guessStylelives in the root entry, so importing every schema here would reintroduce exactly the bundle cost that design avoids — a CDN user who never touches OpenMapTiles would still download it. Injection keeps the cost with the caller who asked for it:This is acceptable here precisely where a global registry was not:
guessStyleis already async, already does runtime detection, already takes a function-valued option (fetch), and its options never pass throughminimizeOptions/toCode, so nothing here has to round-trip.The list is additive: which built-in schema a tileset is comes from
guessSchema, which does not depend onschemasat all — injectingomtonly decides whether a tileset already detected as OpenMapTiles gets its style or the inspector style. A schema of the caller's own (any othertileset.id) is tried after that, by itssourceLayers, in the order given.