ol 7.3.1-dev.1681144772646 → 7.3.1-dev.1681303152721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/layer/WebGLPoints.d.ts +1 -1
- package/layer/WebGLPoints.js +2 -2
- package/package.json +1 -1
- package/render/canvas/Immediate.d.ts.map +1 -1
- package/render/canvas/Immediate.js +9 -1
- package/renderer/webgl/VectorLayer.d.ts +1 -1
- package/renderer/webgl/shaders.js +7 -7
- package/style/literal.d.ts +203 -2
- package/style/literal.d.ts.map +1 -1
- package/style/literal.js +105 -2
- package/util.js +1 -1
- package/webgl/Helper.d.ts +1 -1
- package/webgl/Helper.d.ts.map +1 -1
- package/webgl/Helper.js +5 -2
- package/webgl/ShaderBuilder.d.ts +58 -60
- package/webgl/ShaderBuilder.d.ts.map +1 -1
- package/webgl/ShaderBuilder.js +341 -227
- package/webgl/styleparser.d.ts +57 -0
- package/webgl/styleparser.d.ts.map +1 -0
- package/webgl/styleparser.js +318 -0
package/webgl/ShaderBuilder.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} StyleParseResult
|
|
3
|
-
* @property {ShaderBuilder} builder Shader builder pre-configured according to a given style
|
|
4
|
-
* @property {Object<string,import("./Helper").UniformValue>} uniforms Uniform definitions.
|
|
5
|
-
* @property {Array<import("../renderer/webgl/PointsLayer").CustomAttribute>} attributes Attribute descriptions.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Parses a {@link import("../style/literal").LiteralStyle} object and returns a {@link ShaderBuilder}
|
|
9
|
-
* object that has been configured according to the given style, as well as `attributes` and `uniforms`
|
|
10
|
-
* arrays to be fed to the `WebGLPointsRenderer` class.
|
|
11
|
-
*
|
|
12
|
-
* Also returns `uniforms` and `attributes` properties as expected by the
|
|
13
|
-
* {@link module:ol/renderer/webgl/PointsLayer~WebGLPointsLayerRenderer}.
|
|
14
|
-
*
|
|
15
|
-
* @param {import("../style/literal").LiteralStyle} style Literal style.
|
|
16
|
-
* @return {StyleParseResult} Result containing shader params, attributes and uniforms.
|
|
17
|
-
*/
|
|
18
|
-
export function parseLiteralStyle(style: import("../style/literal").LiteralStyle): StyleParseResult;
|
|
19
1
|
/**
|
|
20
2
|
* @typedef {Object} VaryingDescription
|
|
21
3
|
* @property {string} name Varying name, as will be declared in the header.
|
|
@@ -33,7 +15,7 @@ export function parseLiteralStyle(style: import("../style/literal").LiteralStyle
|
|
|
33
15
|
* .addVarying('v_width', 'float', 'a_width')
|
|
34
16
|
* .addUniform('u_time')
|
|
35
17
|
* .setColorExpression('...')
|
|
36
|
-
* .
|
|
18
|
+
* .setSymbolSizeExpression('...')
|
|
37
19
|
* .outputSymbolFragmentShader();
|
|
38
20
|
* ```
|
|
39
21
|
*/
|
|
@@ -60,22 +42,22 @@ export class ShaderBuilder {
|
|
|
60
42
|
* @type {string}
|
|
61
43
|
* @private
|
|
62
44
|
*/
|
|
63
|
-
private
|
|
45
|
+
private symbolSizeExpression;
|
|
64
46
|
/**
|
|
65
47
|
* @type {string}
|
|
66
48
|
* @private
|
|
67
49
|
*/
|
|
68
|
-
private
|
|
50
|
+
private symbolRotationExpression;
|
|
69
51
|
/**
|
|
70
52
|
* @type {string}
|
|
71
53
|
* @private
|
|
72
54
|
*/
|
|
73
|
-
private
|
|
55
|
+
private symbolOffsetExpression;
|
|
74
56
|
/**
|
|
75
57
|
* @type {string}
|
|
76
58
|
* @private
|
|
77
59
|
*/
|
|
78
|
-
private
|
|
60
|
+
private symbolColorExpression;
|
|
79
61
|
/**
|
|
80
62
|
* @type {string}
|
|
81
63
|
* @private
|
|
@@ -90,7 +72,22 @@ export class ShaderBuilder {
|
|
|
90
72
|
* @type {boolean}
|
|
91
73
|
* @private
|
|
92
74
|
*/
|
|
93
|
-
private
|
|
75
|
+
private symbolRotateWithView;
|
|
76
|
+
/**
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
private strokeWidthExpression;
|
|
81
|
+
/**
|
|
82
|
+
* @type {string}
|
|
83
|
+
* @private
|
|
84
|
+
*/
|
|
85
|
+
private strokeColorExpression;
|
|
86
|
+
/**
|
|
87
|
+
* @type {string}
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
private fillColorExpression;
|
|
94
91
|
/**
|
|
95
92
|
* Adds a uniform accessible in both fragment and vertex shaders.
|
|
96
93
|
* The given name should include a type, such as `sampler2D u_texture`.
|
|
@@ -121,7 +118,7 @@ export class ShaderBuilder {
|
|
|
121
118
|
* @param {string} expression Size expression
|
|
122
119
|
* @return {ShaderBuilder} the builder object
|
|
123
120
|
*/
|
|
124
|
-
|
|
121
|
+
setSymbolSizeExpression(expression: string): ShaderBuilder;
|
|
125
122
|
/**
|
|
126
123
|
* Sets an expression to compute the rotation of the shape.
|
|
127
124
|
* This expression can use all the uniforms and attributes available
|
|
@@ -129,7 +126,7 @@ export class ShaderBuilder {
|
|
|
129
126
|
* @param {string} expression Size expression
|
|
130
127
|
* @return {ShaderBuilder} the builder object
|
|
131
128
|
*/
|
|
132
|
-
|
|
129
|
+
setSymbolRotationExpression(expression: string): ShaderBuilder;
|
|
133
130
|
/**
|
|
134
131
|
* Sets an expression to compute the offset of the symbol from the point center.
|
|
135
132
|
* This expression can use all the uniforms and attributes available
|
|
@@ -146,7 +143,7 @@ export class ShaderBuilder {
|
|
|
146
143
|
* @param {string} expression Color expression
|
|
147
144
|
* @return {ShaderBuilder} the builder object
|
|
148
145
|
*/
|
|
149
|
-
|
|
146
|
+
setSymbolColorExpression(expression: string): ShaderBuilder;
|
|
150
147
|
/**
|
|
151
148
|
* Sets an expression to compute the texture coordinates of the vertices.
|
|
152
149
|
* This expression can use all the uniforms and attributes available
|
|
@@ -173,28 +170,14 @@ export class ShaderBuilder {
|
|
|
173
170
|
*/
|
|
174
171
|
setSymbolRotateWithView(rotateWithView: boolean): ShaderBuilder;
|
|
175
172
|
/**
|
|
176
|
-
* @
|
|
177
|
-
|
|
178
|
-
getSizeExpression(): string;
|
|
179
|
-
/**
|
|
180
|
-
* @return {string} Previously set symbol offset expression
|
|
181
|
-
*/
|
|
182
|
-
getOffsetExpression(): string;
|
|
183
|
-
/**
|
|
184
|
-
* @return {string} Previously set color expression
|
|
185
|
-
*/
|
|
186
|
-
getColorExpression(): string;
|
|
187
|
-
/**
|
|
188
|
-
* @return {string} Previously set texture coordinate expression
|
|
189
|
-
*/
|
|
190
|
-
getTextureCoordinateExpression(): string;
|
|
191
|
-
/**
|
|
192
|
-
* @return {string} Previously set fragment discard expression
|
|
173
|
+
* @param {string} expression Stroke width expression, returning value in pixels
|
|
174
|
+
* @return {ShaderBuilder} the builder object
|
|
193
175
|
*/
|
|
194
|
-
|
|
176
|
+
setStrokeWidthExpression(expression: string): ShaderBuilder;
|
|
177
|
+
setStrokeColorExpression(expression: any): ShaderBuilder;
|
|
178
|
+
setFillColorExpression(expression: any): ShaderBuilder;
|
|
195
179
|
/**
|
|
196
|
-
* Generates a symbol vertex shader from the builder parameters
|
|
197
|
-
* intended to be used on point geometries.
|
|
180
|
+
* Generates a symbol vertex shader from the builder parameters
|
|
198
181
|
*
|
|
199
182
|
* Four uniforms are hardcoded in all shaders: `u_projectionMatrix`, `u_offsetScaleMatrix`,
|
|
200
183
|
* `u_offsetRotateMatrix`, `u_time`.
|
|
@@ -211,8 +194,7 @@ export class ShaderBuilder {
|
|
|
211
194
|
*/
|
|
212
195
|
getSymbolVertexShader(forHitDetection?: boolean | undefined): string;
|
|
213
196
|
/**
|
|
214
|
-
* Generates a symbol fragment shader from the builder parameters
|
|
215
|
-
* intended to be used on point geometries.
|
|
197
|
+
* Generates a symbol fragment shader from the builder parameters
|
|
216
198
|
*
|
|
217
199
|
* Expects the following varyings to be transmitted by the vertex shader:
|
|
218
200
|
* `vec2 v_quadCoord`, `vec2 v_texCoord`
|
|
@@ -222,23 +204,39 @@ export class ShaderBuilder {
|
|
|
222
204
|
* @return {string} The full shader as a string.
|
|
223
205
|
*/
|
|
224
206
|
getSymbolFragmentShader(forHitDetection?: boolean | undefined): string;
|
|
225
|
-
}
|
|
226
|
-
export type StyleParseResult = {
|
|
227
207
|
/**
|
|
228
|
-
*
|
|
208
|
+
* Generates a stroke vertex shader from the builder parameters
|
|
209
|
+
*
|
|
210
|
+
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
|
|
211
|
+
* (namely, hit color with encoded feature id).
|
|
212
|
+
* @return {string} The full shader as a string.
|
|
213
|
+
*/
|
|
214
|
+
getStrokeVertexShader(forHitDetection?: boolean | undefined): string;
|
|
215
|
+
/**
|
|
216
|
+
* Generates a stroke fragment shader from the builder parameters
|
|
217
|
+
*
|
|
218
|
+
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
|
|
219
|
+
* (namely, hit color with encoded feature id).
|
|
220
|
+
* @return {string} The full shader as a string.
|
|
229
221
|
*/
|
|
230
|
-
|
|
222
|
+
getStrokeFragmentShader(forHitDetection?: boolean | undefined): string;
|
|
231
223
|
/**
|
|
232
|
-
*
|
|
224
|
+
* Generates a fill vertex shader from the builder parameters
|
|
225
|
+
*
|
|
226
|
+
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
|
|
227
|
+
* (namely, hit color with encoded feature id).
|
|
228
|
+
* @return {string} The full shader as a string.
|
|
233
229
|
*/
|
|
234
|
-
|
|
235
|
-
[x: string]: import("./Helper").UniformValue;
|
|
236
|
-
};
|
|
230
|
+
getFillVertexShader(forHitDetection?: boolean | undefined): string;
|
|
237
231
|
/**
|
|
238
|
-
*
|
|
232
|
+
* Generates a fill fragment shader from the builder parameters
|
|
233
|
+
*
|
|
234
|
+
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
|
|
235
|
+
* (namely, hit color with encoded feature id).
|
|
236
|
+
* @return {string} The full shader as a string.
|
|
239
237
|
*/
|
|
240
|
-
|
|
241
|
-
}
|
|
238
|
+
getFillFragmentShader(forHitDetection?: boolean | undefined): string;
|
|
239
|
+
}
|
|
242
240
|
export type VaryingDescription = {
|
|
243
241
|
/**
|
|
244
242
|
* Varying name, as will be declared in the header.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShaderBuilder.d.ts","sourceRoot":"","sources":["ShaderBuilder.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShaderBuilder.d.ts","sourceRoot":"","sources":["ShaderBuilder.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH;IAEI;;;;OAIG;IACH,iBAAkB;IAElB;;;;OAIG;IACH,mBAAoB;IAEpB;;;;OAIG;IACH,iBAAkB;IAElB;;;OAGG;IACH,6BAAuC;IAEvC;;;OAGG;IACH,iCAAqC;IAErC;;;OAGG;IACH,+BAAyC;IAEzC;;;OAGG;IACH,8BAAwC;IAExC;;;OAGG;IACH,2BAAoD;IAEpD;;;OAGG;IACH,0BAAgC;IAEhC;;;OAGG;IACH,6BAAiC;IAEjC;;;OAGG;IACH,8BAAkC;IAElC;;;OAGG;IACH,8BAAwC;IAExC;;;OAGG;IACH,4BAAsC;IAGxC;;;;;OAKG;IACH,iBAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;OAKG;IACH,mBAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;;OAOG;IACH,iBALW,MAAM,QACN,OAAO,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,cAC5B,MAAM,GACL,aAAa,CASxB;IAED;;;;;;OAMG;IACH,oCAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;OAMG;IACH,wCAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;;OAOG;IACH,sCAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;OAMG;IACH,qCAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;OAMG;IACH,2CAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;;;;OAQG;IACH,yCAHW,MAAM,GACL,aAAa,CAKxB;IAED;;;;;OAKG;IACH,wCAHW,OAAO,GACN,aAAa,CAKxB;IAED;;;OAGG;IACH,qCAHW,MAAM,GACL,aAAa,CAKxB;IAED,yDAGC;IAED,uDAGC;IAED;;;;;;;;;;;;;;;OAeG;IACH,8DAFY,MAAM,CAgFjB;IAED;;;;;;;;;OASG;IACH,gEAFY,MAAM,CAuCjB;IAED;;;;;;OAMG;IACH,8DAFY,MAAM,CA6FjB;IAED;;;;;;OAMG;IACH,gEAFY,MAAM,CAwEjB;IAED;;;;;;OAMG;IACH,4DAFY,MAAM,CA8CjB;IAED;;;;;;OAMG;IACH,8DAFY,MAAM,CAyDjB;CACF;;;;;UAhrBa,MAAM;;;;UACN,MAAM;;;;;gBACN,MAAM"}
|