@chrtco/sdk 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -22224,7 +22224,7 @@ function getLabelConfig(layerName, opts = {}) {
22224
22224
  screenColors.deeper
22225
22225
  ] : screenColors.shoaler;
22226
22226
  const haloColor = screenColors.halo;
22227
- const fontStack = weight === "semibold" ? ["Open Sans Semibold", "Open Sans Regular"] : ["Open Sans Regular"];
22227
+ const fontStack = weight === "semibold" ? ["Open Sans Semibold"] : ["Open Sans Regular"];
22228
22228
  return {
22229
22229
  type: "symbol",
22230
22230
  // Property name varies by source path:
@@ -27503,7 +27503,14 @@ function generateStyle(palette = "DAY", opts = {}) {
27503
27503
  const sources = buildSources(opts);
27504
27504
  const sourceId = opts.region ?? DEFAULT_REGION;
27505
27505
  const orderedClasses = getOrderedClasses();
27506
- const layers = [];
27506
+ const backgroundLayer = {
27507
+ id: "chrt-background",
27508
+ type: "background",
27509
+ // A background layer takes no source; StyleLayer models sourced layers,
27510
+ // so the never-used source fields are absent via the unknown hop.
27511
+ paint: { "background-color": resolveColor("NODTA", palette) }
27512
+ };
27513
+ const layers = [backgroundLayer];
27507
27514
  const labelLayers = [];
27508
27515
  const chartCascade = opts.chartMode ? CHART_CASCADE_CODES[opts.chartMode.band] : null;
27509
27516
  const chartRequestedCodes = opts.chartMode ? CHART_BAND_CODES[opts.chartMode.band] : null;
@@ -27617,6 +27624,7 @@ function generateStyle(palette = "DAY", opts = {}) {
27617
27624
  layers.push(...labelLayers);
27618
27625
  }
27619
27626
  const symbolSet = opts.symbolSet ?? "s52";
27627
+ const spriteBase = `${opts.tileBaseUrl ?? "https://tiles.chrt.co"}/v1/sprites`;
27620
27628
  const style = {
27621
27629
  version: 8,
27622
27630
  name: `CHRT ${SYMBOL_SET_LABELS[symbolSet]} ${PALETTE_NAMES[palette]}${opts.chartMode ? ` \u2014 chart:${opts.chartMode.band}` : ""}`,
@@ -27630,13 +27638,21 @@ function generateStyle(palette = "DAY", opts = {}) {
27630
27638
  "chrt:description": "IHO S-52 portrayal rules for Electronic Navigational Charts (ENCs). Generated from the CHRT atlas engine."
27631
27639
  },
27632
27640
  sources,
27633
- // TODO(Phase 9): the superadmin style-generator emits a reference JSON
27634
- // intended for external upload to Mapbox Studio. That flow is vestigial —
27635
- // we're decommissioning Mapbox MTS. When the page is repurposed to
27636
- // generate a MapLibre-native style for self-hosted consumers, wire the
27637
- // `sprite` field back in against a CHRT-hosted sprite route (see
27638
- // `.chrt/` follow-ups). Runtime maps load S-52 symbols via
27639
- // `loadS52SymbolImages()` — no sprite fetch happens at runtime.
27641
+ // A standard GL sprite, declared in the style — the mechanism every GL
27642
+ // renderer (JS and native) already implements. The web app additionally
27643
+ // registers atlas images at runtime via loadS52SymbolImages() (which wins
27644
+ // when both are present, so JS behavior is unchanged); native consumers
27645
+ // get their icons from this declaration alone. s52 sheets are per-palette
27646
+ // (the artwork carries S-52 colour tokens); chrt and raster are
27647
+ // fixed-palette, one sheet each. s101 deliberately declares NO sprite
27648
+ // until the vendored S-100 artwork clears licence review — see
27649
+ // assets/s101/PROVENANCE.md. CHRTsail #122.
27650
+ // Every non-s101 family is palette-scoped: chrt and raster keep fixed
27651
+ // palettes for their OWN glyphs, but both fall back to s52 artwork for
27652
+ // classes they don't remap — and that artwork carries colour tokens.
27653
+ ...symbolSet !== "s101" && {
27654
+ sprite: `${spriteBase}/${symbolSet}-${palette.toLowerCase()}`
27655
+ },
27640
27656
  glyphs: "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",
27641
27657
  layers
27642
27658
  };