ol 10.3.2-dev.1734966546937 → 10.3.2-dev.1735323678164

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.
@@ -4,6 +4,7 @@
4
4
  import EventType from '../../events/EventType.js';
5
5
  import {getIntersection} from '../../extent.js';
6
6
  import VectorStyleRenderer from '../../render/webgl/VectorStyleRenderer.js';
7
+ import {breakDownFlatStyle} from '../../render/webgl/utils.js';
7
8
  import {
8
9
  create as createTransform,
9
10
  makeInverse as makeInverseTransform,
@@ -36,12 +37,15 @@ export const Attributes = {
36
37
  };
37
38
 
38
39
  /**
39
- * @typedef {import('../../render/webgl/VectorStyleRenderer.js').VectorStyle} VectorStyle
40
+ * @typedef {import('../../render/webgl/VectorStyleRenderer.js').AsShaders} StyleAsShaders
41
+ */
42
+ /**
43
+ * @typedef {import('../../render/webgl/VectorStyleRenderer.js').AsRule} StyleAsRule
40
44
  */
41
45
 
42
46
  /**
43
47
  * @typedef {Object} Options
44
- * @property {VectorStyle|Array<VectorStyle>} style Vector style as literal style or shaders; can also accept an array of styles
48
+ * @property {import('../../style/flat.js').FlatStyleLike | Array<StyleAsShaders> | StyleAsShaders} style Flat vector style; also accepts shaders
45
49
  * @property {import('../../style/flat.js').StyleVariables} [variables] Style variables. Each variable must hold a literal value (not
46
50
  * an expression). These variables can be used as {@link import("../../expr/expression.js").ExpressionValue expressions} in the styles properties
47
51
  * using the `['var', 'varName']` operator.
@@ -80,7 +84,7 @@ class WebGLVectorTileLayerRenderer extends WebGLBaseTileLayerRenderer {
80
84
  this.hitDetectionEnabled_ = !options.disableHitDetection;
81
85
 
82
86
  /**
83
- * @type {Array<VectorStyle>}
87
+ * @type {Array<StyleAsRule | StyleAsShaders>}
84
88
  * @private
85
89
  */
86
90
  this.styles_ = [];
@@ -170,9 +174,7 @@ class WebGLVectorTileLayerRenderer extends WebGLBaseTileLayerRenderer {
170
174
  * @private
171
175
  */
172
176
  applyOptions_(options) {
173
- this.styles_ = Array.isArray(options.style)
174
- ? options.style
175
- : [options.style];
177
+ this.styles_ = breakDownFlatStyle(options.style);
176
178
  }
177
179
 
178
180
  /**
@@ -193,11 +195,13 @@ class WebGLVectorTileLayerRenderer extends WebGLBaseTileLayerRenderer {
193
195
 
194
196
  this.styleRenderers_ = this.styles_.map((style) => {
195
197
  const isShaders = 'builder' in style;
198
+ /** @type {StyleAsShaders} */
196
199
  let shaders;
197
200
  if (!isShaders) {
198
201
  const parseResult = parseLiteralStyle(
199
- /** @type {import('../../style/webgl.js').WebGLStyle} */ (style),
202
+ style.style,
200
203
  this.styleVariables_,
204
+ style.filter,
201
205
  );
202
206
  addBuilderParams(parseResult.builder);
203
207
  shaders = {
@@ -206,11 +210,7 @@ class WebGLVectorTileLayerRenderer extends WebGLBaseTileLayerRenderer {
206
210
  uniforms: parseResult.uniforms,
207
211
  };
208
212
  } else {
209
- addBuilderParams(
210
- /** @type {import('../../render/webgl/VectorStyleRenderer.js').StyleShaders} */ (
211
- style
212
- ).builder,
213
- );
213
+ addBuilderParams(style.builder);
214
214
  shaders = style;
215
215
  }
216
216
  return new VectorStyleRenderer(
package/style/flat.d.ts CHANGED
@@ -89,15 +89,19 @@
89
89
  * Fill style properties applied to polygon features.
90
90
  *
91
91
  * @typedef {Object} FlatFill
92
- * @property {ColorExpression} [fill-color] The fill color. `'none'` means no fill and no hit detection.
93
- * @property {StringExpression} [fill-pattern-src] Fill pattern image URL.
92
+ * @property {ColorExpression} [fill-color] The fill color. `'none'` means no fill and no hit detection (applies to Canvas only).
93
+ * @property {StringExpression} [fill-pattern-src] Fill pattern image source URI. If `fill-color` is defined as well,
94
+ * it will be used to tint this image. (Expressions only in Canvas)
94
95
  * @property {SizeExpression} [fill-pattern-size] Fill pattern image size in pixels.
95
96
  * Can be used together with `fill-pattern-offset` to define the sub-rectangle to use
96
97
  * from a fill pattern image sprite sheet.
97
- * @property {SizeExpression} [fill-pattern-offset] Fill pattern image offset in pixels.
98
+ * @property {SizeExpression} [fill-pattern-offset=[0, 0]] Offset, which, together with the size and the offset origin, define the
99
+ * sub-rectangle to use from the original fill pattern image.
100
+ * @property {import("./Icon.js").IconOrigin} [fill-pattern-offset-origin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,
101
+ * `top-left` or `top-right`. (WebGL only)
98
102
  */
99
103
  /**
100
- * Stroke style properties applied to line strings and polygon boundaries. To apply a stroke, at least one of
104
+ * Stroke style properties applied to line strings and polygon boundaries. To apply a stroke, at least one of
101
105
  * `stroke-color` or `stroke-width` must be provided.
102
106
  *
103
107
  * @typedef {Object} FlatStroke
@@ -108,10 +112,22 @@
108
112
  * @property {NumberArrayExpression} [stroke-line-dash] Line dash pattern.
109
113
  * @property {NumberExpression} [stroke-line-dash-offset=0] Line dash offset.
110
114
  * @property {NumberExpression} [stroke-miter-limit=10] Miter limit.
115
+ * @property {NumberExpression} [stroke-offset] Stroke offset in pixel. A positive value offsets the line to the right,
116
+ * relative to the direction of the line. (WebGL only)
117
+ * @property {string} [stroke-pattern-src] Stroke pattern image source URI. If `stroke-color` is defined as well,
118
+ * it will be used to tint this image. (WebGL only)
119
+ * @property {SizeExpression} [stroke-pattern-offset=[0, 0]] Offset, which, together with the size and the offset origin,
120
+ * define the sub-rectangle to use from the original fill pattern image. (WebGL only)
121
+ * @property {import("./Icon.js").IconOrigin} [stroke-pattern-offset-origin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,
122
+ * `top-left` or `top-right`. (WebGL only)
123
+ * @property {SizeExpression} [stroke-pattern-size] Stroke pattern image size in pixel. Can be used together with `stroke-pattern-offset` to define the
124
+ * sub-rectangle to use from the origin (sprite) fill pattern image. (WebGL only)
125
+ * @property {NumberExpression} [stroke-pattern-spacing] Spacing between each pattern occurrence in pixels; 0 if undefined.
111
126
  * @property {NumberExpression} [z-index] The zIndex of the style.
112
127
  */
113
128
  /**
114
- * Label style properties applied to all features. At a minimum, a `text-value` must be provided.
129
+ * Label style properties applied to all features. At a minimum, a `text-value` must be provided.
130
+ * Note: text style is currently not supported in WebGL layers
115
131
  *
116
132
  * @typedef {Object} FlatText
117
133
  * @property {StringExpression} [text-value] Text content (with `\n` for line breaks).
@@ -173,76 +189,78 @@
173
189
  * @property {import("./Icon.js").IconAnchorUnits} [icon-anchor-y-units='fraction'] Units in which the anchor y value is
174
190
  * specified. A value of `'fraction'` indicates the y value is a fraction of the icon. A value of `'pixels'` indicates
175
191
  * the y value in pixels.
176
- * @property {import("../color.js").Color|string} [icon-color] Color to tint the icon. If not specified,
192
+ * @property {ColorExpression} [icon-color] Color to tint the icon. If not specified,
177
193
  * the icon will be left as is.
178
194
  * @property {null|string} [icon-cross-origin] The `crossOrigin` attribute for loaded images. Note that you must provide a
179
195
  * `icon-cross-origin` value if you want to access pixel data with the Canvas renderer.
180
196
  * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
181
- * @property {Array<number>} [icon-offset=[0, 0]] Offset, which, together with the size and the offset origin, define the
197
+ * @property {SizeExpression} [icon-offset=[0, 0]] Offset, which, together with the size and the offset origin, define the
182
198
  * sub-rectangle to use from the original icon image.
183
199
  * @property {NumberArrayExpression} [icon-displacement=[0,0]] Displacement of the icon.
184
200
  * @property {import("./Icon.js").IconOrigin} [icon-offset-origin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,
185
201
  * `top-left` or `top-right`.
186
202
  * @property {NumberExpression} [icon-opacity=1] Opacity of the icon.
187
203
  * @property {SizeExpression} [icon-scale=1] Scale.
188
- * @property {number} [icon-width] Width of the icon. If not specified, the actual image width will be used. Cannot be combined
189
- * with `scale`.
190
- * @property {number} [icon-height] Height of the icon. If not specified, the actual image height will be used. Cannot be combined
191
- * with `scale`.
204
+ * @property {NumberExpression} [icon-width] Width of the icon. If not specified, the actual image width will be used. Cannot be combined
205
+ * with `scale`. (Expressions only in WebGL)
206
+ * @property {NumberExpression} [icon-height] Height of the icon. If not specified, the actual image height will be used. Cannot be combined
207
+ * with `scale`. (Expressions only in WebGL)
192
208
  * @property {NumberExpression} [icon-rotation=0] Rotation in radians (positive rotation clockwise).
193
- * @property {BooleanExpression} [icon-rotate-with-view=false] Whether to rotate the icon with the view.
194
- * @property {import("../size.js").Size} [icon-size] Icon size in pixel. Can be used together with `icon-offset` to define the
195
- * sub-rectangle to use from the origin (sprite) icon image.
196
- * @property {import("./Style.js").DeclutterMode} [icon-declutter-mode] Declutter mode
197
- * @property {NumberExpression} [z-index] The zIndex of the style.
209
+ * @property {BooleanExpression} [icon-rotate-with-view=false] Whether to rotate the icon with the view. (Expressions only supported in Canvas)
210
+ * @property {SizeExpression} [icon-size] Icon size in pixel. Can be used together with `icon-offset` to define the
211
+ * sub-rectangle to use from the origin (sprite) icon image. (Expressions only in WebGL)
212
+ * @property {import("./Style.js").DeclutterMode} [icon-declutter-mode] Declutter mode (Canvas only)
213
+ * @property {NumberExpression} [z-index] The zIndex of the style. (Canvas only)
198
214
  */
199
215
  /**
200
- * Regular shape style properties for rendering point features. At least `shape-points` must be provided.
216
+ * Regular shape style properties for rendering point features. At least `shape-points` must be provided.
201
217
  *
202
218
  * @typedef {Object} FlatShape
203
- * @property {number} [shape-points] Number of points for stars and regular polygons. In case of a polygon, the number of points
204
- * is the number of sides.
219
+ * @property {NumberExpression} [shape-points] Number of points for stars and regular polygons. In case of a polygon, the number of points
220
+ * is the number of sides. (Expressions only in WebGL)
205
221
  * @property {ColorExpression} [shape-fill-color] The fill color. `'none'` means no fill and no hit detection.
206
222
  * @property {ColorExpression} [shape-stroke-color] The stroke color.
207
223
  * @property {NumberExpression} [shape-stroke-width] Stroke pixel width.
208
- * @property {StringExpression} [shape-stroke-line-cap='round'] Line cap style: `butt`, `round`, or `square`.
209
- * @property {StringExpression} [shape-stroke-line-join='round'] Line join style: `bevel`, `round`, or `miter`.
210
- * @property {NumberArrayExpression} [shape-stroke-line-dash] Line dash pattern.
211
- * @property {NumberExpression} [shape-stroke-line-dash-offset=0] Line dash offset.
212
- * @property {NumberExpression} [shape-stroke-miter-limit=10] Miter limit.
213
- * @property {number} [shape-radius] Radius of a regular polygon.
214
- * @property {number} [shape-radius2] Second radius to make a star instead of a regular polygon.
215
- * @property {number} [shape-angle=0] Shape's angle in radians. A value of 0 will have one of the shape's point facing up.
224
+ * @property {StringExpression} [shape-stroke-line-cap='round'] Line cap style: `butt`, `round`, or `square`. (Canvas only)
225
+ * @property {StringExpression} [shape-stroke-line-join='round'] Line join style: `bevel`, `round`, or `miter`. (Canvas only)
226
+ * @property {NumberArrayExpression} [shape-stroke-line-dash] Line dash pattern. (Canvas only)
227
+ * @property {NumberExpression} [shape-stroke-line-dash-offset=0] Line dash offset. (Canvas only)
228
+ * @property {NumberExpression} [shape-stroke-miter-limit=10] Miter limit. (Canvas only)
229
+ * @property {NumberExpression} [shape-radius] Radius of a regular polygon. (Expressions only in WebGL)
230
+ * @property {NumberExpression} [shape-radius2] Second radius to make a star instead of a regular polygon. (Expressions only in WebGL)
231
+ * @property {NumberExpression} [shape-angle=0] Shape's angle in radians. A value of 0 will have one of the shape's point facing up. (Expressions only in WebGL)
216
232
  * @property {NumberArrayExpression} [shape-displacement=[0,0]] Displacement of the shape
233
+ * @property {NumberExpression} [shape-opacity] Shape opacity. (WebGL only)
217
234
  * @property {NumberExpression} [shape-rotation=0] Rotation in radians (positive rotation clockwise).
218
- * @property {BooleanExpression} [shape-rotate-with-view=false] Whether to rotate the shape with the view.
219
- * @property {SizeExpression} [shape-scale=1] Scale. Unless two dimensional scaling is required a better
235
+ * @property {BooleanExpression} [shape-rotate-with-view=false] Whether to rotate the shape with the view. (Expression only supported in Canvas)
236
+ * @property {SizeExpression} [shape-scale=1] Scale. Unless two-dimensional scaling is required a better
220
237
  * result may be obtained with appropriate settings for `shape-radius` and `shape-radius2`.
221
- * @property {import("./Style.js").DeclutterMode} [shape-declutter-mode] Declutter mode.
222
- * @property {NumberExpression} [z-index] The zIndex of the style.
238
+ * @property {import("./Style.js").DeclutterMode} [shape-declutter-mode] Declutter mode. (Canvas only)
239
+ * @property {NumberExpression} [z-index] The zIndex of the style. (Canvas only)
223
240
  */
224
241
  /**
225
- * Circle style properties for rendering point features. At least `circle-radius` must be provided.
242
+ * Circle style properties for rendering point features. At least `circle-radius` must be provided.
226
243
  *
227
244
  * @typedef {Object} FlatCircle
228
- * @property {number} [circle-radius] Circle radius.
245
+ * @property {NumberExpression} [circle-radius] Circle radius.
229
246
  * @property {ColorExpression} [circle-fill-color] The fill color. `'none'` means no fill and no hit detection.
230
247
  * @property {ColorExpression} [circle-stroke-color] The stroke color.
231
248
  * @property {NumberExpression} [circle-stroke-width] Stroke pixel width.
232
- * @property {StringExpression} [circle-stroke-line-cap='round'] Line cap style: `butt`, `round`, or `square`.
233
- * @property {StringExpression} [circle-stroke-line-join='round'] Line join style: `bevel`, `round`, or `miter`.
234
- * @property {NumberArrayExpression} [circle-stroke-line-dash] Line dash pattern.
235
- * @property {NumberExpression} [circle-stroke-line-dash-offset=0] Line dash offset.
236
- * @property {NumberExpression} [circle-stroke-miter-limit=10] Miter limit.
249
+ * @property {StringExpression} [circle-stroke-line-cap='round'] Line cap style: `butt`, `round`, or `square`. (Canvas only)
250
+ * @property {StringExpression} [circle-stroke-line-join='round'] Line join style: `bevel`, `round`, or `miter`. (Canvas only)
251
+ * @property {NumberArrayExpression} [circle-stroke-line-dash] Line dash pattern. (Canvas only)
252
+ * @property {NumberExpression} [circle-stroke-line-dash-offset=0] Line dash offset. (Canvas only)
253
+ * @property {NumberExpression} [circle-stroke-miter-limit=10] Miter limit. (Canvas only)
237
254
  * @property {NumberArrayExpression} [circle-displacement=[0,0]] displacement
238
- * @property {SizeExpression} [circle-scale=1] Scale. A two dimensional scale will produce an ellipse.
239
- * Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for `circle-radius`.
255
+ * @property {SizeExpression} [circle-scale=1] Scale. A two-dimensional scale will produce an ellipse.
256
+ * Unless two-dimensional scaling is required a better result may be obtained with an appropriate setting for `circle-radius`.
257
+ * @property {NumberExpression} [circle-opacity] Circle opacity. (WebGL only)
240
258
  * @property {NumberExpression} [circle-rotation=0] Rotation in radians
241
- * (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).
242
- * @property {BooleanExpression} [circle-rotate-with-view=false] Whether to rotate the shape with the view
243
- * (meaningful only when used in conjunction with a two dimensional scale).
244
- * @property {import("./Style.js").DeclutterMode} [circle-declutter-mode] Declutter mode
245
- * @property {NumberExpression} [z-index] The zIndex of the style.
259
+ * (positive rotation clockwise, meaningful only when used in conjunction with a two-dimensional scale).
260
+ * @property {BooleanExpression} [circle-rotate-with-view=false] Whether to rotate the shape with the view (Expression only supported in Canvas)
261
+ * (meaningful only when used in conjunction with a two-dimensional scale).
262
+ * @property {import("./Style.js").DeclutterMode} [circle-declutter-mode] Declutter mode (Canvas only)
263
+ * @property {NumberExpression} [z-index] The zIndex of the style. (Canvas only)
246
264
  */
247
265
  /**
248
266
  * These default style properties are applied when no other style is given.
@@ -299,11 +317,12 @@ export type FlatStyleLike = FlatStyle | Array<FlatStyle> | Array<Rule>;
299
317
  */
300
318
  export type FlatFill = {
301
319
  /**
302
- * The fill color. `'none'` means no fill and no hit detection.
320
+ * The fill color. `'none'` means no fill and no hit detection (applies to Canvas only).
303
321
  */
304
322
  "fill-color"?: ColorExpression | undefined;
305
323
  /**
306
- * Fill pattern image URL.
324
+ * Fill pattern image source URI. If `fill-color` is defined as well,
325
+ * it will be used to tint this image. (Expressions only in Canvas)
307
326
  */
308
327
  "fill-pattern-src"?: StringExpression | undefined;
309
328
  /**
@@ -313,12 +332,18 @@ export type FlatFill = {
313
332
  */
314
333
  "fill-pattern-size"?: SizeExpression | undefined;
315
334
  /**
316
- * Fill pattern image offset in pixels.
335
+ * Offset, which, together with the size and the offset origin, define the
336
+ * sub-rectangle to use from the original fill pattern image.
317
337
  */
318
338
  "fill-pattern-offset"?: SizeExpression | undefined;
339
+ /**
340
+ * Origin of the offset: `bottom-left`, `bottom-right`,
341
+ * `top-left` or `top-right`. (WebGL only)
342
+ */
343
+ "fill-pattern-offset-origin"?: import("./Icon.js").IconOrigin | undefined;
319
344
  };
320
345
  /**
321
- * Stroke style properties applied to line strings and polygon boundaries. To apply a stroke, at least one of
346
+ * Stroke style properties applied to line strings and polygon boundaries. To apply a stroke, at least one of
322
347
  * `stroke-color` or `stroke-width` must be provided.
323
348
  */
324
349
  export type FlatStroke = {
@@ -350,13 +375,43 @@ export type FlatStroke = {
350
375
  * Miter limit.
351
376
  */
352
377
  "stroke-miter-limit"?: NumberExpression | undefined;
378
+ /**
379
+ * Stroke offset in pixel. A positive value offsets the line to the right,
380
+ * relative to the direction of the line. (WebGL only)
381
+ */
382
+ "stroke-offset"?: NumberExpression | undefined;
383
+ /**
384
+ * Stroke pattern image source URI. If `stroke-color` is defined as well,
385
+ * it will be used to tint this image. (WebGL only)
386
+ */
387
+ "stroke-pattern-src"?: string | undefined;
388
+ /**
389
+ * Offset, which, together with the size and the offset origin,
390
+ * define the sub-rectangle to use from the original fill pattern image. (WebGL only)
391
+ */
392
+ "stroke-pattern-offset"?: SizeExpression | undefined;
393
+ /**
394
+ * Origin of the offset: `bottom-left`, `bottom-right`,
395
+ * `top-left` or `top-right`. (WebGL only)
396
+ */
397
+ "stroke-pattern-offset-origin"?: import("./Icon.js").IconOrigin | undefined;
398
+ /**
399
+ * Stroke pattern image size in pixel. Can be used together with `stroke-pattern-offset` to define the
400
+ * sub-rectangle to use from the origin (sprite) fill pattern image. (WebGL only)
401
+ */
402
+ "stroke-pattern-size"?: SizeExpression | undefined;
403
+ /**
404
+ * Spacing between each pattern occurrence in pixels; 0 if undefined.
405
+ */
406
+ "stroke-pattern-spacing"?: NumberExpression | undefined;
353
407
  /**
354
408
  * The zIndex of the style.
355
409
  */
356
410
  "z-index"?: NumberExpression | undefined;
357
411
  };
358
412
  /**
359
- * Label style properties applied to all features. At a minimum, a `text-value` must be provided.
413
+ * Label style properties applied to all features. At a minimum, a `text-value` must be provided.
414
+ * Note: text style is currently not supported in WebGL layers
360
415
  */
361
416
  export type FlatText = {
362
417
  /**
@@ -536,7 +591,7 @@ export type FlatIcon = {
536
591
  * Color to tint the icon. If not specified,
537
592
  * the icon will be left as is.
538
593
  */
539
- "icon-color"?: string | import("../color.js").Color | undefined;
594
+ "icon-color"?: ColorExpression | undefined;
540
595
  /**
541
596
  * The `crossOrigin` attribute for loaded images. Note that you must provide a
542
597
  * `icon-cross-origin` value if you want to access pixel data with the Canvas renderer.
@@ -547,7 +602,7 @@ export type FlatIcon = {
547
602
  * Offset, which, together with the size and the offset origin, define the
548
603
  * sub-rectangle to use from the original icon image.
549
604
  */
550
- "icon-offset"?: number[] | undefined;
605
+ "icon-offset"?: SizeExpression | undefined;
551
606
  /**
552
607
  * Displacement of the icon.
553
608
  */
@@ -567,45 +622,45 @@ export type FlatIcon = {
567
622
  "icon-scale"?: SizeExpression | undefined;
568
623
  /**
569
624
  * Width of the icon. If not specified, the actual image width will be used. Cannot be combined
570
- * with `scale`.
625
+ * with `scale`. (Expressions only in WebGL)
571
626
  */
572
- "icon-width"?: number | undefined;
627
+ "icon-width"?: NumberExpression | undefined;
573
628
  /**
574
629
  * Height of the icon. If not specified, the actual image height will be used. Cannot be combined
575
- * with `scale`.
630
+ * with `scale`. (Expressions only in WebGL)
576
631
  */
577
- "icon-height"?: number | undefined;
632
+ "icon-height"?: NumberExpression | undefined;
578
633
  /**
579
634
  * Rotation in radians (positive rotation clockwise).
580
635
  */
581
636
  "icon-rotation"?: NumberExpression | undefined;
582
637
  /**
583
- * Whether to rotate the icon with the view.
638
+ * Whether to rotate the icon with the view. (Expressions only supported in Canvas)
584
639
  */
585
640
  "icon-rotate-with-view"?: BooleanExpression | undefined;
586
641
  /**
587
642
  * Icon size in pixel. Can be used together with `icon-offset` to define the
588
- * sub-rectangle to use from the origin (sprite) icon image.
643
+ * sub-rectangle to use from the origin (sprite) icon image. (Expressions only in WebGL)
589
644
  */
590
- "icon-size"?: import("../size.js").Size | undefined;
645
+ "icon-size"?: SizeExpression | undefined;
591
646
  /**
592
- * Declutter mode
647
+ * Declutter mode (Canvas only)
593
648
  */
594
649
  "icon-declutter-mode"?: import("./Style.js").DeclutterMode | undefined;
595
650
  /**
596
- * The zIndex of the style.
651
+ * The zIndex of the style. (Canvas only)
597
652
  */
598
653
  "z-index"?: NumberExpression | undefined;
599
654
  };
600
655
  /**
601
- * Regular shape style properties for rendering point features. At least `shape-points` must be provided.
656
+ * Regular shape style properties for rendering point features. At least `shape-points` must be provided.
602
657
  */
603
658
  export type FlatShape = {
604
659
  /**
605
660
  * Number of points for stars and regular polygons. In case of a polygon, the number of points
606
- * is the number of sides.
661
+ * is the number of sides. (Expressions only in WebGL)
607
662
  */
608
- "shape-points"?: number | undefined;
663
+ "shape-points"?: NumberExpression | undefined;
609
664
  /**
610
665
  * The fill color. `'none'` means no fill and no hit detection.
611
666
  */
@@ -619,71 +674,75 @@ export type FlatShape = {
619
674
  */
620
675
  "shape-stroke-width"?: NumberExpression | undefined;
621
676
  /**
622
- * Line cap style: `butt`, `round`, or `square`.
677
+ * Line cap style: `butt`, `round`, or `square`. (Canvas only)
623
678
  */
624
679
  "shape-stroke-line-cap"?: StringExpression | undefined;
625
680
  /**
626
- * Line join style: `bevel`, `round`, or `miter`.
681
+ * Line join style: `bevel`, `round`, or `miter`. (Canvas only)
627
682
  */
628
683
  "shape-stroke-line-join"?: StringExpression | undefined;
629
684
  /**
630
- * Line dash pattern.
685
+ * Line dash pattern. (Canvas only)
631
686
  */
632
687
  "shape-stroke-line-dash"?: NumberArrayExpression | undefined;
633
688
  /**
634
- * Line dash offset.
689
+ * Line dash offset. (Canvas only)
635
690
  */
636
691
  "shape-stroke-line-dash-offset"?: NumberExpression | undefined;
637
692
  /**
638
- * Miter limit.
693
+ * Miter limit. (Canvas only)
639
694
  */
640
695
  "shape-stroke-miter-limit"?: NumberExpression | undefined;
641
696
  /**
642
- * Radius of a regular polygon.
697
+ * Radius of a regular polygon. (Expressions only in WebGL)
643
698
  */
644
- "shape-radius"?: number | undefined;
699
+ "shape-radius"?: NumberExpression | undefined;
645
700
  /**
646
- * Second radius to make a star instead of a regular polygon.
701
+ * Second radius to make a star instead of a regular polygon. (Expressions only in WebGL)
647
702
  */
648
- "shape-radius2"?: number | undefined;
703
+ "shape-radius2"?: NumberExpression | undefined;
649
704
  /**
650
- * Shape's angle in radians. A value of 0 will have one of the shape's point facing up.
705
+ * Shape's angle in radians. A value of 0 will have one of the shape's point facing up. (Expressions only in WebGL)
651
706
  */
652
- "shape-angle"?: number | undefined;
707
+ "shape-angle"?: NumberExpression | undefined;
653
708
  /**
654
709
  * Displacement of the shape
655
710
  */
656
711
  "shape-displacement"?: NumberArrayExpression | undefined;
712
+ /**
713
+ * Shape opacity. (WebGL only)
714
+ */
715
+ "shape-opacity"?: NumberExpression | undefined;
657
716
  /**
658
717
  * Rotation in radians (positive rotation clockwise).
659
718
  */
660
719
  "shape-rotation"?: NumberExpression | undefined;
661
720
  /**
662
- * Whether to rotate the shape with the view.
721
+ * Whether to rotate the shape with the view. (Expression only supported in Canvas)
663
722
  */
664
723
  "shape-rotate-with-view"?: BooleanExpression | undefined;
665
724
  /**
666
- * Scale. Unless two dimensional scaling is required a better
725
+ * Scale. Unless two-dimensional scaling is required a better
667
726
  * result may be obtained with appropriate settings for `shape-radius` and `shape-radius2`.
668
727
  */
669
728
  "shape-scale"?: SizeExpression | undefined;
670
729
  /**
671
- * Declutter mode.
730
+ * Declutter mode. (Canvas only)
672
731
  */
673
732
  "shape-declutter-mode"?: import("./Style.js").DeclutterMode | undefined;
674
733
  /**
675
- * The zIndex of the style.
734
+ * The zIndex of the style. (Canvas only)
676
735
  */
677
736
  "z-index"?: NumberExpression | undefined;
678
737
  };
679
738
  /**
680
- * Circle style properties for rendering point features. At least `circle-radius` must be provided.
739
+ * Circle style properties for rendering point features. At least `circle-radius` must be provided.
681
740
  */
682
741
  export type FlatCircle = {
683
742
  /**
684
743
  * Circle radius.
685
744
  */
686
- "circle-radius"?: number | undefined;
745
+ "circle-radius"?: NumberExpression | undefined;
687
746
  /**
688
747
  * The fill color. `'none'` means no fill and no hit detection.
689
748
  */
@@ -697,23 +756,23 @@ export type FlatCircle = {
697
756
  */
698
757
  "circle-stroke-width"?: NumberExpression | undefined;
699
758
  /**
700
- * Line cap style: `butt`, `round`, or `square`.
759
+ * Line cap style: `butt`, `round`, or `square`. (Canvas only)
701
760
  */
702
761
  "circle-stroke-line-cap"?: StringExpression | undefined;
703
762
  /**
704
- * Line join style: `bevel`, `round`, or `miter`.
763
+ * Line join style: `bevel`, `round`, or `miter`. (Canvas only)
705
764
  */
706
765
  "circle-stroke-line-join"?: StringExpression | undefined;
707
766
  /**
708
- * Line dash pattern.
767
+ * Line dash pattern. (Canvas only)
709
768
  */
710
769
  "circle-stroke-line-dash"?: NumberArrayExpression | undefined;
711
770
  /**
712
- * Line dash offset.
771
+ * Line dash offset. (Canvas only)
713
772
  */
714
773
  "circle-stroke-line-dash-offset"?: NumberExpression | undefined;
715
774
  /**
716
- * Miter limit.
775
+ * Miter limit. (Canvas only)
717
776
  */
718
777
  "circle-stroke-miter-limit"?: NumberExpression | undefined;
719
778
  /**
@@ -721,26 +780,30 @@ export type FlatCircle = {
721
780
  */
722
781
  "circle-displacement"?: NumberArrayExpression | undefined;
723
782
  /**
724
- * Scale. A two dimensional scale will produce an ellipse.
725
- * Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for `circle-radius`.
783
+ * Scale. A two-dimensional scale will produce an ellipse.
784
+ * Unless two-dimensional scaling is required a better result may be obtained with an appropriate setting for `circle-radius`.
726
785
  */
727
786
  "circle-scale"?: SizeExpression | undefined;
787
+ /**
788
+ * Circle opacity. (WebGL only)
789
+ */
790
+ "circle-opacity"?: NumberExpression | undefined;
728
791
  /**
729
792
  * Rotation in radians
730
- * (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).
793
+ * (positive rotation clockwise, meaningful only when used in conjunction with a two-dimensional scale).
731
794
  */
732
795
  "circle-rotation"?: NumberExpression | undefined;
733
796
  /**
734
- * Whether to rotate the shape with the view
735
- * (meaningful only when used in conjunction with a two dimensional scale).
797
+ * Whether to rotate the shape with the view (Expression only supported in Canvas)
798
+ * (meaningful only when used in conjunction with a two-dimensional scale).
736
799
  */
737
800
  "circle-rotate-with-view"?: BooleanExpression | undefined;
738
801
  /**
739
- * Declutter mode
802
+ * Declutter mode (Canvas only)
740
803
  */
741
804
  "circle-declutter-mode"?: import("./Style.js").DeclutterMode | undefined;
742
805
  /**
743
- * The zIndex of the style.
806
+ * The zIndex of the style. (Canvas only)
744
807
  */
745
808
  "z-index"?: NumberExpression | undefined;
746
809
  };
@@ -778,7 +841,7 @@ export type DefaultStyle = {
778
841
  "circle-stroke-color": string;
779
842
  };
780
843
  /**
781
- * A rule is used to conditionally apply a style. If the rule's filter evaluates to true,
844
+ * A rule is used to conditionally apply a style. If the rule's filter evaluates to true,
782
845
  * the style will be applied.
783
846
  */
784
847
  export type Rule = {
@@ -788,7 +851,7 @@ export type Rule = {
788
851
  style: FlatStyle | Array<FlatStyle>;
789
852
  /**
790
853
  * The filter used
791
- * to determine if a style applies. If no filter is included, the rule always applies
854
+ * to determine if a style applies. If no filter is included, the rule always applies
792
855
  * (unless it is an else rule).
793
856
  */
794
857
  filter?: import("../expr/expression.js").EncodedExpression | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["flat.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqC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