@tileflow/core 0.1.0-alpha.19 → 0.1.0-alpha.20

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/README.md CHANGED
@@ -247,6 +247,18 @@ source-layers or properties while preserving the versioned semantic contract. Ex
247
247
  credentials do not belong in public Style JSON; supply them through the framework's
248
248
  `transformRequest` integration.
249
249
 
250
+ Tileflow's OpenMapTiles contract also recognizes the optional `globallandcover` extension. The
251
+ default Streets style maps its `barren`, `crop`, `grass`, `shrub`, `snow`, `trees`, and `urban`
252
+ classes beneath the OSM land layers at zooms 0–7, fading to transparent at zoom 8. Sources with a
253
+ different layer name can use `openMapTiles({layers: {globalLandcover: 'my_landcover'}})`; archives
254
+ without the extension remain compatible and simply render no features for that style layer.
255
+
256
+ The pinned legacy Tileflow World revision keeps its historical attribution inline in the generated
257
+ style. Every other explicitly pinned official revision delegates attribution to its versioned
258
+ TileJSON, so MapLibre displays the exact text bound to that archive's release receipt. The SDK does
259
+ not guess a legal string or fall back to the legacy attribution for a new product; publishing must
260
+ fail before selection when that immutable TileJSON has no receipt-backed attribution.
261
+
250
262
  ## Capture scenes
251
263
 
252
264
  Commit named scenes beside maps. Scenes affect visual evidence, not style or manifest identity.
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as TileflowAnalytics, a as TileflowSessionController } from './runtime-Dd_xGAXq.js';
1
+ import { T as TileflowAnalytics, a as TileflowSessionController } from './runtime-DroKDIuB.js';
2
2
  import 'zod';
3
3
 
4
4
  type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as TileflowBaseColors, c as TileflowConfig, d as TileflowProjectConfig, V as ValidationResult, e as TileflowRoadsModuleOptions, f as TileflowRoadsModuleConfig, g as TileflowLabelsModuleOptions, h as TileflowLabelsModuleConfig, i as TileflowPoiModuleOptions, j as TileflowPoiModuleConfig } from './runtime-Dd_xGAXq.js';
2
- export { M as MapLibreSprite, k as MapLibreStyle, N as NormalizedTileflowCaptureScene, O as OpenMapTilesFieldBindings, l as OpenMapTilesLayerBindings, m as OpenMapTilesSchema, n as OpenMapTilesSchemaOptions, R as ResolvedTileflowData, o as ResolvedTileflowTypography, p as TileflowAerowaysModuleConfig, q as TileflowAerowaysModuleOptions, r as TileflowAlignment, T as TileflowAnalytics, s as TileflowAreaStyle, t as TileflowBackgroundPaint, u as TileflowBackgroundStyle, v as TileflowBoundariesModuleConfig, w as TileflowBoundariesModuleOptions, x as TileflowBoundaryColorConfig, y as TileflowBuildingColorConfig, z as TileflowBuildingMode, A as TileflowBuildingsModuleConfig, B as TileflowBuildingsModuleOptions, C as TileflowCaptureApplicationTarget, D as TileflowCaptureBoundsCamera, E as TileflowCaptureCamera, F as TileflowCaptureCenterCamera, G as TileflowCaptureMapTarget, H as TileflowCaptureScene, I as TileflowCaptureTarget, J as TileflowCaptureViewport, K as TileflowCirclePaint, L as TileflowCircleStyle, P as TileflowColor, Q as TileflowColorConfig, S as TileflowColors, U as TileflowDataConfig, W as TileflowDataIdentity, X as TileflowExpression, Y as TileflowExtrusionPaint, Z as TileflowExtrusionStyle, _ as TileflowFillPaint, $ as TileflowFillStyle, a0 as TileflowFilterExpression, a1 as TileflowFontWeight, a2 as TileflowHostedNotoSansWeight, a3 as TileflowHydroColorConfig, a4 as TileflowIconAnchor, a5 as TileflowIconLayout, a6 as TileflowIconPaint, a7 as TileflowIconSet, a8 as TileflowIconSetConfig, a9 as TileflowIconStyle, aa as TileflowLabelColorConfig, ab as TileflowLabelDetail, ac as TileflowLabelLanguage, ad as TileflowLabelStyles, ae as TileflowLandModuleConfig, af as TileflowLandModuleOptions, ag as TileflowLandcoverClass, ah as TileflowLandcoverColorConfig, ai as TileflowLanduseClass, aj as TileflowLanduseColorConfig, ak as TileflowLayerPlacement, al as TileflowLayerRange, am as TileflowLineCap, an as TileflowLineHatchStyle, ao as TileflowLineJoin, ap as TileflowLineLayout, aq as TileflowLinePaint, ar as TileflowLineStackStyle, as as TileflowLineStyle, at as TileflowManifest, au as TileflowManifestLoadOptions, av as TileflowMapConfig, aw as TileflowMapMarker, ax as TileflowMapMode, ay as TileflowMapModeOptions, az as TileflowMountainBikeScale, aA as TileflowPlaceLabelClass, aB as TileflowPoi, aC as TileflowPoiCategory, aD as TileflowPoiCategoryStyle, aE as TileflowPoiClassMapping, aF as TileflowPoiColorConfig, aG as TileflowPoiColorMode, aH as TileflowPoiDensity, aI as TileflowPoiIcons, aJ as TileflowPoiLabels, aK as TileflowProjectIconSets, aL as TileflowProjectThemes, aM as TileflowRawOverride, aN as TileflowRoadAreaStyle, aO as TileflowRoadClass, aP as TileflowRoadClassStyle, aQ as TileflowRoadColorConfig, aR as TileflowRoadDetail, aS as TileflowRoadExtras, aT as TileflowRoadHierarchy, aU as TileflowRoadLabelDetail, aV as TileflowRoadLayerStyle, aW as TileflowRoadModifier, aX as TileflowRoadOutline, aY as TileflowRoadRestriction, aZ as TileflowRoadServiceType, a_ as TileflowRoadShieldDetail, a$ as TileflowRoadShieldStyles, b0 as TileflowRoadStructure, b1 as TileflowRoadTreatmentLayerStyle, b2 as TileflowRoadTreatmentLineStyle, b3 as TileflowRoadTreatmentStyle, b4 as TileflowRoadWeight, b5 as TileflowRuntimeManifest, b6 as TileflowRuntimeManifestMap, b7 as TileflowRuntimeManifestMapEntry, b8 as TileflowRuntimeStyle, b9 as TileflowRuntimeStyleOptions, a as TileflowSessionController, ba as TileflowSessionGrantResponse, bb as TileflowStreetsBasemapConfig, bc as TileflowStreetsCompileOptions, bd as TileflowStreetsMapConfig, be as TileflowStreetsModules, bf as TileflowStreetsOptions, bg as TileflowStreetsVariant, bh as TileflowStyleOptions, bi as TileflowStyleValue, bj as TileflowSymbolPlacement, bk as TileflowSymbolPlacementStyle, bl as TileflowSymbolStyle, bm as TileflowSymbolZOrder, bn as TileflowTerrain, bo as TileflowTerrainConfig, bp as TileflowTerrainEncoding, bq as TileflowTerrainMode, br as TileflowTextAnchor, bs as TileflowTextJustify, bt as TileflowTextLayout, bu as TileflowTextPaint, bv as TileflowTextStyle, bw as TileflowTheme, bx as TileflowThemeConfig, by as TileflowThemeMode, bz as TileflowThemeModulesConfig, bA as TileflowThemeName, bB as TileflowTransitModuleConfig, bC as TileflowTransitModuleOptions, bD as TileflowTransitRailStyle, bE as TileflowTypography, bF as TileflowTypographyDomain, bG as TileflowTypographyStyle, bH as TileflowViewConfig, bI as TileflowWaterLabelClass, bJ as TileflowWaterModuleConfig, bK as TileflowWaterModuleOptions, bL as TileflowWaterwayClass, bM as TileflowWorldData, bN as TileflowZoomInterpolation, bO as TileflowZoomValue, bP as ValidationMessage, bQ as VectorTilesData, bR as addLayer, bS as aeroways, bT as boundaries, bU as buildings, bV as createManifest, bW as createStreetsStyle, bX as createStyle, bY as createStyleFromProject, bZ as createTileflowSessionController, b_ as createTileflowSessionId, b$ as defaultTileflowManifestUrl, c0 as defaultTileflowStyleBaseUrl, c1 as expression, c2 as filter, c3 as getDefaultTileflowStyleBaseUrl, c4 as getTileflowAnalyticsApiUrl, c5 as inferTileflowAnalyticsFromStyleUrl, c6 as isCanonicalOpenMapTilesSchema, c7 as isTileflowLocalDevHost, c8 as land, c9 as loadTileflowManifest, ca as mergeTileflowAnalytics, cb as moveLayer, cc as normalizeTileflowCaptureId, cd as normalizeTileflowCaptureScene, ce as normalizeTileflowStaticImageSize, cf as normalizeTileflowUrl, cg as openMapTiles, ch as openMapTilesContractVersion, ci as patchLayer, cj as removeLayer, ck as resolveTileflowAnalyticsRequestUrl, cl as resolveTileflowData, cm as resolveTileflowManifestMap, cn as resolveTileflowMapMode, co as resolveTileflowRuntimeStyle, cp as resolveTileflowStaticImageUrl, cq as resolveTileflowStyleUrl, cr as shouldLoadTileflowManifest, cs as startTileflowSession, ct as streets, cu as tileflowCaptureApplicationTargetSchema, cv as tileflowCaptureBoundsCameraSchema, cw as tileflowCaptureCameraSchema, cx as tileflowCaptureCenterCameraSchema, cy as tileflowCaptureIdSchema, cz as tileflowCaptureMapTargetSchema, cA as tileflowCaptureSceneLimits, cB as tileflowCaptureSceneNameSchema, cC as tileflowCaptureSceneSchema, cD as tileflowCaptureSceneSchemaVersion, cE as tileflowCaptureTargetSchema, cF as tileflowCaptureViewportSchema, cG as tileflowFontStack, cH as tileflowHostedNotoSansWeights, cI as tileflowPrimarySourceId, cJ as tileflowStreetsBasemapVersion, cK as tileflowStreetsPoiIconMapping, cL as tileflowWorld, cM as tileflowWorldRevision, cN as transit, cO as vectorTiles, cP as water, cQ as zoom } from './runtime-Dd_xGAXq.js';
1
+ import { b as TileflowBaseColors, c as TileflowConfig, d as TileflowProjectConfig, V as ValidationResult, e as TileflowRoadsModuleOptions, f as TileflowRoadsModuleConfig, g as TileflowLabelsModuleOptions, h as TileflowLabelsModuleConfig, i as TileflowPoiModuleOptions, j as TileflowPoiModuleConfig } from './runtime-DroKDIuB.js';
2
+ export { M as MapLibreSprite, k as MapLibreStyle, N as NormalizedTileflowCaptureScene, O as OpenMapTilesFieldBindings, l as OpenMapTilesLayerBindings, m as OpenMapTilesSchema, n as OpenMapTilesSchemaOptions, R as ResolvedTileflowData, o as ResolvedTileflowTypography, p as TileflowAerowaysModuleConfig, q as TileflowAerowaysModuleOptions, r as TileflowAlignment, T as TileflowAnalytics, s as TileflowAreaStyle, t as TileflowBackgroundPaint, u as TileflowBackgroundStyle, v as TileflowBoundariesModuleConfig, w as TileflowBoundariesModuleOptions, x as TileflowBoundaryColorConfig, y as TileflowBuildingColorConfig, z as TileflowBuildingMode, A as TileflowBuildingsModuleConfig, B as TileflowBuildingsModuleOptions, C as TileflowCaptureApplicationTarget, D as TileflowCaptureBoundsCamera, E as TileflowCaptureCamera, F as TileflowCaptureCenterCamera, G as TileflowCaptureMapTarget, H as TileflowCaptureScene, I as TileflowCaptureTarget, J as TileflowCaptureViewport, K as TileflowCirclePaint, L as TileflowCircleStyle, P as TileflowColor, Q as TileflowColorConfig, S as TileflowColors, U as TileflowDataConfig, W as TileflowDataIdentity, X as TileflowExpression, Y as TileflowExtrusionPaint, Z as TileflowExtrusionStyle, _ as TileflowFillPaint, $ as TileflowFillStyle, a0 as TileflowFilterExpression, a1 as TileflowFontWeight, a2 as TileflowHostedNotoSansWeight, a3 as TileflowHydroColorConfig, a4 as TileflowIconAnchor, a5 as TileflowIconLayout, a6 as TileflowIconPaint, a7 as TileflowIconSet, a8 as TileflowIconSetConfig, a9 as TileflowIconStyle, aa as TileflowLabelColorConfig, ab as TileflowLabelDetail, ac as TileflowLabelLanguage, ad as TileflowLabelStyles, ae as TileflowLandModuleConfig, af as TileflowLandModuleOptions, ag as TileflowLandcoverClass, ah as TileflowLandcoverColorConfig, ai as TileflowLanduseClass, aj as TileflowLanduseColorConfig, ak as TileflowLayerPlacement, al as TileflowLayerRange, am as TileflowLineCap, an as TileflowLineHatchStyle, ao as TileflowLineJoin, ap as TileflowLineLayout, aq as TileflowLinePaint, ar as TileflowLineStackStyle, as as TileflowLineStyle, at as TileflowManifest, au as TileflowManifestLoadOptions, av as TileflowMapConfig, aw as TileflowMapMarker, ax as TileflowMapMode, ay as TileflowMapModeOptions, az as TileflowMountainBikeScale, aA as TileflowPlaceLabelClass, aB as TileflowPoi, aC as TileflowPoiCategory, aD as TileflowPoiCategoryStyle, aE as TileflowPoiClassMapping, aF as TileflowPoiColorConfig, aG as TileflowPoiColorMode, aH as TileflowPoiDensity, aI as TileflowPoiIcons, aJ as TileflowPoiLabels, aK as TileflowProjectIconSets, aL as TileflowProjectThemes, aM as TileflowRawOverride, aN as TileflowRoadAreaStyle, aO as TileflowRoadClass, aP as TileflowRoadClassStyle, aQ as TileflowRoadColorConfig, aR as TileflowRoadDetail, aS as TileflowRoadExtras, aT as TileflowRoadHierarchy, aU as TileflowRoadLabelDetail, aV as TileflowRoadLayerStyle, aW as TileflowRoadModifier, aX as TileflowRoadOutline, aY as TileflowRoadRestriction, aZ as TileflowRoadServiceType, a_ as TileflowRoadShieldDetail, a$ as TileflowRoadShieldStyles, b0 as TileflowRoadStructure, b1 as TileflowRoadTreatmentLayerStyle, b2 as TileflowRoadTreatmentLineStyle, b3 as TileflowRoadTreatmentStyle, b4 as TileflowRoadWeight, b5 as TileflowRuntimeManifest, b6 as TileflowRuntimeManifestMap, b7 as TileflowRuntimeManifestMapEntry, b8 as TileflowRuntimeStyle, b9 as TileflowRuntimeStyleOptions, a as TileflowSessionController, ba as TileflowSessionGrantResponse, bb as TileflowStreetsBasemapConfig, bc as TileflowStreetsCompileOptions, bd as TileflowStreetsMapConfig, be as TileflowStreetsModules, bf as TileflowStreetsOptions, bg as TileflowStreetsVariant, bh as TileflowStyleOptions, bi as TileflowStyleValue, bj as TileflowSymbolPlacement, bk as TileflowSymbolPlacementStyle, bl as TileflowSymbolStyle, bm as TileflowSymbolZOrder, bn as TileflowTerrain, bo as TileflowTerrainConfig, bp as TileflowTerrainEncoding, bq as TileflowTerrainMode, br as TileflowTextAnchor, bs as TileflowTextJustify, bt as TileflowTextLayout, bu as TileflowTextPaint, bv as TileflowTextStyle, bw as TileflowTheme, bx as TileflowThemeConfig, by as TileflowThemeMode, bz as TileflowThemeModulesConfig, bA as TileflowThemeName, bB as TileflowTransitModuleConfig, bC as TileflowTransitModuleOptions, bD as TileflowTransitRailStyle, bE as TileflowTypography, bF as TileflowTypographyDomain, bG as TileflowTypographyStyle, bH as TileflowViewConfig, bI as TileflowWaterLabelClass, bJ as TileflowWaterModuleConfig, bK as TileflowWaterModuleOptions, bL as TileflowWaterwayClass, bM as TileflowWorldData, bN as TileflowZoomInterpolation, bO as TileflowZoomValue, bP as ValidationMessage, bQ as VectorTilesData, bR as addLayer, bS as aeroways, bT as boundaries, bU as buildings, bV as createManifest, bW as createStreetsStyle, bX as createStyle, bY as createStyleFromProject, bZ as createTileflowSessionController, b_ as createTileflowSessionId, b$ as defaultTileflowManifestUrl, c0 as defaultTileflowStyleBaseUrl, c1 as expression, c2 as filter, c3 as getDefaultTileflowStyleBaseUrl, c4 as getTileflowAnalyticsApiUrl, c5 as inferTileflowAnalyticsFromStyleUrl, c6 as isCanonicalOpenMapTilesSchema, c7 as isTileflowLocalDevHost, c8 as land, c9 as loadTileflowManifest, ca as mergeTileflowAnalytics, cb as moveLayer, cc as normalizeTileflowCaptureId, cd as normalizeTileflowCaptureScene, ce as normalizeTileflowStaticImageSize, cf as normalizeTileflowUrl, cg as openMapTiles, ch as openMapTilesContractVersion, ci as patchLayer, cj as removeLayer, ck as resolveTileflowAnalyticsRequestUrl, cl as resolveTileflowData, cm as resolveTileflowManifestMap, cn as resolveTileflowMapMode, co as resolveTileflowRuntimeStyle, cp as resolveTileflowStaticImageUrl, cq as resolveTileflowStyleUrl, cr as shouldLoadTileflowManifest, cs as startTileflowSession, ct as streets, cu as tileflowCaptureApplicationTargetSchema, cv as tileflowCaptureBoundsCameraSchema, cw as tileflowCaptureCameraSchema, cx as tileflowCaptureCenterCameraSchema, cy as tileflowCaptureIdSchema, cz as tileflowCaptureMapTargetSchema, cA as tileflowCaptureSceneLimits, cB as tileflowCaptureSceneNameSchema, cC as tileflowCaptureSceneSchema, cD as tileflowCaptureSceneSchemaVersion, cE as tileflowCaptureTargetSchema, cF as tileflowCaptureViewportSchema, cG as tileflowFontStack, cH as tileflowHostedNotoSansWeights, cI as tileflowPrimarySourceId, cJ as tileflowStreetsBasemapVersion, cK as tileflowStreetsPoiIconMapping, cL as tileflowWorld, cM as tileflowWorldRevision, cN as transit, cO as vectorTiles, cP as water, cQ as zoom } from './runtime-DroKDIuB.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare function getDefaultColors(): TileflowBaseColors;
package/dist/index.js CHANGED
@@ -511,6 +511,7 @@ var canonicalLayers = {
511
511
  aeroway: "aeroway",
512
512
  boundary: "boundary",
513
513
  building: "building",
514
+ globalLandcover: "globallandcover",
514
515
  landcover: "landcover",
515
516
  landuse: "landuse",
516
517
  park: "park",
@@ -562,7 +563,11 @@ function openMapTiles(options = {}) {
562
563
  type: "openmaptiles",
563
564
  contractVersion: openMapTilesContractVersion,
564
565
  fields: { ...canonicalFields, ...options.fields },
565
- layers: { ...canonicalLayers, ...options.layers }
566
+ layers: {
567
+ ...canonicalLayers,
568
+ ...options.layers,
569
+ globalLandcover: options.layers?.globalLandcover ?? canonicalLayers.globalLandcover
570
+ }
566
571
  };
567
572
  }
568
573
  function tileflowWorld(options = {}) {
@@ -592,7 +597,7 @@ function resolveTileflowData(data, options = {}) {
592
597
  url.searchParams.set("archiveVersion", revision);
593
598
  const schema2 = openMapTiles();
594
599
  return {
595
- attribution: defaultAttribution,
600
+ ...revision === tileflowWorldRevision ? { attribution: defaultAttribution } : {},
596
601
  identity: dataIdentity(descriptor.type, schema2, revision),
597
602
  kind: descriptor.type,
598
603
  revision,
@@ -614,7 +619,7 @@ function resolveTileflowData(data, options = {}) {
614
619
  }
615
620
  function isCanonicalOpenMapTilesSchema(schema) {
616
621
  return Object.entries(canonicalLayers).every(
617
- ([key, value]) => schema.layers[key] === value
622
+ ([key, value]) => (schema.layers[key] ?? (key === "globalLandcover" ? canonicalLayers.globalLandcover : void 0)) === value
618
623
  ) && Object.entries(canonicalFields).every(
619
624
  ([key, value]) => schema.fields[key] === value
620
625
  );
@@ -679,7 +684,10 @@ function validateOpenMapTilesSchema(schema) {
679
684
  return {
680
685
  ...schema,
681
686
  fields: { ...schema.fields },
682
- layers: { ...schema.layers }
687
+ layers: {
688
+ ...schema.layers,
689
+ globalLandcover: schema.layers.globalLandcover ?? canonicalLayers.globalLandcover
690
+ }
683
691
  };
684
692
  }
685
693
  function validateRevision(value) {
@@ -1608,21 +1616,34 @@ function symbolContribution(target, localOrder, layer) {
1608
1616
  // src/modules/land/compiler.ts
1609
1617
  var landuseClasses = {
1610
1618
  cemetery: ["cemetery"],
1611
- civic: ["school", "university", "hospital", "civic"],
1619
+ civic: [
1620
+ "school",
1621
+ "university",
1622
+ "hospital",
1623
+ "civic",
1624
+ "college",
1625
+ "kindergarten",
1626
+ "education",
1627
+ "library"
1628
+ ],
1612
1629
  commercial: ["commercial", "retail"],
1613
1630
  industrial: ["industrial"],
1631
+ military: ["military"],
1614
1632
  railway: ["railway"],
1633
+ recreation: ["pitch", "track", "playground", "zoo"],
1615
1634
  residential: ["residential"]
1616
1635
  };
1617
1636
  var landcoverClasses = {
1618
- farmland: ["farmland"],
1619
- grass: ["grass"],
1620
- ice: ["ice", "glacier"],
1621
- park: ["park"],
1622
- protected: ["protected_area"],
1623
- sand: ["sand", "beach"],
1624
- scrub: ["scrub"],
1625
- wood: ["wood", "forest"]
1637
+ farmland: { class: ["farmland"] },
1638
+ grass: { class: ["grass"] },
1639
+ ice: { class: ["ice", "glacier"] },
1640
+ park: { class: ["park"] },
1641
+ protected: { class: ["protected_area"] },
1642
+ rock: { class: ["rock"] },
1643
+ sand: { class: ["sand", "beach"] },
1644
+ scrub: { class: ["grass"], subclass: ["scrub"] },
1645
+ wetland: { class: ["wetland"] },
1646
+ wood: { class: ["wood", "forest"] }
1626
1647
  };
1627
1648
  function compileLand(request, context) {
1628
1649
  const colors = context.colors;
@@ -1636,7 +1657,9 @@ function compileLand(request, context) {
1636
1657
  civic: { fill: { color: colors.landuse.civic, opacity: 0.62 } },
1637
1658
  commercial: { fill: { color: colors.landuse.commercial, opacity: 0.62 } },
1638
1659
  industrial: { fill: { color: colors.landuse.industrial, opacity: 0.62 } },
1660
+ military: { fill: { color: colors.landuse.military, opacity: 0.5 } },
1639
1661
  railway: { fill: { color: colors.landuse.industrial, opacity: 0.62 } },
1662
+ recreation: { fill: { color: colors.landuse.recreation, opacity: 0.62 } },
1640
1663
  residential: { fill: { color: colors.landuse.residential, opacity: 0.62 } }
1641
1664
  },
1642
1665
  landcover: {
@@ -1645,8 +1668,10 @@ function compileLand(request, context) {
1645
1668
  ice: { fill: { color: colors.landcover.ice, opacity: 0.88 } },
1646
1669
  park: { fill: { color: colors.landcover.park, opacity: 0.78 } },
1647
1670
  protected: { fill: { color: colors.landcover.protected, opacity: 0.88 } },
1671
+ rock: { fill: { color: colors.landcover.rock, opacity: 0.85 } },
1648
1672
  sand: { fill: { color: colors.landcover.sand, opacity: 0.88 } },
1649
1673
  scrub: { fill: { color: colors.landcover.protected, opacity: 0.88 } },
1674
+ wetland: { fill: { color: colors.landcover.wetland, opacity: 0.82 } },
1650
1675
  wood: { fill: { color: colors.landcover.wood, opacity: 0.88 } }
1651
1676
  }
1652
1677
  },
@@ -1656,6 +1681,7 @@ function compileLand(request, context) {
1656
1681
  const source = context.data.sourceId;
1657
1682
  const schema = context.data.schema;
1658
1683
  const classField = schema.fields.class;
1684
+ const subclassField = schema.fields.subclass;
1659
1685
  const contributions = [];
1660
1686
  if (config.background?.visible !== false) {
1661
1687
  const background = config.background ?? {};
@@ -1674,6 +1700,43 @@ function compileLand(request, context) {
1674
1700
  target: "land.background"
1675
1701
  });
1676
1702
  }
1703
+ contributions.push({
1704
+ kind: "layer",
1705
+ layer: {
1706
+ id: "streets-global-landcover",
1707
+ type: "fill",
1708
+ source,
1709
+ "source-layer": schema.layers.globalLandcover ?? "globallandcover",
1710
+ minzoom: 0,
1711
+ maxzoom: 8,
1712
+ paint: {
1713
+ "fill-color": [
1714
+ "match",
1715
+ ["get", classField],
1716
+ "barren",
1717
+ colors.landcover.rock,
1718
+ "crop",
1719
+ colors.roadMajor,
1720
+ "grass",
1721
+ colors.landcover.grass,
1722
+ "shrub",
1723
+ colors.landcover.protected,
1724
+ "snow",
1725
+ colors.landcover.ice,
1726
+ "trees",
1727
+ colors.landcover.wood,
1728
+ "urban",
1729
+ colors.building,
1730
+ "rgba(0, 0, 0, 0)"
1731
+ ],
1732
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 0.88, 6, 0.82, 7, 0.68, 8, 0]
1733
+ }
1734
+ },
1735
+ localOrder: 10,
1736
+ owner: "land",
1737
+ slot: "land",
1738
+ target: "land.globalLandcover"
1739
+ });
1677
1740
  let localOrder = 100;
1678
1741
  for (const [name, classes] of Object.entries(landuseClasses)) {
1679
1742
  const style = config.landuse?.[name];
@@ -1698,7 +1761,7 @@ function compileLand(request, context) {
1698
1761
  });
1699
1762
  }
1700
1763
  }
1701
- for (const [name, classes] of Object.entries(landcoverClasses)) {
1764
+ for (const [name, match] of Object.entries(landcoverClasses)) {
1702
1765
  const style = config.landcover?.[name];
1703
1766
  if (!style) continue;
1704
1767
  const sourceLayer = name === "park" ? schema.layers.park : schema.layers.landcover;
@@ -1708,7 +1771,7 @@ function compileLand(request, context) {
1708
1771
  type: "fill",
1709
1772
  source,
1710
1773
  "source-layer": sourceLayer,
1711
- ...name === "park" ? {} : { filter: classFilter2(classField, classes) }
1774
+ ...name === "park" ? {} : { filter: landcoverFilter(classField, subclassField, match) }
1712
1775
  },
1713
1776
  style
1714
1777
  )) {
@@ -1727,6 +1790,11 @@ function compileLand(request, context) {
1727
1790
  function classFilter2(field, classes) {
1728
1791
  return ["match", ["get", field], classes, true, false];
1729
1792
  }
1793
+ function landcoverFilter(classField, subclassField, match) {
1794
+ const filter2 = classFilter2(classField, match.class);
1795
+ if (!match.subclass) return filter2;
1796
+ return ["all", filter2, classFilter2(subclassField, match.subclass)];
1797
+ }
1730
1798
 
1731
1799
  // src/modules/poi/compiler.ts
1732
1800
  function compilePoi(request, context) {
@@ -2091,6 +2159,8 @@ function resolveColors(overrides = {}, defaults3 = defaultColors, moduleOverride
2091
2159
  civic: mix(base.land, base.textMuted, 0.08),
2092
2160
  commercial: mix(base.land, base.textMuted, 0.05),
2093
2161
  industrial: mix(base.land, base.text, 0.04),
2162
+ military: mix(base.land, base.textMuted, 0.16),
2163
+ recreation: mix(base.park, base.land, 0.15),
2094
2164
  residential: mix(base.land, base.background, 0.35)
2095
2165
  };
2096
2166
  const landcoverDefaults = {
@@ -2098,7 +2168,9 @@ function resolveColors(overrides = {}, defaults3 = defaultColors, moduleOverride
2098
2168
  ice: mix(base.water, base.background, 0.65),
2099
2169
  park: base.park,
2100
2170
  protected: mix(base.park, base.textMuted, 0.08),
2171
+ rock: mix(base.land, base.text, 0.12),
2101
2172
  sand: mix(base.land, base.roadMajor, 0.1),
2173
+ wetland: mix(base.water, base.park, 0.35),
2102
2174
  wood: mix(base.park, base.text, 0.08)
2103
2175
  };
2104
2176
  const hydroDefaults = {
@@ -3423,7 +3495,7 @@ function createStreetsStyle(config, options = {}) {
3423
3495
  [data.sourceId]: {
3424
3496
  type: "vector",
3425
3497
  url: data.url,
3426
- attribution: data.attribution
3498
+ ...data.attribution ? { attribution: data.attribution } : {}
3427
3499
  },
3428
3500
  ...terrain ? { [terrain.sourceId]: terrain.source } : {}
3429
3501
  },
@@ -4194,6 +4266,7 @@ var layerBindingsSchema = z2.object({
4194
4266
  aeroway: z2.string().trim().min(1),
4195
4267
  boundary: z2.string().trim().min(1),
4196
4268
  building: z2.string().trim().min(1),
4269
+ globalLandcover: z2.string().trim().min(1),
4197
4270
  landcover: z2.string().trim().min(1),
4198
4271
  landuse: z2.string().trim().min(1),
4199
4272
  park: z2.string().trim().min(1),
@@ -373,8 +373,8 @@ type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
373
373
  };
374
374
  declare function buildings(options?: TileflowBuildingsModuleOptions): TileflowBuildingsModuleConfig;
375
375
 
376
- type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'industrial' | 'railway' | 'residential';
377
- type TileflowLandcoverClass = 'farmland' | 'grass' | 'ice' | 'park' | 'protected' | 'sand' | 'scrub' | 'wood';
376
+ type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'industrial' | 'military' | 'railway' | 'recreation' | 'residential';
377
+ type TileflowLandcoverClass = 'farmland' | 'grass' | 'ice' | 'park' | 'protected' | 'rock' | 'sand' | 'scrub' | 'wetland' | 'wood';
378
378
  type TileflowLandModuleOptions = {
379
379
  background?: TileflowBackgroundStyle;
380
380
  enabled?: boolean;
@@ -479,6 +479,8 @@ type TileflowLanduseColorConfig = {
479
479
  civic?: TileflowColor;
480
480
  commercial?: TileflowColor;
481
481
  industrial?: TileflowColor;
482
+ military?: TileflowColor;
483
+ recreation?: TileflowColor;
482
484
  residential?: TileflowColor;
483
485
  };
484
486
  type TileflowLandcoverColorConfig = {
@@ -486,7 +488,9 @@ type TileflowLandcoverColorConfig = {
486
488
  ice?: TileflowColor;
487
489
  park?: TileflowColor;
488
490
  protected?: TileflowColor;
491
+ rock?: TileflowColor;
489
492
  sand?: TileflowColor;
493
+ wetland?: TileflowColor;
490
494
  wood?: TileflowColor;
491
495
  };
492
496
  type TileflowHydroColorConfig = {
@@ -759,6 +763,8 @@ type OpenMapTilesLayerBindings = {
759
763
  aeroway: string;
760
764
  boundary: string;
761
765
  building: string;
766
+ /** Optional low-zoom global land-cover extension. Defaults to `globallandcover`. */
767
+ globalLandcover?: string;
762
768
  landcover: string;
763
769
  landuse: string;
764
770
  park: string;
@@ -834,7 +840,8 @@ type TileflowDataIdentity = {
834
840
  sourceId: typeof tileflowPrimarySourceId;
835
841
  };
836
842
  type ResolvedTileflowData = {
837
- attribution: string;
843
+ /** Omitted when the versioned TileJSON is the authoritative attribution source. */
844
+ attribution?: string;
838
845
  identity: TileflowDataIdentity;
839
846
  kind: TileflowDataConfig['type'];
840
847
  revision?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/core",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.20",
4
4
  "description": "Typed Tileflow config and MapLibre style compiler.",
5
5
  "type": "module",
6
6
  "sideEffects": false,