ol 10.2.2-dev.1732401392689 → 10.2.2-dev.1732716369676

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 (41) hide show
  1. package/dist/ol.d.ts +6 -0
  2. package/dist/ol.d.ts.map +1 -1
  3. package/dist/ol.js +1 -1
  4. package/dist/ol.js.map +1 -1
  5. package/expr/gpu.d.ts +10 -13
  6. package/expr/gpu.d.ts.map +1 -1
  7. package/expr/gpu.js +16 -19
  8. package/layer/Heatmap.js +3 -3
  9. package/layer/Layer.d.ts +4 -0
  10. package/layer/Layer.d.ts.map +1 -1
  11. package/layer/Layer.js +9 -3
  12. package/layer/WebGLPoints.d.ts +17 -4
  13. package/layer/WebGLPoints.d.ts.map +1 -1
  14. package/layer/WebGLPoints.js +8 -4
  15. package/layer/WebGLTile.d.ts.map +1 -1
  16. package/layer/WebGLTile.js +0 -1
  17. package/layer/WebGLVector.d.ts +173 -0
  18. package/layer/WebGLVector.d.ts.map +1 -0
  19. package/layer/WebGLVector.js +120 -0
  20. package/package.json +1 -1
  21. package/render/webgl/VectorStyleRenderer.d.ts +2 -1
  22. package/render/webgl/VectorStyleRenderer.d.ts.map +1 -1
  23. package/render/webgl/VectorStyleRenderer.js +4 -2
  24. package/renderer/webgl/PointsLayer.js +2 -2
  25. package/renderer/webgl/VectorLayer.d.ts +12 -0
  26. package/renderer/webgl/VectorLayer.d.ts.map +1 -1
  27. package/renderer/webgl/VectorLayer.js +19 -2
  28. package/renderer/webgl/VectorTileLayer.d.ts +16 -0
  29. package/renderer/webgl/VectorTileLayer.d.ts.map +1 -1
  30. package/renderer/webgl/VectorTileLayer.js +11 -0
  31. package/style/flat.d.ts +8 -0
  32. package/style/flat.d.ts.map +1 -1
  33. package/style/flat.js +7 -0
  34. package/style/webgl.d.ts +0 -7
  35. package/style/webgl.d.ts.map +1 -1
  36. package/style/webgl.js +0 -2
  37. package/util.js +1 -1
  38. package/webgl/ShaderBuilder.js +15 -15
  39. package/webgl/styleparser.d.ts +2 -1
  40. package/webgl/styleparser.d.ts.map +1 -1
  41. package/webgl/styleparser.js +57 -23
package/expr/gpu.d.ts CHANGED
@@ -59,13 +59,11 @@ export function uniformNameForVariable(variableName: string): string;
59
59
  * @typedef {Object} CompilationContextProperty
60
60
  * @property {string} name Name
61
61
  * @property {number} type Resolved property type
62
- * @property {function(import("../Feature.js").FeatureLike): *} [evaluator] Function used for evaluating the value;
63
62
  */
64
63
  /**
65
64
  * @typedef {Object} CompilationContextVariable
66
65
  * @property {string} name Name
67
66
  * @property {number} type Resolved variable type
68
- * @property {function(Object): *} [evaluator] Function used for evaluating the value; argument is the style variables object
69
67
  */
70
68
  /**
71
69
  * @typedef {Object} CompilationContext
@@ -75,7 +73,8 @@ export function uniformNameForVariable(variableName: string): string;
75
73
  * @property {Object<string, string>} functions Lookup of functions used by the style.
76
74
  * @property {number} [bandCount] Number of bands per pixel.
77
75
  * @property {Array<PaletteTexture>} [paletteTextures] List of palettes used by the style.
78
- * @property {import("../style/webgl.js").WebGLStyle} style Literal style.
76
+ * @property {boolean} featureId Whether the feature ID is used in the expression
77
+ * @property {boolean} geometryType Whether the geometry type is used in the expression
79
78
  */
80
79
  /**
81
80
  * @return {CompilationContext} A new compilation context.
@@ -97,6 +96,8 @@ export function newCompilationContext(): CompilationContext;
97
96
  */
98
97
  export function buildExpression(encoded: import("./expression.js").EncodedExpression, type: number, parsingContext: import("./expression.js").ParsingContext, compilationContext: CompilationContext): CompiledExpression;
99
98
  export const PALETTE_TEXTURE_ARRAY: "u_paletteTextures";
99
+ export const FEATURE_ID_PROPERTY_NAME: "featureId";
100
+ export const GEOMETRY_TYPE_PROPERTY_NAME: "geometryType";
100
101
  export type ParsingContext = import("./expression.js").ParsingContext;
101
102
  export type Expression = import("./expression.js").Expression;
102
103
  export type LiteralExpression = import("./expression.js").LiteralExpression;
@@ -109,10 +110,6 @@ export type CompilationContextProperty = {
109
110
  * Resolved property type
110
111
  */
111
112
  type: number;
112
- /**
113
- * Function used for evaluating the value;
114
- */
115
- evaluator?: ((arg0: import("../Feature.js").FeatureLike) => any) | undefined;
116
113
  };
117
114
  export type CompilationContextVariable = {
118
115
  /**
@@ -123,10 +120,6 @@ export type CompilationContextVariable = {
123
120
  * Resolved variable type
124
121
  */
125
122
  type: number;
126
- /**
127
- * Function used for evaluating the value; argument is the style variables object
128
- */
129
- evaluator?: ((arg0: any) => any) | undefined;
130
123
  };
131
124
  export type CompilationContext = {
132
125
  /**
@@ -160,9 +153,13 @@ export type CompilationContext = {
160
153
  */
161
154
  paletteTextures?: PaletteTexture[] | undefined;
162
155
  /**
163
- * Literal style.
156
+ * Whether the feature ID is used in the expression
157
+ */
158
+ featureId: boolean;
159
+ /**
160
+ * Whether the geometry type is used in the expression
164
161
  */
165
- style: import("../style/webgl.js").WebGLStyle;
162
+ geometryType: boolean;
166
163
  };
167
164
  export type CompiledExpression = string;
168
165
  /**
package/expr/gpu.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gpu.d.ts","sourceRoot":"","sources":["gpu.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,gCAHW,MAAM,GACL,MAAM,CAKjB;AAED;;;;GAIG;AACH,mCAHW,KAAK,CAAC,MAAM,CAAC,GACZ,MAAM,CASjB;AAED;;;;;;GAMG;AACH,mCALW,MAAM,GAAC,OAAO,aAAa,EAAE,KAAK,GAGjC,MAAM,CAMjB;AAED;;;;GAIG;AACH,iCAHW,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI,GAC/B,MAAM,CAKjB;AAMD;;;;GAIG;AACH,kDAHW,MAAM,GACL,MAAM,CAOjB;AAED;;;;;;GAMG;AACH,qCAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;GAIG;AACH,qDAHW,MAAM,GACL,MAAM,CAIjB;AAED;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;;GAKG;AAEH;;;;;;;;;GASG;AAEH;;GAE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AM,CAIjB;AAED;;;;GAIG;AACH,qDAHW,MAAM,GACL,MAAM,CAIjB;AAED;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,yCAFY,kBAAkB,CAY7B;AASD;;GAEG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AACH,yCANW,OAAO,iBAAiB,EAAE,iBAAiB,QAC3C,MAAM,kBACN,OAAO,iBAAiB,EAAE,cAAc,sBACxC,kBAAkB,GACjB,kBAAkB,CAU7B;AA7BD,wDAAyD;AAEzD,mDAAoD;AACpD,yDAA0D;6BAvD7C,OAAO,iBAAiB,EAAE,cAAc;yBAIxC,OAAO,iBAAiB,EAAE,UAAU;gCAIpC,OAAO,iBAAiB,EAAE,iBAAiB;;;;;UAK1C,MAAM;;;;UACN,MAAM;;;;;;UAKN,MAAM;;;;UACN,MAAM;;;;;;;;;;gBAMN;YAAO,MAAM,GAAE,0BAA0B;KAAC;;;;eAC1C;YAAO,MAAM,GAAE,0BAA0B;KAAC;;;;eAC1C;YAAO,MAAM,GAAE,MAAM;KAAC;;;;;;;;;;;;eAGtB,OAAO;;;;kBACP,OAAO;;iCA0BR,MAAM;;;;uBAIN,CAAS,IAAkB,EAAlB,kBAAkB,EAAE,IAAc,EAAd,cAAc,EAAE,IAAM,EAAN,MAAM,KAAG,MAAM;2BA5K9C,4BAA4B;+BAYhD,iBAAiB"}
package/expr/gpu.js CHANGED
@@ -11,7 +11,6 @@ import {
11
11
  Ops,
12
12
  SizeType,
13
13
  StringType,
14
- computeGeometryType,
15
14
  parse,
16
15
  typeName,
17
16
  } from './expression.js';
@@ -127,14 +126,12 @@ export function uniformNameForVariable(variableName) {
127
126
  * @typedef {Object} CompilationContextProperty
128
127
  * @property {string} name Name
129
128
  * @property {number} type Resolved property type
130
- * @property {function(import("../Feature.js").FeatureLike): *} [evaluator] Function used for evaluating the value;
131
129
  */
132
130
 
133
131
  /**
134
132
  * @typedef {Object} CompilationContextVariable
135
133
  * @property {string} name Name
136
134
  * @property {number} type Resolved variable type
137
- * @property {function(Object): *} [evaluator] Function used for evaluating the value; argument is the style variables object
138
135
  */
139
136
 
140
137
  /**
@@ -145,7 +142,8 @@ export function uniformNameForVariable(variableName) {
145
142
  * @property {Object<string, string>} functions Lookup of functions used by the style.
146
143
  * @property {number} [bandCount] Number of bands per pixel.
147
144
  * @property {Array<PaletteTexture>} [paletteTextures] List of palettes used by the style.
148
- * @property {import("../style/webgl.js").WebGLStyle} style Literal style.
145
+ * @property {boolean} featureId Whether the feature ID is used in the expression
146
+ * @property {boolean} geometryType Whether the geometry type is used in the expression
149
147
  */
150
148
 
151
149
  /**
@@ -158,7 +156,8 @@ export function newCompilationContext() {
158
156
  properties: {},
159
157
  functions: {},
160
158
  bandCount: 0,
161
- style: {},
159
+ featureId: false,
160
+ geometryType: false,
162
161
  };
163
162
  }
164
163
 
@@ -166,6 +165,9 @@ const GET_BAND_VALUE_FUNC = 'getBandValue';
166
165
 
167
166
  export const PALETTE_TEXTURE_ARRAY = 'u_paletteTextures';
168
167
 
168
+ export const FEATURE_ID_PROPERTY_NAME = 'featureId';
169
+ export const GEOMETRY_TYPE_PROPERTY_NAME = 'geometryType';
170
+
169
171
  /**
170
172
  * @typedef {string} CompiledExpression
171
173
  */
@@ -224,20 +226,15 @@ const compilers = {
224
226
  const prefix = context.inFragmentShader ? 'v_prop_' : 'a_prop_';
225
227
  return prefix + propName;
226
228
  },
227
- [Ops.GeometryType]: (context, expression, type) => {
228
- const propName = 'geometryType';
229
- const isExisting = propName in context.properties;
230
- if (!isExisting) {
231
- context.properties[propName] = {
232
- name: propName,
233
- type: StringType,
234
- evaluator: (feature) => {
235
- return computeGeometryType(feature.getGeometry());
236
- },
237
- };
238
- }
239
- const prefix = context.inFragmentShader ? 'v_prop_' : 'a_prop_';
240
- return prefix + propName;
229
+ [Ops.Id]: (context) => {
230
+ context.featureId = true;
231
+ const prefix = context.inFragmentShader ? 'v_' : 'a_';
232
+ return prefix + FEATURE_ID_PROPERTY_NAME;
233
+ },
234
+ [Ops.GeometryType]: (context) => {
235
+ context.geometryType = true;
236
+ const prefix = context.inFragmentShader ? 'v_' : 'a_';
237
+ return prefix + GEOMETRY_TYPE_PROPERTY_NAME;
241
238
  },
242
239
  [Ops.LineMetric]: () => 'currentLineMetric', // this variable is assumed to always be present in shaders, default is 0.
243
240
  [Ops.Var]: (context, expression) => {
package/layer/Heatmap.js CHANGED
@@ -189,13 +189,13 @@ class Heatmap extends BaseVector {
189
189
  */
190
190
  createRenderer() {
191
191
  const builder = new ShaderBuilder()
192
- .addAttribute('float a_prop_weight')
193
- .addVarying('v_prop_weight', 'float', 'a_prop_weight')
192
+ .addAttribute('float a_weight')
193
+ .addVarying('v_weight', 'float', 'a_weight')
194
194
  .addUniform('float u_size')
195
195
  .addUniform('float u_blurSlope')
196
196
  .setSymbolSizeExpression('vec2(u_size)')
197
197
  .setSymbolColorExpression(
198
- 'vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)',
198
+ 'vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_weight)',
199
199
  );
200
200
 
201
201
  return new WebGLPointsLayerRenderer(this, {
package/layer/Layer.d.ts CHANGED
@@ -373,6 +373,10 @@ declare class Layer<SourceType extends import("../source/Source.js").default = i
373
373
  * @protected
374
374
  */
375
375
  protected createRenderer(): RendererType;
376
+ /**
377
+ * This will clear the renderer so that a new one can be created next time it is needed
378
+ */
379
+ clearRenderer(): void;
376
380
  }
377
381
  import BaseLayer from './Base.js';
378
382
  import View from '../View.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":"AAohBA;;;;;;GAMG;AACH,mCAJW,KAAK,aACL,OAAO,YAAY,EAAE,KAAK,GACzB,OAAO,CAelB;;6BA3hBY,CAAS,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UAAU,EAAE,KAAK,GACvB,OAAO,CAAC,KAAK,CAAC,OAAO,YAAY,EAAE,WAAW,CAAC,CAAC,CAQ3D;IAED;;;OAGG;IACH,eAHW,OAAO,UAAU,EAAE,KAAK,GACvB,iBAAiB,GAAC,UAAU,GAAC,YAAY,GAAC,QAAQ,GAAC,IAAI,CAOlE;IAED;;;;;;;;OAQG;IACH,qFAHY,OAAO,CAsClB;IAED;;;;;;OAMG;IACH,2FAHY,KAAK,CAAC,MAAM,CAAC,CAkBxB;IAoBD;;OAEG;IACH,iBAEC;IAED,iCAAiC;IACjC,gBADa,MAAM,CAGlB;IAED;;;OAGG;IACH,4BAHW,OAAO,WAAW,EAAE,UAAU,cAC9B,OAAO,mBAAmB,EAAE,KAAK,QAEF;IAE1C;;;OAGG;IACH,2BAFW,OAAO,WAAW,EAAE,UAAU,QAQxC;IAED;;;OAGG;IACH,oBAFW,OAAO,WAAW,EAAE,OAAO,GAAC,IAAI,QAO1C;IAED;;;OAGG;IACH,kBAFY,OAAO,WAAW,EAAE,OAAO,GAAC,IAAI,CAI3C;IAED;;;;;;;;;;OAUG;IACH,YAHW,OAAO,WAAW,EAAE,OAAO,GAAC,IAAI,QAyB1C;IAED;;;OAGG;IACH,0BAYC;IAED;;;;;OAKG;IACH,kBAJW,UAAU,GAAC,IAAI,QAMzB;IAED;;;OAGG;IACH,eAFY,YAAY,GAAC,IAAI,CAO5B;IAED;;OAEG;IACH,eAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,4BAHY,YAAY,CAKvB;IAED;;OAEG;IACH,sBAKC;CAWF;sBArhBqB,WAAW;iBAIhB,YAAY"}
package/layer/Layer.js CHANGED
@@ -516,15 +516,21 @@ class Layer extends BaseLayer {
516
516
  }
517
517
 
518
518
  /**
519
- * Clean up.
520
- * @override
519
+ * This will clear the renderer so that a new one can be created next time it is needed
521
520
  */
522
- disposeInternal() {
521
+ clearRenderer() {
523
522
  if (this.renderer_) {
524
523
  this.renderer_.dispose();
525
524
  delete this.renderer_;
526
525
  }
526
+ }
527
527
 
528
+ /**
529
+ * Clean up.
530
+ * @override
531
+ */
532
+ disposeInternal() {
533
+ this.clearRenderer();
528
534
  this.setSource(null);
529
535
  super.disposeInternal();
530
536
  }
@@ -4,6 +4,15 @@ export type Options<VectorSourceType extends import("../source/Vector.js").defau
4
4
  * Literal style to apply to the layer features.
5
5
  */
6
6
  style: import("../style/webgl.js").WebGLStyle;
7
+ /**
8
+ * Style variables. Each variable must hold a literal value (not
9
+ * an expression). These variables can be used as {@link import ("../expr/expression.js").ExpressionValue expressions} in the styles properties
10
+ * using the `['var', 'varName']` operator.
11
+ * To update style variables, use the {@link import ("./WebGLPoints.js").default#updateStyleVariables} method.
12
+ */
13
+ variables?: {
14
+ [x: string]: string | number | boolean | number[];
15
+ } | undefined;
7
16
  /**
8
17
  * A CSS class name to set to the layer element.
9
18
  */
@@ -68,6 +77,10 @@ export type Options<VectorSourceType extends import("../source/Vector.js").defau
68
77
  * @template {import("../source/Vector.js").default<import('../Feature').FeatureLike>} VectorSourceType
69
78
  * @typedef {Object} Options
70
79
  * @property {import('../style/webgl.js').WebGLStyle} style Literal style to apply to the layer features.
80
+ * @property {import('../style/flat.js').StyleVariables} [variables] Style variables. Each variable must hold a literal value (not
81
+ * an expression). These variables can be used as {@link import("../expr/expression.js").ExpressionValue expressions} in the styles properties
82
+ * using the `['var', 'varName']` operator.
83
+ * To update style variables, use the {@link import("./WebGLPoints.js").default#updateStyleVariables} method.
71
84
  * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
72
85
  * @property {number} [opacity=1] Opacity (0, 1).
73
86
  * @property {boolean} [visible=true] Visibility.
@@ -131,15 +144,15 @@ declare class WebGLPointsLayer<VectorSourceType extends import("../source/Vector
131
144
  */
132
145
  constructor(options: Options<VectorSourceType>);
133
146
  /**
147
+ * @type {import('../style/flat.js').StyleVariables}
134
148
  * @private
135
- * @type {import('../webgl/styleparser.js').StyleParseResult}
136
149
  */
137
- private parseResult_;
150
+ private styleVariables_;
138
151
  /**
139
- * @type {Object<string, (string|number|Array<number>|boolean)>}
140
152
  * @private
153
+ * @type {import('../webgl/styleparser.js').StyleParseResult}
141
154
  */
142
- private styleVariables_;
155
+ private parseResult_;
143
156
  /**
144
157
  * @private
145
158
  * @type {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"WebGLPoints.d.ts","sourceRoot":"","sources":["WebGLPoints.js"],"names":[],"mappings":";oBAQuF,gBAAgB,SAA1F,OAAQ,qBAAqB,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAE;;;;WAExE,OAAO,mBAAmB,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,+BALuF,gBAAgB,SAA1F,OAAQ,qBAAqB,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAE;IAMpF;;OAEG;IACH,qBAFW,OAAO,CAAC,gBAAgB,CAAC,EAwBnC;IAjBC;;;OAGG;IACH,qBAAoD;IAEpD;;;OAGG;IACH,wBAAoD;IAEpD;;;OAGG;IACH,8BAA0D;IAyB5D;;;OAGG;IACH,gCAFW;YAAO,MAAM,GAAE,MAAM;KAAC,QAKhC;CACF;qCA3HoC,kCAAkC;kBADrD,YAAY"}
1
+ {"version":3,"file":"WebGLPoints.d.ts","sourceRoot":"","sources":["WebGLPoints.js"],"names":[],"mappings":";oBAQuF,gBAAgB,SAA1F,OAAQ,qBAAqB,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAE;;;;WAExE,OAAO,mBAAmB,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,+BALuF,gBAAgB,SAA1F,OAAQ,qBAAqB,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,WAAW,CAAE;IAMpF;;OAEG;IACH,qBAFW,OAAO,CAAC,gBAAgB,CAAC,EAwBnC;IAjBC;;;OAGG;IACH,wBAA8C;IAE9C;;;OAGG;IACH,qBAA0E;IAE1E;;;OAGG;IACH,8BAA0D;IAyB5D;;;OAGG;IACH,gCAFW;YAAO,MAAM,GAAE,MAAM;KAAC,QAKhC;CACF;qCA/HoC,kCAAkC;kBADrD,YAAY"}
@@ -9,6 +9,10 @@ import {parseLiteralStyle} from '../webgl/styleparser.js';
9
9
  * @template {import("../source/Vector.js").default<import('../Feature').FeatureLike>} VectorSourceType
10
10
  * @typedef {Object} Options
11
11
  * @property {import('../style/webgl.js').WebGLStyle} style Literal style to apply to the layer features.
12
+ * @property {import('../style/flat.js').StyleVariables} [variables] Style variables. Each variable must hold a literal value (not
13
+ * an expression). These variables can be used as {@link import("../expr/expression.js").ExpressionValue expressions} in the styles properties
14
+ * using the `['var', 'varName']` operator.
15
+ * To update style variables, use the {@link import("./WebGLPoints.js").default#updateStyleVariables} method.
12
16
  * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
13
17
  * @property {number} [opacity=1] Opacity (0, 1).
14
18
  * @property {boolean} [visible=true] Visibility.
@@ -77,16 +81,16 @@ class WebGLPointsLayer extends Layer {
77
81
  super(baseOptions);
78
82
 
79
83
  /**
84
+ * @type {import('../style/flat.js').StyleVariables}
80
85
  * @private
81
- * @type {import('../webgl/styleparser.js').StyleParseResult}
82
86
  */
83
- this.parseResult_ = parseLiteralStyle(options.style);
87
+ this.styleVariables_ = options.variables || {};
84
88
 
85
89
  /**
86
- * @type {Object<string, (string|number|Array<number>|boolean)>}
87
90
  * @private
91
+ * @type {import('../webgl/styleparser.js').StyleParseResult}
88
92
  */
89
- this.styleVariables_ = options.style.variables || {};
93
+ this.parseResult_ = parseLiteralStyle(options.style, this.styleVariables_);
90
94
 
91
95
  /**
92
96
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"WebGLTile.d.ts","sourceRoot":"","sources":["WebGLTile.js"],"names":[],"mappings":";yBAmBa,OAAO,uBAAuB,EAAE,OAAO,CAAC,OAAO,gBAAgB,EAAE,OAAO,GAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wIA+C/E,OAAO,cAAc,EAAE,MAAM,QAAE,MAAM,KAAE,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiBnF,MAAM;;;;oBACN,MAAM;;;;cACN;YAAO,MAAM,GAAC,OAAO,oBAAoB,EAAE,YAAY;KAAC;;;;qBACxD,KAAK,CAAC,OAAO,4BAA4B,EAAE,OAAO,CAAC;;AA0LjE;;;;;;;;;;;;GAYG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAyCjB;IA/BC;;;OAGG;IACH,iBAA+B;IAE/B;;;OAGG;IACH,wBAA2B;IAE3B;;;OAGG;IACH,4BAA8B;IAE9B;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,wBAAkD;IAKpD;;;;;OAKG;IACH,mBAJW,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,GACL,KAAK,CAAC,UAAU,CAAC,CAW5B;IAED;;;OAGG;IACH,4BAHY,UAAU,CAKrB;IAWD;;OAEG;IACH,4BAkBC;IAED;;;OAGG;IACH,4BAMC;IAED;;OAEG;IACH,wDAUC;IAED;;;;OAIG;IACH,0BAJW,OAAO,QAAQ,EAAE,UAAU,WAC3B,KAAK,CAAC,UAAU,CAAC,GAChB,WAAW,CAYtB;IAED;;;;;;OAMG;IACH,4BANY,OAAO,WAAW,EAAE,UA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WAC3B,KAAK,CAAC,UAAU,CAAC,GAChB,WAAW,CAYtB;IAED;;;;;;OAMG;IACH,4BANY,OAAO,WAAW,EAAE,UAAU,OAAA,UAC/B,WAAW,GAEV,WAAW,CAuCtB;IAED;;;;;;;OAOG;IACH,gBAFW,KAAK,QAgBf;IAED;;;;OAIG;IACH,gCAHW;YAAO,MAAM,GAAE,MAAM;KAAC,QAMhC;CACF;mCApfM,gCAAgC;0BALb,eAAe"}
@@ -123,7 +123,6 @@ function parseStyle(style, bandCount) {
123
123
  ...newCompilationContext(),
124
124
  inFragmentShader: true,
125
125
  bandCount: bandCount,
126
- style: style,
127
126
  };
128
127
 
129
128
  const pipeline = [];
@@ -0,0 +1,173 @@
1
+ export default WebGLVectorLayer;
2
+ /**
3
+ * *
4
+ */
5
+ export type ExtractedFeatureType<T> = T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never;
6
+ export type Options<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = ExtractedFeatureType<VectorSourceType>> = {
7
+ /**
8
+ * A CSS class name to set to the layer element.
9
+ */
10
+ className?: string | undefined;
11
+ /**
12
+ * Opacity (0, 1).
13
+ */
14
+ opacity?: number | undefined;
15
+ /**
16
+ * Visibility.
17
+ */
18
+ visible?: boolean | undefined;
19
+ /**
20
+ * The bounding extent for layer rendering. The layer will not be
21
+ * rendered outside of this extent.
22
+ * FIXME: not supported yet
23
+ */
24
+ extent?: import("../extent.js").Extent | undefined;
25
+ /**
26
+ * The z-index for layer rendering. At rendering time, the layers
27
+ * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
28
+ * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
29
+ * method was used.
30
+ */
31
+ zIndex?: number | undefined;
32
+ /**
33
+ * The minimum resolution (inclusive) at which this layer will be
34
+ * visible.
35
+ */
36
+ minResolution?: number | undefined;
37
+ /**
38
+ * The maximum resolution (exclusive) below which this layer will
39
+ * be visible.
40
+ */
41
+ maxResolution?: number | undefined;
42
+ /**
43
+ * The minimum view zoom level (exclusive) above which this layer will be
44
+ * visible.
45
+ */
46
+ minZoom?: number | undefined;
47
+ /**
48
+ * The maximum view zoom level (inclusive) at which this layer will
49
+ * be visible.
50
+ */
51
+ maxZoom?: number | undefined;
52
+ /**
53
+ * Source.
54
+ */
55
+ source?: VectorSourceType | undefined;
56
+ /**
57
+ * Layer style.
58
+ */
59
+ style: import("../style/webgl.js").WebGLStyle;
60
+ /**
61
+ * Style variables. Each variable must hold a literal value (not
62
+ * an expression). These variables can be used as {@link import ("../expr/expression.js").ExpressionValue expressions} in the styles properties
63
+ * using the `['var', 'varName']` operator.
64
+ * To update style variables, use the {@link import ("./WebGLVector.js").default#updateStyleVariables} method.
65
+ */
66
+ variables?: {
67
+ [x: string]: string | number | boolean | number[];
68
+ } | undefined;
69
+ /**
70
+ * Background color for the layer. If not specified, no background
71
+ * will be rendered.
72
+ * FIXME: not supported yet
73
+ */
74
+ background?: import("./Base.js").BackgroundColor | undefined;
75
+ /**
76
+ * Setting this to true will provide a slight performance boost, but will
77
+ * prevent all hit detection on the layer.
78
+ */
79
+ disableHitDetection?: boolean | undefined;
80
+ /**
81
+ * Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
82
+ */
83
+ properties?: {
84
+ [x: string]: any;
85
+ } | undefined;
86
+ };
87
+ /***
88
+ * @template T
89
+ * @typedef {T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never} ExtractedFeatureType
90
+ */
91
+ /**
92
+ * @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
93
+ * @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
94
+ * @typedef {Object} Options
95
+ * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
96
+ * @property {number} [opacity=1] Opacity (0, 1).
97
+ * @property {boolean} [visible=true] Visibility.
98
+ * @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
99
+ * rendered outside of this extent.
100
+ * FIXME: not supported yet
101
+ * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
102
+ * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
103
+ * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
104
+ * method was used.
105
+ * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be
106
+ * visible.
107
+ * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
108
+ * be visible.
109
+ * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be
110
+ * visible.
111
+ * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
112
+ * be visible.
113
+ * @property {VectorSourceType} [source] Source.
114
+ * @property {import('../style/webgl.js').WebGLStyle} style Layer style.
115
+ * @property {import('../style/flat.js').StyleVariables} [variables] Style variables. Each variable must hold a literal value (not
116
+ * an expression). These variables can be used as {@link import("../expr/expression.js").ExpressionValue expressions} in the styles properties
117
+ * using the `['var', 'varName']` operator.
118
+ * To update style variables, use the {@link import("./WebGLVector.js").default#updateStyleVariables} method.
119
+ * @property {import("./Base.js").BackgroundColor} [background] Background color for the layer. If not specified, no background
120
+ * will be rendered.
121
+ * FIXME: not supported yet
122
+ * @property {boolean} [disableHitDetection=false] Setting this to true will provide a slight performance boost, but will
123
+ * prevent all hit detection on the layer.
124
+ * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
125
+ */
126
+ /**
127
+ * @classdesc
128
+ * Layer optimized for rendering large vector datasets.
129
+ *
130
+ * **Important: a `WebGLVector` layer must be manually disposed when removed, otherwise the underlying WebGL context
131
+ * will not be garbage collected.**
132
+ *
133
+ * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}
134
+ * property on the layer object; for example, setting `title: 'My Title'` in the
135
+ * options means that `title` is observable, and has get/set accessors.
136
+ *
137
+ * @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
138
+ * @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
139
+ * @extends {Layer<VectorSourceType, WebGLVectorLayerRenderer>}
140
+ */
141
+ declare class WebGLVectorLayer<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = ExtractedFeatureType<VectorSourceType>> extends Layer<VectorSourceType, WebGLVectorLayerRenderer> {
142
+ /**
143
+ * @param {Options<VectorSourceType, FeatureType>} [options] Options.
144
+ */
145
+ constructor(options?: Options<VectorSourceType, FeatureType> | undefined);
146
+ /**
147
+ * @type {import('../style/flat.js').StyleVariables}
148
+ * @private
149
+ */
150
+ private styleVariables_;
151
+ /**
152
+ * @private
153
+ */
154
+ private style_;
155
+ /**
156
+ * @private
157
+ */
158
+ private hitDetectionDisabled_;
159
+ /**
160
+ * Update any variables used by the layer style and trigger a re-render.
161
+ * @param {import('../style/flat.js').StyleVariables} variables Variables to update.
162
+ */
163
+ updateStyleVariables(variables: import("../style/flat.js").StyleVariables): void;
164
+ /**
165
+ * Set the layer style.
166
+ * @param {import('../style/webgl.js').WebGLStyle} style Layer style.
167
+ */
168
+ setStyle(style: import("../style/webgl.js").WebGLStyle): void;
169
+ style: import("../style/webgl.js").WebGLStyle | undefined;
170
+ }
171
+ import WebGLVectorLayerRenderer from '../renderer/webgl/VectorLayer.js';
172
+ import Layer from './Layer.js';
173
+ //# sourceMappingURL=WebGLVector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGLVector.d.ts","sourceRoot":"","sources":["WebGLVector.js"],"names":[],"mappings":";;;;iCAOa,CAAC,IACD,CAAC,SAAS,OAAO,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAA6C,SAAnC,OAAO,eAAe,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK;oBAI1D,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqBpC,OAAO,mBAAmB,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5BpD;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;;;;;;;GAcG;AACH,+BAJmE,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;IAIhD;;OAEG;IACH,0EAoBC;IAfC;;;OAGG;IACH,wBAA8C;IAE9C;;OAEG;IACH,eAA2B;IAE3B;;OAEG;IACH,8BAA0D;IAc5D;;;OAGG;IACH,gCAFW,OAAO,kBAAkB,EAAE,cAAc,QAKnD;IAED;;;OAGG;IACH,gBAFW,OAAO,mBAAmB,EAAE,UAAU,QAMhD;IAHC,0DAAkB;CAIrB;qCAjHoC,kCAAkC;kBADrD,YAAY"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @module ol/layer/WebGLVector
3
+ */
4
+ import Layer from './Layer.js';
5
+ import WebGLVectorLayerRenderer from '../renderer/webgl/VectorLayer.js';
6
+
7
+ /***
8
+ * @template T
9
+ * @typedef {T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never} ExtractedFeatureType
10
+ */
11
+
12
+ /**
13
+ * @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
14
+ * @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
15
+ * @typedef {Object} Options
16
+ * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
17
+ * @property {number} [opacity=1] Opacity (0, 1).
18
+ * @property {boolean} [visible=true] Visibility.
19
+ * @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
20
+ * rendered outside of this extent.
21
+ * FIXME: not supported yet
22
+ * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
23
+ * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
24
+ * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
25
+ * method was used.
26
+ * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be
27
+ * visible.
28
+ * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
29
+ * be visible.
30
+ * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be
31
+ * visible.
32
+ * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
33
+ * be visible.
34
+ * @property {VectorSourceType} [source] Source.
35
+ * @property {import('../style/webgl.js').WebGLStyle} style Layer style.
36
+ * @property {import('../style/flat.js').StyleVariables} [variables] Style variables. Each variable must hold a literal value (not
37
+ * an expression). These variables can be used as {@link import("../expr/expression.js").ExpressionValue expressions} in the styles properties
38
+ * using the `['var', 'varName']` operator.
39
+ * To update style variables, use the {@link import("./WebGLVector.js").default#updateStyleVariables} method.
40
+ * @property {import("./Base.js").BackgroundColor} [background] Background color for the layer. If not specified, no background
41
+ * will be rendered.
42
+ * FIXME: not supported yet
43
+ * @property {boolean} [disableHitDetection=false] Setting this to true will provide a slight performance boost, but will
44
+ * prevent all hit detection on the layer.
45
+ * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
46
+ */
47
+
48
+ /**
49
+ * @classdesc
50
+ * Layer optimized for rendering large vector datasets.
51
+ *
52
+ * **Important: a `WebGLVector` layer must be manually disposed when removed, otherwise the underlying WebGL context
53
+ * will not be garbage collected.**
54
+ *
55
+ * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}
56
+ * property on the layer object; for example, setting `title: 'My Title'` in the
57
+ * options means that `title` is observable, and has get/set accessors.
58
+ *
59
+ * @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
60
+ * @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
61
+ * @extends {Layer<VectorSourceType, WebGLVectorLayerRenderer>}
62
+ */
63
+ class WebGLVectorLayer extends Layer {
64
+ /**
65
+ * @param {Options<VectorSourceType, FeatureType>} [options] Options.
66
+ */
67
+ constructor(options) {
68
+ const baseOptions = Object.assign({}, options);
69
+
70
+ super(baseOptions);
71
+
72
+ /**
73
+ * @type {import('../style/flat.js').StyleVariables}
74
+ * @private
75
+ */
76
+ this.styleVariables_ = options.variables || {};
77
+
78
+ /**
79
+ * @private
80
+ */
81
+ this.style_ = options.style;
82
+
83
+ /**
84
+ * @private
85
+ */
86
+ this.hitDetectionDisabled_ = !!options.disableHitDetection;
87
+ }
88
+
89
+ /**
90
+ * @override
91
+ */
92
+ createRenderer() {
93
+ return new WebGLVectorLayerRenderer(this, {
94
+ style: this.style_,
95
+ variables: this.styleVariables_,
96
+ disableHitDetection: this.hitDetectionDisabled_,
97
+ });
98
+ }
99
+
100
+ /**
101
+ * Update any variables used by the layer style and trigger a re-render.
102
+ * @param {import('../style/flat.js').StyleVariables} variables Variables to update.
103
+ */
104
+ updateStyleVariables(variables) {
105
+ Object.assign(this.styleVariables_, variables);
106
+ this.changed();
107
+ }
108
+
109
+ /**
110
+ * Set the layer style.
111
+ * @param {import('../style/webgl.js').WebGLStyle} style Layer style.
112
+ */
113
+ setStyle(style) {
114
+ this.style = style;
115
+ this.clearRenderer();
116
+ this.changed();
117
+ }
118
+ }
119
+
120
+ export default WebGLVectorLayer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "10.2.2-dev.1732401392689",
3
+ "version": "10.2.2-dev.1732716369676",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -159,10 +159,11 @@ export type VectorStyle = import("../../style/webgl.js").WebGLStyle | StyleShade
159
159
  declare class VectorStyleRenderer {
160
160
  /**
161
161
  * @param {VectorStyle} styleOrShaders Literal style or custom shaders
162
+ * @param {import('../../style/flat.js').StyleVariables} variables Style variables
162
163
  * @param {import('../../webgl/Helper.js').default} helper Helper
163
164
  * @param {boolean} enableHitDetection Whether to enable the hit detection (needs compatible shader)
164
165
  */
165
- constructor(styleOrShaders: VectorStyle, helper: import("../../webgl/Helper.js").default, enableHitDetection: boolean);
166
+ constructor(styleOrShaders: VectorStyle, variables: import("../../style/flat.js").StyleVariables, helper: import("../../webgl/Helper.js").default, enableHitDetection: boolean);
166
167
  /**
167
168
  * @private
168
169
  * @type {import('../../webgl/Helper.js').default}