@tangram.gl/basemap-layers 0.0.1 → 10.0.0-alpha.3

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.
Files changed (139) hide show
  1. package/README.md +12 -7
  2. package/THIRD-PARTY-NOTICES.md +7 -5
  3. package/dist/geojson-task-worker.js +3166 -0
  4. package/dist/geojson-task-worker.js.map +6 -0
  5. package/dist/geojson-worker.js +1089 -7
  6. package/dist/geojson-worker.js.map +3 -3
  7. package/dist/index.cjs +9588 -2093
  8. package/dist/index.cjs.map +3 -3
  9. package/dist/index.js +9599 -2090
  10. package/dist/index.js.map +3 -3
  11. package/dist/map-style.cjs +456 -20
  12. package/dist/map-style.cjs.map +3 -3
  13. package/dist/map-style.js +456 -19
  14. package/dist/map-style.js.map +2 -2
  15. package/dist/types/basemap-error.d.ts +52 -0
  16. package/dist/types/basemap-layer.d.ts +378 -25
  17. package/dist/types/basemap-protocol.d.ts +91 -0
  18. package/dist/types/basemap-request.d.ts +73 -0
  19. package/dist/types/circle-layer.d.ts +65 -8
  20. package/dist/types/color-relief-layer.d.ts +184 -0
  21. package/dist/types/dem-pixels.d.ts +40 -0
  22. package/dist/types/feature-state.d.ts +55 -0
  23. package/dist/types/fill-extrusion-lighting-extension.d.ts +1 -2
  24. package/dist/types/fill-outline-extension.d.ts +2 -3
  25. package/dist/types/fill-pattern.d.ts +35 -3
  26. package/dist/types/fill-style-extensions.d.ts +11 -59
  27. package/dist/types/geojson-resource.d.ts +18 -0
  28. package/dist/types/geojson-source.d.ts +13 -2
  29. package/dist/types/geojson-task-handler.d.ts +2 -0
  30. package/dist/types/geojson-task.d.ts +26 -0
  31. package/dist/types/geojson-tiler.d.ts +29 -2
  32. package/dist/types/geojson-worker.d.ts +5 -1
  33. package/dist/types/globe-horizon-extension.d.ts +2 -45
  34. package/dist/types/globe-layers.d.ts +141 -45
  35. package/dist/types/globe-line-angle-extension.d.ts +20 -17
  36. package/dist/types/glyph-store.d.ts +10 -1
  37. package/dist/types/heatmap-layer.d.ts +99 -0
  38. package/dist/types/hillshade-layer.d.ts +159 -27
  39. package/dist/types/icon-text-fit.d.ts +92 -0
  40. package/dist/types/image-source-layer.d.ts +142 -0
  41. package/dist/types/index.d.ts +25 -1
  42. package/dist/types/line-blur-extension.d.ts +3 -11
  43. package/dist/types/line-dash-extension.d.ts +53 -0
  44. package/dist/types/line-gradient-extension.d.ts +69 -0
  45. package/dist/types/line-metrics.d.ts +24 -0
  46. package/dist/types/line-pattern-extension.d.ts +50 -0
  47. package/dist/types/line-shape-extension.d.ts +76 -0
  48. package/dist/types/map-style-loader.d.ts +1 -1
  49. package/dist/types/map-style.d.ts +2 -2
  50. package/dist/types/mvt-label-layer.d.ts +111 -20
  51. package/dist/types/pmtiles-source.d.ts +38 -0
  52. package/dist/types/projected-background-layer.d.ts +63 -0
  53. package/dist/types/projected-bitmap-layer.d.ts +58 -0
  54. package/dist/types/projected-tile-data.d.ts +16 -0
  55. package/dist/types/projected-tile-selection.d.ts +72 -0
  56. package/dist/types/projected-tileset.d.ts +92 -0
  57. package/dist/types/projected-viewport.d.ts +76 -0
  58. package/dist/types/raster-color-extension.d.ts +4 -7
  59. package/dist/types/raster-fade.d.ts +155 -0
  60. package/dist/types/raster-tile-fingerprint.d.ts +11 -0
  61. package/dist/types/raster-tile-loader.d.ts +80 -0
  62. package/dist/types/shader-injection-plugin.d.ts +8 -0
  63. package/dist/types/source-features.d.ts +58 -0
  64. package/dist/types/source-tiles.d.ts +32 -0
  65. package/dist/types/sprite.d.ts +37 -3
  66. package/dist/types/stretch-icon-layer.d.ts +28 -0
  67. package/dist/types/style-accessor.d.ts +50 -12
  68. package/dist/types/style-expression.d.ts +22 -2
  69. package/dist/types/style-resolver.d.ts +47 -2
  70. package/dist/types/terrain-query.d.ts +39 -0
  71. package/dist/types/zoom-load-gate.d.ts +22 -0
  72. package/dist/types/zoom-paint-extension.d.ts +80 -11
  73. package/package.json +24 -21
  74. package/src/basemap-error.ts +82 -0
  75. package/src/basemap-layer.ts +1289 -101
  76. package/src/basemap-protocol.ts +353 -0
  77. package/src/basemap-request.ts +212 -0
  78. package/src/circle-layer.ts +430 -54
  79. package/src/color-relief-layer.ts +572 -0
  80. package/src/dem-pixels.ts +174 -0
  81. package/src/feature-state.ts +164 -0
  82. package/src/fill-extrusion-lighting-extension.ts +126 -9
  83. package/src/fill-outline-extension.ts +4 -4
  84. package/src/fill-pattern.ts +87 -9
  85. package/src/fill-style-extensions.ts +114 -44
  86. package/src/geojson-resource.ts +58 -0
  87. package/src/geojson-source.ts +106 -85
  88. package/src/geojson-task-handler.ts +11 -0
  89. package/src/geojson-task-worker.ts +8 -0
  90. package/src/geojson-task.ts +34 -0
  91. package/src/geojson-tiler.ts +270 -4
  92. package/src/geojson-worker.ts +36 -6
  93. package/src/globe-horizon-extension.ts +14 -4
  94. package/src/globe-layers.ts +1905 -406
  95. package/src/globe-line-angle-extension.ts +183 -23
  96. package/src/glyph-store.ts +28 -6
  97. package/src/heatmap-layer.ts +591 -0
  98. package/src/hillshade-layer.ts +309 -88
  99. package/src/icon-text-fit.ts +358 -0
  100. package/src/image-source-layer.ts +380 -0
  101. package/src/index.ts +58 -1
  102. package/src/line-blur-extension.ts +14 -12
  103. package/src/line-dash-extension.ts +303 -0
  104. package/src/line-gradient-extension.ts +191 -0
  105. package/src/line-metrics.ts +90 -0
  106. package/src/line-pattern-extension.ts +173 -0
  107. package/src/line-shape-extension.ts +272 -0
  108. package/src/map-style-loader.ts +5 -4
  109. package/src/map-style.ts +2 -1
  110. package/src/mvt-label-layer.ts +568 -144
  111. package/src/pmtiles-source.ts +276 -0
  112. package/src/projected-background-layer.ts +202 -0
  113. package/src/projected-bitmap-layer.ts +262 -0
  114. package/src/projected-tile-data.ts +132 -0
  115. package/src/projected-tile-selection.ts +605 -0
  116. package/src/projected-tileset.ts +183 -0
  117. package/src/projected-viewport.ts +254 -0
  118. package/src/raster-color-extension.ts +43 -18
  119. package/src/raster-fade.ts +319 -0
  120. package/src/raster-tile-fingerprint.ts +31 -0
  121. package/src/raster-tile-loader.ts +211 -0
  122. package/src/shader-injection-plugin.ts +25 -0
  123. package/src/source-features.ts +170 -0
  124. package/src/source-tiles.ts +102 -0
  125. package/src/sprite.ts +122 -15
  126. package/src/stretch-icon-layer.ts +87 -0
  127. package/src/style-accessor.ts +105 -17
  128. package/src/style-expression.ts +80 -3
  129. package/src/style-resolver.ts +200 -22
  130. package/src/terrain-query.ts +86 -0
  131. package/src/text-layout.ts +2 -3
  132. package/src/zoom-load-gate.ts +57 -0
  133. package/src/zoom-paint-extension.ts +245 -47
  134. package/dist/types/arabic-shaping.d.ts +0 -7
  135. package/dist/types/bidi.d.ts +0 -8
  136. package/dist/types/polylabel.d.ts +0 -17
  137. package/src/arabic-shaping.ts +0 -366
  138. package/src/bidi.ts +0 -199
  139. package/src/polylabel.ts +0 -312
@@ -1,9 +1,13 @@
1
1
  import { LayerExtension } from '@deck.gl/core';
2
- import type { CompositeLayer, Layer } from '@deck.gl/core';
2
+ import type { Layer } from '@deck.gl/core';
3
3
  import { FillStyleExtension } from '@deck.gl/extensions';
4
+ import type { ShaderModule, ShaderPlugin } from '@luma.gl/shaders';
5
+ /** The WGSL uniform and common-space offset shared by fill and circle translation. */
6
+ export declare const fillTranslateModuleWGSL: ShaderModule;
4
7
  /** The anchor of `fill-translate`. */
5
8
  export type FillTranslateAnchor = 'map' | 'viewport';
6
- type FillTranslateExtensionProps = {
9
+ /** The props of `FillTranslateExtension`. */
10
+ export type FillTranslateExtensionProps = {
7
11
  /** `fill-translate`: the offset in pixels, x right and y down. */
8
12
  fillTranslate?: [number, number];
9
13
  /** `fill-translate-anchor`: `'map'` turns the offset with the map, `'viewport'` keeps it on screen. */
@@ -17,7 +21,7 @@ type FillTranslateExtensionProps = {
17
21
  export declare function getFillTranslateOffset(translate: readonly [number, number], anchor: FillTranslateAnchor, bearing: number): [number, number];
18
22
  /**
19
23
  * Offsets a fill and its outline by `fill-translate` pixels, anchored to the map or to the
20
- * viewport by `fill-translate-anchor`. WebGL only; on WebGPU fills draw untranslated.
24
+ * viewport by `fill-translate-anchor`, on WebGL and WebGPU.
21
25
  *
22
26
  * Added to a `GeoJsonLayer`, it reaches the polygon fill and outline sublayers.
23
27
  */
@@ -32,69 +36,17 @@ export declare class FillTranslateExtension extends LayerExtension {
32
36
  fillTranslateAnchor: string;
33
37
  };
34
38
  getShaders(this: Layer): {
35
- modules?: undefined;
36
- } | {
37
- modules: {
38
- readonly name: "fillTranslate";
39
- readonly dependencies: readonly [{
40
- readonly name: "project";
41
- readonly dependencies: [{
42
- name: string;
43
- source: string;
44
- vs: string;
45
- }, {
46
- readonly name: "geometry";
47
- readonly source: "const SMOOTH_EDGE_RADIUS: f32 = 0.5;\n\nstruct VertexGeometry {\n position: vec4<f32>,\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry_: VertexGeometry = VertexGeometry(\n vec4<f32>(0.0, 0.0, 1.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec2<f32>(0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0)\n);\n\nstruct FragmentGeometry {\n uv: vec2<f32>,\n};\n\nvar<private> fragmentGeometry: FragmentGeometry;\n\nfn smoothedge(edge: f32, x: f32) -> f32 {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n";
48
- readonly vs: "#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n";
49
- readonly fs: "#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n};\nFragmentGeometry geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n";
50
- }];
51
- readonly source: string;
52
- readonly vs: string;
53
- readonly getUniforms: (opts?: import("@deck.gl/core").ProjectProps | {}) => {};
54
- readonly uniformTypes: {
55
- readonly wrapLongitude: "f32";
56
- readonly coordinateSystem: "i32";
57
- readonly commonUnitsPerMeter: "vec3<f32>";
58
- readonly projectionMode: "i32";
59
- readonly scale: "f32";
60
- readonly commonUnitsPerWorldUnit: "vec3<f32>";
61
- readonly commonUnitsPerWorldUnit2: "vec3<f32>";
62
- readonly center: "vec4<f32>";
63
- readonly modelMatrix: "mat4x4<f32>";
64
- readonly viewProjectionMatrix: "mat4x4<f32>";
65
- readonly viewportSize: "vec2<f32>";
66
- readonly devicePixelRatio: "f32";
67
- readonly focalDistance: "f32";
68
- readonly cameraPosition: "vec3<f32>";
69
- readonly coordinateOrigin: "vec3<f32>";
70
- readonly commonOrigin: "vec3<f32>";
71
- readonly pseudoMeters: "f32";
72
- };
73
- }];
74
- readonly vs: "layout(std140) uniform fillTranslateUniforms {\n vec2 offset;\n} fillTranslate;\n";
75
- readonly uniformTypes: {
76
- readonly offset: "vec2<f32>";
77
- };
78
- readonly inject: {
79
- readonly 'vs:DECKGL_FILTER_GL_POSITION': {
80
- readonly order: -1;
81
- readonly injection: "\n if (fillTranslate.offset != vec2(0.0)) {\n vec2 fillTranslate_pixels = vec2(fillTranslate.offset.x, -fillTranslate.offset.y);\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n // The globe is centred at the origin with its axis along z.\n vec3 fillTranslate_up = normalize(geometry.position.xyz);\n vec3 fillTranslate_east = vec3(-fillTranslate_up.y, fillTranslate_up.x, 0.0);\n fillTranslate_east = length(fillTranslate_east) > 0.0\n ? normalize(fillTranslate_east)\n : vec3(1.0, 0.0, 0.0);\n vec3 fillTranslate_north = cross(fillTranslate_up, fillTranslate_east);\n geometry.position.xyz +=\n (fillTranslate_east * fillTranslate_pixels.x + fillTranslate_north * fillTranslate_pixels.y) /\n project.scale;\n } else {\n geometry.position.xy += fillTranslate_pixels / project.scale;\n }\n position = project_common_position_to_clipspace(geometry.position);\n }\n";
82
- };
83
- };
84
- }[];
39
+ plugins: ShaderPlugin[];
85
40
  };
86
41
  draw(this: Layer<FillTranslateExtensionProps>): void;
87
42
  }
88
43
  /**
89
- * `FillStyleExtension` with image patterns, run only where its GLSL shader runs. On WebGPU it adds
90
- * no shader code, and the fills it is added to draw nothing, as before patterns were supported:
91
- * their fill color is only the pattern's opacity.
44
+ * `FillStyleExtension` with image patterns, on WebGL and WebGPU. On a globe, the pattern is placed
45
+ * by the vertex's Web Mercator position: by `globePatternModule` on WebGL, and by deck.gl's own
46
+ * WGSL on WebGPU.
92
47
  */
93
48
  export declare class FillPatternExtension extends FillStyleExtension {
94
49
  static extensionName: string;
95
50
  constructor();
96
51
  getShaders(this: Layer, extension: this): any;
97
- isEnabled(layer: Layer): boolean;
98
- getSubLayerProps(this: CompositeLayer, extension: this): any;
99
52
  }
100
- export {};
@@ -0,0 +1,18 @@
1
+ import type { GeoJSONVT } from '@maplibre/geojson-vt';
2
+ import type { GeoJsonWorkerRequest } from "./geojson-worker.js";
3
+ import { cutTile } from "./geojson-tiler.js";
4
+ /** Worker-owned source indexes and not-yet-indexed feature batches. */
5
+ export type GeoJsonResourceState = {
6
+ /** Feature batches received before indexing. */
7
+ pendingFeatures: Map<number, unknown[]>;
8
+ /** Successfully constructed indexes or their construction errors. */
9
+ indexes: Map<number, GeoJSONVT | Error>;
10
+ };
11
+ /** Create the state held exclusively by one GeoJSON resource worker. */
12
+ export declare function createGeoJsonResourceState(): GeoJsonResourceState;
13
+ /**
14
+ * Apply an ordered source operation. A tile request returns its tile, and an index request the
15
+ * number of features dropped or cut at the edges of the Web Mercator world (see
16
+ * `clipFeaturesToMercatorRange`).
17
+ */
18
+ export declare function runGeoJsonResource(state: GeoJsonResourceState, message: GeoJsonWorkerRequest): ReturnType<typeof cutTile> | number | null;
@@ -7,9 +7,20 @@ export declare function getGeoJsonMaxZoom(source: BasemapSource): number;
7
7
  /**
8
8
  * geojson-vt options for a GeoJSON source, as MapLibre GL JS 6 sets them: `buffer` and
9
9
  * `tolerance` are given in pixels of a 512 pixel tile, and the source's `maxzoom` is the deepest
10
- * zoom tiled. Clustering is supported without `clusterProperties`.
10
+ * zoom tiled. Clustering is supported without `clusterProperties`. `lineMetrics` adds each tiled
11
+ * line's part of its whole line to its properties, as in MapLibre.
11
12
  */
12
13
  export declare function getGeoJsonVtOptions(source: BasemapSource): GeoJSONVTOptions;
14
+ /** How a GeoJSON source's tiles are cut, for the view they are drawn in. */
15
+ export type GeoJsonTileOptions = {
16
+ /**
17
+ * Whether what lies past the edges of the Web Mercator world, at +-85.0511 degrees, is dropped
18
+ * and cut, and not clamped onto them as geojson-vt and MapLibre GL JS do (see
19
+ * `clipFeaturesToMercatorRange`): for views that show latitudes past them, projected views and
20
+ * globes. A Web Mercator view does not show them.
21
+ */
22
+ clipToMercatorRange?: boolean;
23
+ };
13
24
  /**
14
25
  * Whether tiles requested from now on are cut in a worker, where one can start (`true`, the
15
26
  * default), or on the main thread. For tests.
@@ -26,4 +37,4 @@ export declare function getGeoJsonTileFeatures(source: BasemapSource, index: {
26
37
  x: number;
27
38
  y: number;
28
39
  z: number;
29
- }): Promise<Record<string, unknown>[]>;
40
+ }, { clipToMercatorRange }?: GeoJsonTileOptions): Promise<Record<string, unknown>[]>;
@@ -0,0 +1,2 @@
1
+ /** Install the stateful GeoJSON resource task handler on a worker global. */
2
+ export declare function installGeoJsonTaskHandler(): Promise<void>;
@@ -0,0 +1,26 @@
1
+ import { type GeoJsonResourceState } from "./geojson-resource.js";
2
+ import type { GeoJsonWorkerRequest } from "./geojson-worker.js";
3
+ import type { cutTile } from "./geojson-tiler.js";
4
+ /**
5
+ * A source error is distinct from a failure of the worker transport. An index request reports how
6
+ * many features it dropped or cut at the edges of the Web Mercator world in `outside`.
7
+ */
8
+ export type GeoJsonTaskResult = {
9
+ tile: ReturnType<typeof cutTile> | null;
10
+ outside?: number;
11
+ } | {
12
+ error: string;
13
+ };
14
+ /** Stateful GeoJSON tiling resource; one worker owns all source indexes. */
15
+ export declare const GeoJsonTask: {
16
+ id: string;
17
+ worker: {
18
+ create: () => Worker;
19
+ capabilities: {
20
+ atomic: true;
21
+ streaming: false;
22
+ };
23
+ };
24
+ initialize: (_input: object) => GeoJsonResourceState;
25
+ process: (input: GeoJsonWorkerRequest, _options: object, { state }: import("@math.gl/tasks").TaskContext<GeoJsonResourceState>) => GeoJsonTaskResult;
26
+ };
@@ -33,8 +33,35 @@ export type EncodedTile = {
33
33
  positions: Int32Array;
34
34
  lengths: Uint32Array;
35
35
  };
36
- /** Builds the tile index of a GeoJSON source's data. Throws if the data is not valid GeoJSON. */
37
- export declare function createTileIndex(data: unknown, options: GeoJSONVTOptions): GeoJSONVT;
36
+ /**
37
+ * Builds the tile index of a GeoJSON source's data, and counts the features that
38
+ * `clipToMercatorRange` dropped or cut (see `clipToMercatorRange`). Throws if the data is not
39
+ * valid GeoJSON.
40
+ */
41
+ export declare function createTileIndex(data: unknown, options: GeoJSONVTOptions, clipToMercatorRange?: boolean): {
42
+ index: GeoJSONVT;
43
+ outside: number;
44
+ };
45
+ /**
46
+ * GeoJSON data without what lies past the edges of the Web Mercator world, at +-85.0511 degrees,
47
+ * and how many features it dropped or cut. geojson-vt clamps latitudes past them onto them: a
48
+ * point at -89.5 degrees is drawn at -85.0511 degrees, which only a Web Mercator view cannot show
49
+ * apart. Here points past them are dropped, and lines and polygons end where they cross them, as
50
+ * straight lines in Web Mercator, as geojson-vt draws them. Features all inside are kept as they
51
+ * are, and data all inside is returned as it is.
52
+ *
53
+ * With `generateId`, each feature of cut data carries the id that geojson-vt gives it in the data
54
+ * as it was, its index: index the cut data without `generateId`. With `lineMetrics`, each part of a
55
+ * cut line is a feature of its own that carries where it lies along the whole line, so that its
56
+ * `line-progress` goes on along the line (see `cutTile`).
57
+ */
58
+ export declare function clipFeaturesToMercatorRange(data: unknown, { generateId, lineMetrics }?: {
59
+ generateId?: boolean;
60
+ lineMetrics?: boolean;
61
+ }): {
62
+ data: unknown;
63
+ outside: number;
64
+ };
38
65
  /**
39
66
  * Cuts one tile from a tile index, as MapLibre GL JS cuts it, and encodes its features. Its typed
40
67
  * arrays' buffers can be transferred.
@@ -13,12 +13,16 @@ export type GeoJsonWorkerRequest =
13
13
  source: number;
14
14
  features: unknown[];
15
15
  }
16
- /** Builds a source's index from `data`, or from the features sent before it. */
16
+ /**
17
+ * Builds a source's index from `data`, or from the features sent before it, without what lies
18
+ * past the edges of the Web Mercator world with `clipToMercatorRange` (see `createTileIndex`).
19
+ */
17
20
  | {
18
21
  type: 'index';
19
22
  source: number;
20
23
  data?: unknown;
21
24
  options: GeoJSONVTOptions;
25
+ clipToMercatorRange?: boolean;
22
26
  } | {
23
27
  type: 'tile';
24
28
  source: number;
@@ -11,51 +11,8 @@ import type { Layer } from '@deck.gl/core';
11
11
  export declare class GlobeHorizonExtension extends LayerExtension {
12
12
  static extensionName: string;
13
13
  getShaders(this: Layer): {
14
- modules?: undefined;
14
+ plugins?: undefined;
15
15
  } | {
16
- modules: {
17
- readonly name: "globeHorizon";
18
- readonly dependencies: readonly [{
19
- readonly name: "project";
20
- readonly dependencies: [{
21
- name: string;
22
- source: string;
23
- vs: string;
24
- }, {
25
- readonly name: "geometry";
26
- readonly source: "const SMOOTH_EDGE_RADIUS: f32 = 0.5;\n\nstruct VertexGeometry {\n position: vec4<f32>,\n worldPosition: vec3<f32>,\n worldPositionAlt: vec3<f32>,\n normal: vec3<f32>,\n uv: vec2<f32>,\n pickingColor: vec3<f32>,\n};\n\nvar<private> geometry_: VertexGeometry = VertexGeometry(\n vec4<f32>(0.0, 0.0, 1.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0),\n vec2<f32>(0.0, 0.0),\n vec3<f32>(0.0, 0.0, 0.0)\n);\n\nstruct FragmentGeometry {\n uv: vec2<f32>,\n};\n\nvar<private> fragmentGeometry: FragmentGeometry;\n\nfn smoothedge(edge: f32, x: f32) -> f32 {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n";
27
- readonly vs: "#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n";
28
- readonly fs: "#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n};\nFragmentGeometry geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n";
29
- }];
30
- readonly source: string;
31
- readonly vs: string;
32
- readonly getUniforms: (opts?: import("@deck.gl/core").ProjectProps | {}) => {};
33
- readonly uniformTypes: {
34
- readonly wrapLongitude: "f32";
35
- readonly coordinateSystem: "i32";
36
- readonly commonUnitsPerMeter: "vec3<f32>";
37
- readonly projectionMode: "i32";
38
- readonly scale: "f32";
39
- readonly commonUnitsPerWorldUnit: "vec3<f32>";
40
- readonly commonUnitsPerWorldUnit2: "vec3<f32>";
41
- readonly center: "vec4<f32>";
42
- readonly modelMatrix: "mat4x4<f32>";
43
- readonly viewProjectionMatrix: "mat4x4<f32>";
44
- readonly viewportSize: "vec2<f32>";
45
- readonly devicePixelRatio: "f32";
46
- readonly focalDistance: "f32";
47
- readonly cameraPosition: "vec3<f32>";
48
- readonly coordinateOrigin: "vec3<f32>";
49
- readonly commonOrigin: "vec3<f32>";
50
- readonly pseudoMeters: "f32";
51
- };
52
- }];
53
- readonly inject: {
54
- readonly 'vs:DECKGL_FILTER_GL_POSITION': {
55
- readonly order: 1;
56
- readonly injection: "\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n vec3 globeHorizon_normal = normalize(project_position(geometry.worldPosition));\n mat4 globeHorizon_m = project.viewProjectionMatrix;\n vec3 globeHorizon_wRow = vec3(globeHorizon_m[0][3], globeHorizon_m[1][3], globeHorizon_m[2][3]);\n bool globeHorizon_hidden = dot(globeHorizon_wRow, globeHorizon_wRow) == 0.0\n ? dot(globeHorizon_normal, vec3(globeHorizon_m[0][2], globeHorizon_m[1][2], globeHorizon_m[2][2])) > 0.0\n : dot(globeHorizon_normal, project.cameraPosition) < GLOBE_RADIUS;\n if (globeHorizon_hidden) {\n // Every vertex of the quad lands beyond the far plane, so it is clipped. In the collision\n // pass this keeps a hidden label out of the collision map.\n position = vec4(0.0, 0.0, 2.0, 1.0);\n }\n }\n";
57
- };
58
- };
59
- }[];
16
+ plugins: import("@luma.gl/shaders").ShaderPlugin[];
60
17
  };
61
18
  }
@@ -1,14 +1,21 @@
1
1
  import type { GlyphStore } from "./glyph-store.js";
2
- import { SharedMVTLayer, SharedTileset2D } from '@deck.gl-community/geo-layers';
2
+ import { SharedMVTLayer, SharedTileset2D } from '@deck.gl-community/layers/geo-layers';
3
+ import { type LayerExtension, type LayerProps, type LayersList } from '@deck.gl/core';
4
+ import { type BasemapFeatureState } from "./feature-state.js";
5
+ import { type GeoJsonTileOptions } from "./geojson-source.js";
3
6
  import { type DemTile } from "./hillshade-layer.js";
4
7
  import type { LabelPlacement } from "./label-placement.js";
5
8
  import { type StyleAccessor } from "./style-accessor.js";
6
9
  import { ZoomPaint, type ZoomPaintValues } from "./zoom-paint-extension.js";
7
- import type { BasemapGlobeConfig, BasemapLayerProps } from "./basemap-layer.js";
10
+ import type { BasemapGlobeConfig, BasemapInsertion } from "./basemap-layer.js";
11
+ import { type RejectRasterTile } from "./raster-tile-loader.js";
12
+ import { type BasemapLoadErrorHandler } from "./basemap-error.js";
13
+ import { type BasemapTransformRequest } from "./basemap-request.js";
8
14
  import type { SpriteAtlas } from "./sprite.js";
9
15
  import type { LabelFontFamily } from "./text-font.js";
10
16
  import type { BasemapLoadOptions, BasemapSource, ResolvedBasemapStyleLayer as BasemapStyleLayer, ResolvedBasemapStyle } from "./style-resolver.js";
11
- type BasemapMode = NonNullable<BasemapLayerProps['mode']>;
17
+ /** The mode the sublayers draw in; `BasemapLayer` resolves its `'auto'` mode to one of these. */
18
+ type BasemapMode = 'map' | 'globe';
12
19
  type BasemapLayerConfig = {
13
20
  atmosphere: boolean;
14
21
  basemap: boolean;
@@ -21,8 +28,17 @@ type BasemapLayerGroup = {
21
28
  config?: BasemapGlobeConfig;
22
29
  };
23
30
  styleDefinition: ResolvedBasemapStyle;
31
+ /** Builds the style at this zoom, also used for WebGL paint outside its viewport zoom step. */
24
32
  zoom?: number;
25
33
  loadOptions?: BasemapLoadOptions;
34
+ /** Loads the tiles of raster sources (see deck.gl's `fetch` layer prop). */
35
+ fetch?: LayerProps['fetch'];
36
+ /** Changes each tile request before it is sent (see `BasemapLayerProps.transformRequest`). */
37
+ transformRequest?: BasemapTransformRequest | null;
38
+ /** Matches the raster tiles that have no data (see `BasemapLayerProps.rejectRasterTile`). */
39
+ rejectRasterTile?: RejectRasterTile | null;
40
+ /** Receives the tiles that fail to load, in place of the log (see `BasemapLoadError`). */
41
+ onError?: BasemapLoadErrorHandler | null;
26
42
  /**
27
43
  * Sprites loaded for the style; symbol layers draw `icon-image` from them. `null` means the
28
44
  * sprites are still loading: no icons are drawn, and labels are placed as if each symbol had its
@@ -35,15 +51,59 @@ type BasemapLayerGroup = {
35
51
  glyphs?: GlyphStore | null;
36
52
  /** The label placement shared by the map's label layers (see `LabelPlacement`). */
37
53
  labelPlacement?: LabelPlacement | null;
54
+ /** The states that `["feature-state", ...]` reads (see `BasemapLayerProps.featureState`). */
55
+ featureState?: BasemapFeatureState | null;
56
+ /** Makes the features of vector and GeoJSON sources pickable (see `BasemapPickedFeature`). */
57
+ pickable?: LayerProps['pickable'];
38
58
  /** Externally owned source caches; BasemapLayer supplies and finalizes these. */
39
59
  tilesets?: Map<BasemapSource, SharedTileset2D>;
60
+ /**
61
+ * Whether the layers are drawn in a projected view (deck.gl's `_CustomProjectionView`), where a
62
+ * `background` layer fills the screen around the view (see `ProjectedBackgroundLayer`).
63
+ */
64
+ projected?: boolean;
65
+ /** Draw an ordinary background locally for a geographic first-person camera. */
66
+ firstPerson?: boolean;
67
+ /**
68
+ * The stretch limit of the tile selection in a projected view (see
69
+ * `ProjectedTileSelectionOptions.maxStretch`). It applies to the tilesets these layers create.
70
+ */
71
+ projectedMaxStretch?: number;
72
+ /**
73
+ * Extra deck.gl props for the sublayers of some style layers, by style layer (see
74
+ * `BasemapLayerProps.getStyleLayerProps` and `getStyleLayerPropsMap`). Compared by identity:
75
+ * the tiles regenerate when it changes.
76
+ */
77
+ styleLayerProps?: StyleLayerPropsMap | null;
78
+ /**
79
+ * deck.gl layers drawn inside the style order (see `BasemapLayerProps.insertLayers`). An
80
+ * insertion whose `beforeId` names no layer of the style throws an error.
81
+ */
82
+ insertLayers?: BasemapInsertion[] | null;
83
+ };
84
+ /**
85
+ * Extra deck.gl props for the sublayers that draw one style layer. `extensions` are added after
86
+ * the sublayer's own, and `updateTriggers` are merged with the sublayer's own. `id` and `data`
87
+ * are ignored.
88
+ */
89
+ export type StyleLayerSubLayerProps = Partial<LayerProps> & {
90
+ extensions?: LayerExtension[];
91
+ updateTriggers?: Record<string, unknown>;
92
+ [key: string]: unknown;
40
93
  };
94
+ /** Extra sublayer props by style layer; style layers without extra props have no entry. */
95
+ export type StyleLayerPropsMap = ReadonlyMap<BasemapStyleLayer, StyleLayerSubLayerProps>;
41
96
  /**
42
- * Style layers that draw together, in style order: a background, raster or hillshade layer on its
43
- * own, or consecutive style layers of one vector source, which share one tile layer.
97
+ * The extra sublayer props of each style layer of `styleDefinition`, from `getProps`, or null when
98
+ * no style layer has any.
99
+ */
100
+ export declare function getStyleLayerPropsMap(styleDefinition: ResolvedBasemapStyle, getProps: ((styleLayer: BasemapStyleLayer) => StyleLayerSubLayerProps | null | undefined) | null): StyleLayerPropsMap | null;
101
+ /**
102
+ * Style layers that draw together, in style order: a background, raster, hillshade or color-relief
103
+ * layer on its own, or consecutive style layers of one vector source, which share one tile layer.
44
104
  */
45
105
  export type StyleLayerRun = {
46
- type: 'background' | 'raster' | 'hillshade' | 'vector';
106
+ type: 'background' | 'raster' | 'hillshade' | 'color-relief' | 'vector';
47
107
  /** The deck.gl layer id, without the basemap's id prefix. */
48
108
  id: string;
49
109
  sourceId?: string;
@@ -55,17 +115,16 @@ export declare function getStyleZoomLimits(styleLayers: BasemapStyleLayer[]): (n
55
115
  /**
56
116
  * Evaluates the paint of style layers drawn by one sublayer for `ZoomPaintExtension`: a style
57
117
  * layer's width, or 1 where it is per feature, and its colors in 0-1, or an alpha of -1 where they
58
- * are per feature.
118
+ * are per feature. Layer-wide paint is evaluated at the supplied zoom, which also determines
119
+ * the blend factors for composite paint between the two enclosing style zoom steps.
59
120
  */
60
121
  export declare function getZoomPaintValues(styleLayers: BasemapStyleLayer[], mode: BasemapMode, zoom: number): ZoomPaintValues;
61
122
  /**
62
- * The paint of one tile layer's fill and line sublayers for `ZoomPaintExtension`: the zoom its
63
- * sublayers were generated at, and a `ZoomPaint` per sequence of style layers drawn by one
64
- * sublayer, shared by all tiles. Kept in the tile layer's state.
123
+ * The paint of one tile layer's fill and line sublayers for `ZoomPaintExtension`: a `ZoomPaint`
124
+ * per sequence of style layers drawn by one sublayer, shared by all tiles. Kept in the tile
125
+ * layer's state.
65
126
  */
66
127
  export declare class ZoomPaintContext {
67
- /** The stepped zoom (see `getZoomBucket`) at which paint is evaluated. */
68
- zoom: number;
69
128
  private zoomPaints;
70
129
  /** The style the zoom paints were made for (see `setStyle`). */
71
130
  private style;
@@ -78,8 +137,9 @@ export declare class ZoomPaintContext {
78
137
  */
79
138
  setStyle(style: unknown): void;
80
139
  /**
81
- * The `ZoomPaint` of style layers drawn by one sublayer. Its values are evaluated once per zoom
82
- * step, and again when a paint property is replaced.
140
+ * The `ZoomPaint` of style layers drawn by one sublayer. Its zoom-dependent values are evaluated
141
+ * at the viewport zoom, with blend factors relative to the sublayer's attribute zoom. Values
142
+ * are shared across draws at the same zooms and evaluated again when a paint property is replaced.
83
143
  */
84
144
  get(styleLayers: BasemapStyleLayer[], mode: BasemapMode): ZoomPaint;
85
145
  /** Releases the textures of every `ZoomPaint`. */
@@ -104,13 +164,18 @@ export declare function getTilePyramidProps(source: BasemapSource): {
104
164
  maxZoom: number;
105
165
  extent: number[] | null;
106
166
  };
167
+ /**
168
+ * `loadOptions` with `transformRequest`, for the loaders that fetch with the basemap load options
169
+ * themselves: raster-dem tiles, and raster tiles with `rejectRasterTile`.
170
+ */
171
+ export declare function withTransformRequest(loadOptions: BasemapLoadOptions | undefined, transformRequest: BasemapTransformRequest | null | undefined): BasemapLoadOptions | undefined;
107
172
  /**
108
173
  * Creates the tileset of a `raster-dem` source: each tile is fetched and decoded once, and shared by
109
- * every `hillshade` layer drawn from it. `BasemapLayer` creates and finalizes these itself. Direct
174
+ * every `hillshade` and `color-relief` layer drawn from it. `BasemapLayer` creates and finalizes these itself. Direct
110
175
  * `getBasemapLayers` callers that call it on every render pass them in `tilesets`, keyed by source,
111
176
  * to keep the tiles across calls, and finalize them when done.
112
177
  */
113
- export declare function createDemTileset(source: BasemapSource, loadOptions?: BasemapLoadOptions): SharedTileset2D<DemTile | null>;
178
+ export declare function createDemTileset(source: BasemapSource, loadOptions?: BasemapLoadOptions, projectedMaxStretch?: number): SharedTileset2D<DemTile | null>;
114
179
  /**
115
180
  * Orders the sublayers of all tiles of a tile layer by style layer, as MapLibre draws each style
116
181
  * layer across all tiles before the next: a tile's fills cannot paint over the labels of the tile
@@ -127,19 +192,40 @@ export declare function sortTileSubLayers<LayerT extends {
127
192
  export declare function isSameProps(a: Record<string, any>, b: Record<string, any>, depth?: number, accessors?: boolean): boolean;
128
193
  /** All style-layer `minzoom`/`maxzoom` limits in a style. */
129
194
  export declare function getStyleDefinitionZoomLimits(styleDefinition: BasemapLayerGroup['styleDefinition']): (number | undefined)[];
130
- export declare function getBasemapLayers({ idPrefix, mode, globe, styleDefinition, zoom, loadOptions, spriteAtlases, fontFamily, glyphs, labelPlacement, tilesets }: BasemapLayerGroup): any[];
131
- export declare function getGlobeBaseLayers({ globe, styleDefinition, idPrefix, zoom, loadOptions, spriteAtlases, fontFamily, glyphs, labelPlacement }: Omit<BasemapLayerGroup, 'mode'>): any[];
132
- export declare function getGlobeTopLayers({ globe }: {
133
- globe: {
134
- config: BasemapGlobeConfig;
195
+ export declare function getBasemapLayers({ idPrefix, mode, globe, styleDefinition, zoom, loadOptions, fetch, transformRequest, rejectRasterTile, onError, spriteAtlases, fontFamily, glyphs, labelPlacement, featureState, pickable, tilesets, projected, firstPerson, projectedMaxStretch, styleLayerProps, insertLayers }: BasemapLayerGroup): any[];
196
+ /** The error of an insertion whose `beforeId` names no layer of the style. */
197
+ export declare function getInsertionError(beforeId: string): Error;
198
+ /** deck.gl layers to draw before the style layer at `index` of the drawn style layers. */
199
+ type StyleInsertion = {
200
+ index: number;
201
+ layers: LayersList;
202
+ };
203
+ /**
204
+ * Places each insertion of `insertLayers` in the style, as MapLibre GL JS's
205
+ * `addLayer(layer, beforeId)`: before the first drawn style layer at or after `beforeId`, or after
206
+ * the style's layers when none follows. Insertions without a `beforeId` draw over the whole basemap.
207
+ * Throws for a `beforeId` that names no layer of the style, as `addLayer` reports an error.
208
+ */
209
+ export declare function getStyleInsertions(insertLayers: BasemapInsertion[] | null | undefined, styleDefinition: ResolvedBasemapStyle, styleLayers: BasemapStyleLayer[]): {
210
+ insertions: StyleInsertion[];
211
+ topLayers: LayersList;
212
+ };
213
+ /**
214
+ * `getBasemapLayers` with `mode: 'globe'` and the id prefix `'globe-basemap'`.
215
+ *
216
+ * @deprecated Use `getBasemapLayers({...options, mode: 'globe'})`.
217
+ */
218
+ export declare function getGlobeBaseLayers({ idPrefix, ...options }: Omit<BasemapLayerGroup, 'mode'>): any[];
219
+ /** The layers drawn over the globe: the atmosphere, when `globe.config.atmosphere` is set. */
220
+ export declare function getGlobeTopLayers({ globe }?: {
221
+ globe?: {
222
+ config?: BasemapGlobeConfig;
135
223
  };
136
224
  }): null[];
137
225
  /**
138
- * Converts a style `line-dasharray` into deck.gl's `[dash, gap]`. MapLibre measures dashes in line
139
- * widths; deck.gl's `widths` unit is half the line width, so lengths double. deck.gl draws one dash
140
- * and one gap per period, so a longer pattern keeps its period and total dash length, but merges
141
- * its dashes. In an odd-length pattern the last dash runs into the first, as in MapLibre. An empty
142
- * pattern, or one without gaps, draws a solid line.
226
+ * Encodes a style `line-dasharray` as a period and a negative atlas row marker for WebGL.
227
+ * Lengths double because deck.gl uses half line widths. An empty pattern or one without
228
+ * gaps draws solid. Patterns beyond the atlas limits fall back to a single dash and gap.
143
229
  */
144
230
  export declare function getDashArray(dasharray: unknown): [number, number];
145
231
  /** The least distance, in pixels, of a gap's line from the gap's center: see getLineOffset. */
@@ -157,9 +243,9 @@ export declare const MIN_GAP_LINE_CENTER = 0.01;
157
243
  */
158
244
  export declare function getLineOffset(offset: number, gapWidth: number, width: number, side: number, blur?: number): number;
159
245
  /**
160
- * Scales a blurred gap's `getDashArray` by `width / drawnWidth` (see `getBlurredLineWidth`), so
161
- * that its dashes keep the pixel lengths MapLibre gives them in `line-width`s. `shape` is the
162
- * `[offset, gap, width, blur]` accessor of `getLineOffset`.
246
+ * Scales a blurred gap's dash lengths by `width / drawnWidth` so it keeps the pixel lengths
247
+ * MapLibre gives it in `line-width`s. The negative atlas row marker stays fixed.
248
+ * `shape` is the `[offset, gap, width, blur]` accessor of `getLineOffset`.
163
249
  */
164
250
  export declare function getBlurredDashArray(dashArray: StyleAccessor<[number, number]>, shape: StyleAccessor<[number, number, number, number]>): {
165
251
  value: [number, number] | ((feature: any) => [number, number]);
@@ -168,20 +254,17 @@ export declare function getBlurredDashArray(dashArray: StyleAccessor<[number, nu
168
254
  /** deck.gl path props for a line's `line-cap`, `line-join` and `line-miter-limit`. */
169
255
  export type LineShape = {
170
256
  lineCapRounded: boolean;
257
+ /** Whether WebGL extends the flat cap past each path endpoint. */
258
+ lineCapSquare: boolean;
171
259
  lineJointRounded: boolean;
172
260
  lineMiterLimit: number;
173
261
  };
174
262
  /**
175
263
  * Converts `line-cap`, `line-join` and `line-miter-limit` into deck.gl path props.
176
264
  *
177
- * - `round` caps and joins are drawn round. `butt` caps end at the endpoint. deck.gl has no square
178
- * cap, so `square` is drawn as `butt`: the line ends half its width short of MapLibre's.
179
- * - deck.gl cuts a joint flat at `miterLimit + 1` half widths from the vertex. MapLibre draws a
180
- * `miter` join in full while its tip is within `line-miter-limit` half widths of the vertex, so
181
- * passing `line-miter-limit - 1` draws the same joins in full. A sharper corner, which MapLibre
182
- * bevels, is cut flat at that distance instead.
183
- * - deck.gl has no bevel join. A `bevel` join is cut flat half the line width from the vertex,
184
- * which matches a bevel at shallow corners; at sharp corners a true bevel cuts closer.
265
+ * LineShapeExtension extends square caps and bevels corners that exceed the miter limit.
266
+ * deck.gl expresses that limit as `miterLimit + 1` half widths. MapLibre uses a limit of
267
+ * 1.05 half widths for an explicit bevel, retaining the miter at shallow turns.
185
268
  */
186
269
  export declare function getLineShape([cap, join, miterLimit]: unknown[]): LineShape;
187
270
  /**
@@ -195,6 +278,14 @@ export declare function mergeStyleAccessors<T>(accessors: StyleAccessor<T>[], pa
195
278
  }) => T);
196
279
  updateTrigger?: unknown;
197
280
  };
281
+ /** Whether a style layer is drawn from vector tiles: a `symbol` layer only with labels on. */
282
+ /**
283
+ * Whether `getBasemapLayers` draws a style layer with these globe toggles: a supported type, with
284
+ * the basemap on, and labels on for a symbol layer. Style visibility and zoom are not checked.
285
+ */
286
+ export declare function isDrawnStyleLayer(layer: BasemapStyleLayer, globe?: {
287
+ config?: BasemapGlobeConfig;
288
+ }): boolean;
198
289
  /**
199
290
  * Whether a source's layers draw from vector tiles: a vector source with tile templates, or a
200
291
  * GeoJSON source with data, which is cut into tiles on the client (see `getGeoJsonTileFeatures`).
@@ -203,9 +294,10 @@ export declare function isVectorTileSource(source: BasemapSource | undefined): b
203
294
  /**
204
295
  * The `getTileData` of a vector tile source's tileset: `loader` fetches and decodes a vector
205
296
  * source's tiles, and a GeoJSON source's tiles are cut from its data, in the same tile-local
206
- * coordinates.
297
+ * coordinates. `geoJson` says how: a view that shows latitudes past the edges of Web Mercator
298
+ * tiles, projected or a globe, cuts GeoJSON at them (see `GeoJsonTileOptions`).
207
299
  */
208
- export declare function getVectorTileLoader(source: BasemapSource, loader: SharedMVTLayer): (tile: Parameters<SharedMVTLayer['getTileData']>[0]) => Promise<any>;
300
+ export declare function getVectorTileLoader(source: BasemapSource, loader: SharedMVTLayer, geoJson?: GeoJsonTileOptions): (tile: Parameters<SharedMVTLayer['getTileData']>[0]) => Promise<any>;
209
301
  /**
210
302
  * The source layers drawn from each vector source, over all of its runs, sorted; `null` for a
211
303
  * source with a style layer that names none. Tiles decode only these: OpenMapTiles tiles, for
@@ -226,14 +318,18 @@ export declare function getStyleSourceLayers(styleDefinition: ResolvedBasemapSty
226
318
  */
227
319
  export declare function getSourceLoadOptions(loadOptions: BasemapLoadOptions | undefined, sourceLayers: string[] | null | undefined): BasemapLoadOptions | undefined;
228
320
  /**
229
- * Splits the style into runs that draw in style order, as in MapLibre: each background, raster
230
- * and hillshade layer on its own, and consecutive layers of one vector source together, so that a
321
+ * Splits the style into runs that draw in style order, as in MapLibre: each background, raster,
322
+ * hillshade and color-relief layer on its own, and consecutive layers of one vector source together, so that a
231
323
  * raster layer between two vector layers draws between them. Layers that cannot draw (a source
232
324
  * without tiles, labels turned off) do not split a run. Runs do not depend on zoom, so the tile
233
- * layers keep their ids and tiles when a layer leaves its zoom range. Background, raster and
234
- * hillshade runs have their style layer's id. The first run of a source has the source id as its
235
- * id, unless a background, raster or hillshade run already has that id; later runs, and a first run whose source id is
325
+ * layers keep their ids and tiles when a layer leaves its zoom range. Background, raster,
326
+ * hillshade and color-relief runs have their style layer's id. The first run of a source has the
327
+ * source id as its id, unless such a run already has that id; later runs, and a first run whose source id is
236
328
  * taken, add the quoted id of their first style layer.
329
+ *
330
+ * A style layer in `cutBefore` starts a new run, so that deck.gl layers can draw between it and the
331
+ * layers before it (see `BasemapLayerProps.insertLayers`). A cut at a layer that draws nothing
332
+ * applies to the next layer that draws.
237
333
  */
238
- export declare function getStyleLayerRuns(styleLayers: BasemapStyleLayer[], styleDefinition: ResolvedBasemapStyle, config?: BasemapLayerConfig): StyleLayerRun[];
334
+ export declare function getStyleLayerRuns(styleLayers: BasemapStyleLayer[], styleDefinition: ResolvedBasemapStyle, config?: BasemapLayerConfig, cutBefore?: ReadonlySet<BasemapStyleLayer>): StyleLayerRun[];
239
335
  export {};