ol 10.6.2-dev.1750922991910 → 10.6.2-dev.1751445583969

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.
@@ -1,12 +1,6 @@
1
1
  /**
2
2
  * @module ol/render/webgl/VectorStyleRenderer
3
3
  */
4
- import {buildExpression, newEvaluationContext} from '../../expr/cpu.js';
5
- import {
6
- BooleanType,
7
- computeGeometryType,
8
- newParsingContext,
9
- } from '../../expr/expression.js';
10
4
  import {
11
5
  create as createTransform,
12
6
  makeInverse as makeInverseTransform,
@@ -89,46 +83,53 @@ export const Attributes = {
89
83
  */
90
84
 
91
85
  /**
92
- * @typedef {Object} AsShaders
93
- * @property {import("./ShaderBuilder.js").ShaderBuilder} builder Shader builder with the appropriate presets.
94
- * @property {AttributeDefinitions} [attributes] Custom attributes made available in the vertex shaders.
95
- * Default shaders rely on the attributes in {@link Attributes}.
96
- * @property {UniformDefinitions} [uniforms] Additional uniforms usable in shaders.
86
+ * @typedef {import('./style.js').StyleParseResult} StyleShaders
87
+ */
88
+
89
+ /**
90
+ * @typedef {import('../../style/flat.js').FlatStyleLike} FlatStyleLike
91
+ */
92
+ /**
93
+ * @typedef {import('../../style/flat.js').FlatStyle} FlatStyle
94
+ */
95
+ /**
96
+ * @typedef {import('../../style/flat.js').Rule} FlatStyleRule
97
97
  */
98
98
 
99
99
  /**
100
- * @typedef {Object} AsRule
101
- * @property {import('../../style/flat.js').FlatStyle} style Style
102
- * @property {import("../../expr/expression.js").EncodedExpression} [filter] Filter
100
+ * @typedef {Object} SubRenderPass
101
+ * @property {string} vertexShader Vertex shader
102
+ * @property {string} fragmentShader Fragment shader
103
+ * @property {Array<import('../../webgl/Helper.js').AttributeDescription>} attributesDesc Attributes description
104
+ * @property {WebGLProgram} [program] Program; this has to be recreated if the helper is lost/changed
103
105
  */
104
106
 
105
107
  /**
106
- * @typedef {AsRule|AsShaders} VectorStyle
108
+ * @typedef {Object} RenderPass
109
+ * @property {SubRenderPass} [fillRenderPass] Fill render pass; undefined if no fill in pass
110
+ * @property {SubRenderPass} [strokeRenderPass] Stroke render pass; undefined if no stroke in pass
111
+ * @property {SubRenderPass} [symbolRenderPass] Symbol render pass; undefined if no symbol in pass
107
112
  */
108
113
 
109
114
  /**
110
115
  * @classdesc This class is responsible for:
111
- * 1. generate WebGL buffers according to a provided style, using a MixedGeometryBatch as input
116
+ * 1. generating WebGL buffers according to a provided style, using a MixedGeometryBatch as input
112
117
  * 2. rendering geometries contained in said buffers
113
118
  *
114
- * A layer renderer will typically maintain several of these in order to have several styles rendered separately.
115
- *
116
- * A VectorStyleRenderer instance can be created either from a literal style or from shaders using either
117
- * `VectorStyleRenderer.fromStyle` or `VectorStyleRenderer.fromShaders`. The shaders should not be provided explicitly
118
- * but instead as a preconfigured ShaderBuilder instance.
119
+ * A VectorStyleRenderer instance can be created either from a literal style or from shaders.
120
+ * The shaders should not be provided explicitly but instead as a preconfigured ShaderBuilder instance.
119
121
  *
120
122
  * The `generateBuffers` method returns a promise resolving to WebGL buffers that are intended to be rendered by the
121
123
  * same renderer.
122
124
  */
123
125
  class VectorStyleRenderer {
124
126
  /**
125
- * @param {VectorStyle} styleOrShaders Literal style or custom shaders
127
+ * @param {FlatStyleLike|StyleShaders|Array<StyleShaders>} styles Vector styles expressed as flat styles, flat style rules or style shaders
126
128
  * @param {import('../../style/flat.js').StyleVariables} variables Style variables
127
129
  * @param {import('../../webgl/Helper.js').default} helper Helper
128
130
  * @param {boolean} [enableHitDetection] Whether to enable the hit detection (needs compatible shader)
129
- * @param {import("../../expr/expression.js").ExpressionValue} [filter] Optional filter expression
130
131
  */
131
- constructor(styleOrShaders, variables, helper, enableHitDetection, filter) {
132
+ constructor(styles, variables, helper, enableHitDetection) {
132
133
  /**
133
134
  * @private
134
135
  * @type {import('../../webgl/Helper.js').default}
@@ -140,258 +141,173 @@ class VectorStyleRenderer {
140
141
  */
141
142
  this.hitDetectionEnabled_ = !!enableHitDetection;
142
143
 
143
- let asShaders = /** @type {AsShaders} */ (styleOrShaders);
144
- const isShaders = 'builder' in styleOrShaders;
145
- if (!isShaders) {
146
- const asRule = /** @type {AsRule} */ (styleOrShaders);
147
- const parseResult = parseLiteralStyle(
148
- asRule.style,
149
- variables,
150
- asRule.filter,
151
- );
152
- asShaders = {
153
- builder: parseResult.builder,
154
- attributes: parseResult.attributes,
155
- uniforms: parseResult.uniforms,
156
- };
157
- }
158
-
159
- /**
160
- * @private
161
- * @type {WebGLProgram}
162
- */
163
- this.fillProgram_;
164
-
165
144
  /**
145
+ * @type {Array<StyleShaders>}
166
146
  * @private
167
- * @type {WebGLProgram}
168
147
  */
169
- this.strokeProgram_;
148
+ this.styleShaders = convertStyleToShaders(styles, variables);
170
149
 
171
150
  /**
151
+ * @type {AttributeDefinitions}
172
152
  * @private
173
- * @type {WebGLProgram}
174
153
  */
175
- this.symbolProgram_;
154
+ this.customAttributes_ = {};
176
155
 
177
156
  /**
178
- * @type {boolean}
157
+ @type {UniformDefinitions}
179
158
  * @private
180
159
  */
181
- this.hasFill_ = !!asShaders.builder.getFillVertexShader();
182
- if (this.hasFill_) {
183
- /**
184
- * @private
185
- */
186
- this.fillVertexShader_ = asShaders.builder.getFillVertexShader();
187
- /**
188
- * @private
189
- */
190
- this.fillFragmentShader_ = asShaders.builder.getFillFragmentShader();
191
- }
192
-
193
- /**
194
- * @type {boolean}
195
- * @private
196
- */
197
- this.hasStroke_ = !!asShaders.builder.getStrokeVertexShader();
198
- if (this.hasStroke_) {
199
- /**
200
- * @private
201
- */
202
- this.strokeVertexShader_ = asShaders.builder.getStrokeVertexShader();
203
- /**
204
- * @private
205
- */
206
- this.strokeFragmentShader_ = asShaders.builder.getStrokeFragmentShader();
160
+ this.uniforms_ = {};
161
+
162
+ // add hit detection attribute if enabled
163
+ if (this.hitDetectionEnabled_) {
164
+ this.customAttributes_['hitColor'] = {
165
+ callback() {
166
+ return colorEncodeId(this.ref, tmpColor);
167
+ },
168
+ size: 4,
169
+ };
207
170
  }
208
171
 
209
- /**
210
- * @type {boolean}
211
- * @private
212
- */
213
- this.hasSymbol_ = !!asShaders.builder.getSymbolVertexShader();
214
- if (this.hasSymbol_) {
215
- /**
216
- * @private
217
- */
218
- this.symbolVertexShader_ = asShaders.builder.getSymbolVertexShader();
219
- /**
220
- * @private
221
- */
222
- this.symbolFragmentShader_ = asShaders.builder.getSymbolFragmentShader();
172
+ // add attributes & uniforms coming from all shaders
173
+ for (const styleShader of this.styleShaders) {
174
+ for (const attributeName in styleShader.attributes) {
175
+ if (attributeName in this.customAttributes_) {
176
+ // already defined: skip
177
+ continue;
178
+ }
179
+ this.customAttributes_[attributeName] =
180
+ styleShader.attributes[attributeName];
181
+ }
182
+ for (const uniformName in styleShader.uniforms) {
183
+ if (uniformName in this.uniforms_) {
184
+ // already defined: skip
185
+ continue;
186
+ }
187
+ this.uniforms_[uniformName] = styleShader.uniforms[uniformName];
188
+ }
223
189
  }
224
190
 
191
+ // create a render pass for each shader
225
192
  /**
226
- * @type {function(import('../../Feature.js').FeatureLike): boolean}
193
+ * @type {Array<RenderPass>}
227
194
  * @private
228
195
  */
229
- this.featureFilter_ = null;
230
- if (filter) {
231
- this.featureFilter_ = this.computeFeatureFilter(filter);
232
- }
196
+ this.renderPasses_ = this.styleShaders.map((styleShader) => {
197
+ /** @type {RenderPass} */
198
+ const renderPass = {};
199
+
200
+ const customAttributesDesc = Object.entries(this.customAttributes_).map(
201
+ ([name, value]) => {
202
+ const isUsed = name in styleShader.attributes || name === 'hitColor';
203
+ return {
204
+ name: isUsed ? `a_${name}` : null, // giving a null name means this is only used for "spacing" in between attributes
205
+ size: value.size || 1,
206
+ type: AttributeType.FLOAT,
207
+ };
208
+ },
209
+ );
233
210
 
234
- const hitDetectionAttributes = this.hitDetectionEnabled_
235
- ? {
236
- hitColor: {
237
- callback() {
238
- return colorEncodeId(this.ref, tmpColor);
211
+ // set up each subpass
212
+ if (styleShader.builder.getFillVertexShader()) {
213
+ renderPass.fillRenderPass = {
214
+ vertexShader: styleShader.builder.getFillVertexShader(),
215
+ fragmentShader: styleShader.builder.getFillFragmentShader(),
216
+ attributesDesc: [
217
+ {
218
+ name: Attributes.POSITION,
219
+ size: 2,
220
+ type: AttributeType.FLOAT,
239
221
  },
240
- size: 4,
241
- },
242
- }
243
- : {};
222
+ ...customAttributesDesc,
223
+ ],
224
+ };
225
+ }
226
+ if (styleShader.builder.getStrokeVertexShader()) {
227
+ renderPass.strokeRenderPass = {
228
+ vertexShader: styleShader.builder.getStrokeVertexShader(),
229
+ fragmentShader: styleShader.builder.getStrokeFragmentShader(),
230
+ attributesDesc: [
231
+ {
232
+ name: Attributes.SEGMENT_START,
233
+ size: 2,
234
+ type: AttributeType.FLOAT,
235
+ },
236
+ {
237
+ name: Attributes.MEASURE_START,
238
+ size: 1,
239
+ type: AttributeType.FLOAT,
240
+ },
241
+ {
242
+ name: Attributes.SEGMENT_END,
243
+ size: 2,
244
+ type: AttributeType.FLOAT,
245
+ },
246
+ {
247
+ name: Attributes.MEASURE_END,
248
+ size: 1,
249
+ type: AttributeType.FLOAT,
250
+ },
251
+ {
252
+ name: Attributes.JOIN_ANGLES,
253
+ size: 2,
254
+ type: AttributeType.FLOAT,
255
+ },
256
+ {
257
+ name: Attributes.DISTANCE,
258
+ size: 1,
259
+ type: AttributeType.FLOAT,
260
+ },
261
+ {
262
+ name: Attributes.PARAMETERS,
263
+ size: 1,
264
+ type: AttributeType.FLOAT,
265
+ },
266
+ ...customAttributesDesc,
267
+ ],
268
+ };
269
+ }
270
+ if (styleShader.builder.getSymbolVertexShader()) {
271
+ renderPass.symbolRenderPass = {
272
+ vertexShader: styleShader.builder.getSymbolVertexShader(),
273
+ fragmentShader: styleShader.builder.getSymbolFragmentShader(),
274
+ attributesDesc: [
275
+ {
276
+ name: Attributes.POSITION,
277
+ size: 2,
278
+ type: AttributeType.FLOAT,
279
+ },
280
+ {
281
+ name: Attributes.INDEX,
282
+ size: 1,
283
+ type: AttributeType.FLOAT,
284
+ },
285
+ ...customAttributesDesc,
286
+ ],
287
+ };
288
+ }
289
+ return renderPass;
290
+ });
244
291
 
245
- /**
246
- * @private
247
- */
248
- this.customAttributes_ = Object.assign(
249
- {},
250
- hitDetectionAttributes,
251
- asShaders.attributes,
252
- );
253
- /**
254
- * @private
255
- */
256
- this.uniforms_ = asShaders.uniforms;
257
-
258
- const customAttributesDesc = Object.entries(this.customAttributes_).map(
259
- ([name, value]) => ({
260
- name: `a_${name}`,
261
- size: value.size || 1,
262
- type: AttributeType.FLOAT,
263
- }),
264
- );
265
- /**
266
- * @type {Array<import('../../webgl/Helper.js').AttributeDescription>}
267
- * @private
268
- */
269
- this.polygonAttributesDesc_ = [
270
- {
271
- name: Attributes.POSITION,
272
- size: 2,
273
- type: AttributeType.FLOAT,
274
- },
275
- ...customAttributesDesc,
276
- ];
277
- /**
278
- * @type {Array<import('../../webgl/Helper.js').AttributeDescription>}
279
- * @private
280
- */
281
- this.lineStringAttributesDesc_ = [
282
- {
283
- name: Attributes.SEGMENT_START,
284
- size: 2,
285
- type: AttributeType.FLOAT,
286
- },
287
- {
288
- name: Attributes.MEASURE_START,
289
- size: 1,
290
- type: AttributeType.FLOAT,
291
- },
292
- {
293
- name: Attributes.SEGMENT_END,
294
- size: 2,
295
- type: AttributeType.FLOAT,
296
- },
297
- {
298
- name: Attributes.MEASURE_END,
299
- size: 1,
300
- type: AttributeType.FLOAT,
301
- },
302
- {
303
- name: Attributes.JOIN_ANGLES,
304
- size: 2,
305
- type: AttributeType.FLOAT,
306
- },
307
- {
308
- name: Attributes.DISTANCE,
309
- size: 1,
310
- type: AttributeType.FLOAT,
311
- },
312
- {
313
- name: Attributes.PARAMETERS,
314
- size: 1,
315
- type: AttributeType.FLOAT,
316
- },
317
- ...customAttributesDesc,
318
- ];
319
- /**
320
- * @type {Array<import('../../webgl/Helper.js').AttributeDescription>}
321
- * @private
322
- */
323
- this.pointAttributesDesc_ = [
324
- {
325
- name: Attributes.POSITION,
326
- size: 2,
327
- type: AttributeType.FLOAT,
328
- },
329
- {
330
- name: Attributes.INDEX,
331
- size: 1,
332
- type: AttributeType.FLOAT,
333
- },
334
- ...customAttributesDesc,
335
- ];
292
+ this.hasFill_ = this.renderPasses_.some((pass) => pass.fillRenderPass);
293
+ this.hasStroke_ = this.renderPasses_.some((pass) => pass.strokeRenderPass);
294
+ this.hasSymbol_ = this.renderPasses_.some((pass) => pass.symbolRenderPass);
336
295
 
296
+ // this will initialize render passes with the given helper
337
297
  this.setHelper(helper);
338
298
  }
339
299
 
340
- /**
341
- * Will apply the style filter when generating geometry batches (if it can be evaluated outside a map context)
342
- * @param {import("../../expr/expression.js").ExpressionValue} filter Style filter
343
- * @return {function(import('../../Feature.js').FeatureLike): boolean} Feature filter
344
- * @private
345
- */
346
- computeFeatureFilter(filter) {
347
- const parsingContext = newParsingContext();
348
- /**
349
- * @type {import('../../expr/cpu.js').ExpressionEvaluator}
350
- */
351
- let compiled;
352
- try {
353
- compiled = buildExpression(filter, BooleanType, parsingContext);
354
- } catch {
355
- // filter expression failed to compile for CPU: ignore it
356
- return null;
357
- }
358
-
359
- // do not apply the filter if it depends on map state (e.g. zoom level) or any variable
360
- if (parsingContext.mapState || parsingContext.variables.size > 0) {
361
- return null;
362
- }
363
-
364
- const evalContext = newEvaluationContext();
365
- return (feature) => {
366
- evalContext.properties = feature.getPropertiesInternal();
367
- if (parsingContext.featureId) {
368
- const id = feature.getId();
369
- if (id !== undefined) {
370
- evalContext.featureId = id;
371
- } else {
372
- evalContext.featureId = null;
373
- }
374
- }
375
- evalContext.geometryType = computeGeometryType(feature.getGeometry());
376
- return /** @type {boolean} */ (compiled(evalContext));
377
- };
378
- }
379
-
380
300
  /**
381
301
  * @param {import('./MixedGeometryBatch.js').default} geometryBatch Geometry batch
382
302
  * @param {import("../../transform.js").Transform} transform Transform to apply to coordinates
383
303
  * @return {Promise<WebGLBuffers|null>} A promise resolving to WebGL buffers; returns null if buffers are empty
384
304
  */
385
305
  async generateBuffers(geometryBatch, transform) {
386
- let filteredBatch = geometryBatch;
387
- if (this.featureFilter_) {
388
- filteredBatch = filteredBatch.filter(this.featureFilter_);
389
- if (filteredBatch.isEmpty()) {
390
- return null;
391
- }
306
+ if (geometryBatch.isEmpty()) {
307
+ return null;
392
308
  }
393
309
  const renderInstructions = this.generateRenderInstructions_(
394
- filteredBatch,
310
+ geometryBatch,
395
311
  transform,
396
312
  );
397
313
  const [polygonBuffers, lineStringBuffers, pointBuffers] = await Promise.all(
@@ -553,33 +469,35 @@ class VectorStyleRenderer {
553
469
  * @param {function(): void} preRenderCallback This callback will be called right before drawing, and can be used to set uniforms
554
470
  */
555
471
  render(buffers, frameState, preRenderCallback) {
556
- this.hasFill_ &&
557
- this.renderInternal_(
558
- buffers.polygonBuffers[0],
559
- buffers.polygonBuffers[1],
560
- this.fillProgram_,
561
- this.polygonAttributesDesc_,
562
- frameState,
563
- preRenderCallback,
564
- );
565
- this.hasStroke_ &&
566
- this.renderInternal_(
567
- buffers.lineStringBuffers[0],
568
- buffers.lineStringBuffers[1],
569
- this.strokeProgram_,
570
- this.lineStringAttributesDesc_,
571
- frameState,
572
- preRenderCallback,
573
- );
574
- this.hasSymbol_ &&
575
- this.renderInternal_(
576
- buffers.pointBuffers[0],
577
- buffers.pointBuffers[1],
578
- this.symbolProgram_,
579
- this.pointAttributesDesc_,
580
- frameState,
581
- preRenderCallback,
582
- );
472
+ for (const renderPass of this.renderPasses_) {
473
+ renderPass.fillRenderPass &&
474
+ this.renderInternal_(
475
+ buffers.polygonBuffers[0],
476
+ buffers.polygonBuffers[1],
477
+ renderPass.fillRenderPass.program,
478
+ renderPass.fillRenderPass.attributesDesc,
479
+ frameState,
480
+ preRenderCallback,
481
+ );
482
+ renderPass.strokeRenderPass &&
483
+ this.renderInternal_(
484
+ buffers.lineStringBuffers[0],
485
+ buffers.lineStringBuffers[1],
486
+ renderPass.strokeRenderPass.program,
487
+ renderPass.strokeRenderPass.attributesDesc,
488
+ frameState,
489
+ preRenderCallback,
490
+ );
491
+ renderPass.symbolRenderPass &&
492
+ this.renderInternal_(
493
+ buffers.pointBuffers[0],
494
+ buffers.pointBuffers[1],
495
+ renderPass.symbolRenderPass.program,
496
+ renderPass.symbolRenderPass.attributesDesc,
497
+ frameState,
498
+ preRenderCallback,
499
+ );
500
+ }
583
501
  }
584
502
 
585
503
  /**
@@ -618,23 +536,25 @@ class VectorStyleRenderer {
618
536
  setHelper(helper, buffers = null) {
619
537
  this.helper_ = helper;
620
538
 
621
- if (this.hasFill_) {
622
- this.fillProgram_ = this.helper_.getProgram(
623
- this.fillFragmentShader_,
624
- this.fillVertexShader_,
625
- );
626
- }
627
- if (this.hasStroke_) {
628
- this.strokeProgram_ = this.helper_.getProgram(
629
- this.strokeFragmentShader_,
630
- this.strokeVertexShader_,
631
- );
632
- }
633
- if (this.hasSymbol_) {
634
- this.symbolProgram_ = this.helper_.getProgram(
635
- this.symbolFragmentShader_,
636
- this.symbolVertexShader_,
637
- );
539
+ for (const renderPass of this.renderPasses_) {
540
+ if (renderPass.fillRenderPass) {
541
+ renderPass.fillRenderPass.program = this.helper_.getProgram(
542
+ renderPass.fillRenderPass.fragmentShader,
543
+ renderPass.fillRenderPass.vertexShader,
544
+ );
545
+ }
546
+ if (renderPass.strokeRenderPass) {
547
+ renderPass.strokeRenderPass.program = this.helper_.getProgram(
548
+ renderPass.strokeRenderPass.fragmentShader,
549
+ renderPass.strokeRenderPass.vertexShader,
550
+ );
551
+ }
552
+ if (renderPass.symbolRenderPass) {
553
+ renderPass.symbolRenderPass.program = this.helper_.getProgram(
554
+ renderPass.symbolRenderPass.fragmentShader,
555
+ renderPass.symbolRenderPass.vertexShader,
556
+ );
557
+ }
638
558
  }
639
559
  this.helper_.addUniforms(this.uniforms_);
640
560
 
@@ -656,3 +576,64 @@ class VectorStyleRenderer {
656
576
  }
657
577
 
658
578
  export default VectorStyleRenderer;
579
+
580
+ /**
581
+ * Breaks down a vector style into an array of prebuilt shader builders with attributes and uniforms
582
+ * @param {FlatStyleLike|StyleShaders|Array<StyleShaders>} style Vector style
583
+ * @param {import('../../style/flat.js').StyleVariables} variables Style variables
584
+ * @return {Array<StyleShaders>} Array of style shaders
585
+ */
586
+ export function convertStyleToShaders(style, variables) {
587
+ // possible cases:
588
+ // - single shader
589
+ // - multiple shaders
590
+ // - single style
591
+ // - multiple styles
592
+ // - multiple rules
593
+ const asArray = Array.isArray(style) ? style : [style];
594
+
595
+ // if array of rules: break rules into separate styles, compute "else" filters
596
+ if ('style' in asArray[0]) {
597
+ /** @type {Array<StyleShaders>} */
598
+ const shaders = [];
599
+ const rules = /** @type {Array<FlatStyleRule>} */ (asArray);
600
+ const previousFilters = [];
601
+ for (const rule of rules) {
602
+ /** @type {Array<FlatStyle>} */
603
+ const ruleStyles = Array.isArray(rule.style) ? rule.style : [rule.style];
604
+ /** @type {import("../../expr/expression.js").EncodedExpression} */
605
+ let currentFilter = rule.filter;
606
+ if (rule.else && previousFilters.length) {
607
+ currentFilter = [
608
+ 'all',
609
+ ...previousFilters.map((filter) => ['!', filter]),
610
+ ];
611
+ if (rule.filter) {
612
+ currentFilter.push(rule.filter);
613
+ }
614
+ if (currentFilter.length < 3) {
615
+ currentFilter = currentFilter[1];
616
+ }
617
+ }
618
+ if (rule.filter) {
619
+ previousFilters.push(rule.filter);
620
+ }
621
+ // parse each style and convert to shader
622
+ const styleShaders = ruleStyles.map((style) =>
623
+ parseLiteralStyle(style, variables, currentFilter),
624
+ );
625
+ shaders.push(...styleShaders);
626
+ }
627
+ return shaders;
628
+ }
629
+
630
+ // if array of shaders: return as is
631
+ if ('builder' in asArray[0]) {
632
+ return /** @type {Array<StyleShaders>} */ (asArray);
633
+ }
634
+
635
+ // array of flat styles: simply convert to shaders
636
+ return /** @type {Array<FlatStyle>} */ (asArray).map((style) =>
637
+ parseLiteralStyle(style, variables, null),
638
+ );
639
+ }
@@ -24,19 +24,6 @@ export function computeHash(input: any | string): string;
24
24
  * @return {StyleParseResult} Result containing shader params, attributes and uniforms.
25
25
  */
26
26
  export function parseLiteralStyle(style: import("../../style/flat.js").FlatStyle, variables?: import("../../style/flat.js").StyleVariables, filter?: import("../../expr/expression.js").EncodedExpression): StyleParseResult;
27
- /**
28
- * @typedef {import('./VectorStyleRenderer.js').AsShaders} StyleAsShaders
29
- */
30
- /**
31
- * @typedef {import('./VectorStyleRenderer.js').AsRule} StyleAsRule
32
- */
33
- /**
34
- * Takes in either a Flat Style or an array of shaders (used as input for the webgl vector layer classes)
35
- * and breaks it down into separate styles to be used by the VectorStyleRenderer class.
36
- * @param {import('../../style/flat.js').FlatStyleLike | Array<StyleAsShaders> | StyleAsShaders} style Flat style or shaders
37
- * @return {Array<StyleAsShaders | StyleAsRule>} Separate styles as shaders or rules with a single flat style and a filter
38
- */
39
- export function breakDownFlatStyle(style: import("../../style/flat.js").FlatStyleLike | Array<StyleAsShaders> | StyleAsShaders): Array<StyleAsShaders | StyleAsRule>;
40
27
  export type StyleParseResult = {
41
28
  /**
42
29
  * Shader builder pre-configured according to a given style
@@ -51,7 +38,5 @@ export type StyleParseResult = {
51
38
  */
52
39
  attributes: import("./VectorStyleRenderer.js").AttributeDefinitions;
53
40
  };
54
- export type StyleAsShaders = import("./VectorStyleRenderer.js").AsShaders;
55
- export type StyleAsRule = import("./VectorStyleRenderer.js").AsRule;
56
41
  import { ShaderBuilder } from './ShaderBuilder.js';
57
42
  //# sourceMappingURL=style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.js"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,mCAHW,MAAO,MAAM,GACZ,MAAM,CAOjB;AAyrBD;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AACH,yCALW,OAAO,qBAAqB,EAAE,SAAS,cACvC,OAAO,qBAAqB,EAAE,cAAc,WAC5C,OAAO,0BAA0B,EAAE,iBAAiB,GACnD,gBAAgB,CAyE3B;AAED;;GAEG;AACH;;GAEG;AAEH;;;;;GAKG;AACH,0CAHW,OAAO,qBAAqB,EAAE,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,cAAc,GACnF,KAAK,CAAC,cAAc,GAAG,WAAW,CAAC,CA2D9C;;;;;aAjKa,aAAa;;;;cACb,OAAO,0BAA0B,EAAE,kBAAkB;;;;gBACrD,OAAO,0BAA0B,EAAE,oBAAoB;;6BA0FxD,OAAO,0BAA0B,EAAE,SAAS;0BAG5C,OAAO,0BAA0B,EAAE,MAAM;8BA9yB1B,oBAAoB"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.js"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,mCAHW,MAAO,MAAM,GACZ,MAAM,CAOjB;AAyrBD;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AACH,yCALW,OAAO,qBAAqB,EAAE,SAAS,cACvC,OAAO,qBAAqB,EAAE,cAAc,WAC5C,OAAO,0BAA0B,EAAE,iBAAiB,GACnD,gBAAgB,CAyE3B;;;;;aAzFa,aAAa;;;;cACb,OAAO,0BAA0B,EAAE,kBAAkB;;;;gBACrD,OAAO,0BAA0B,EAAE,oBAAoB;;8BAjtBzC,oBAAoB"}