ol 10.0.1-dev.1722678562646 → 10.0.1-dev.1722809835779
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 +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/util.js +1 -1
- package/webgl/styleparser.d.ts.map +1 -1
- package/webgl/styleparser.js +8 -13
package/package.json
CHANGED
package/util.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleparser.d.ts","sourceRoot":"","sources":["styleparser.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styleparser.d.ts","sourceRoot":"","sources":["styleparser.js"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH,qDALW,OAAO,gBAAgB,EAAE,kBAAkB,SAC3C,OAAO,uBAAuB,EAAE,iBAAiB,sCAEhD,MAAM,CAUjB;AAED;;;;GAIG;AACH,iCAHW,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GACjC,KAAK,CAAC,MAAM,CAAC,CASxB;AAqCD;;;;GAIG;AACH,mCAHW,MAAO,MAAM,GACZ,MAAM,CAOjB;AA4uBD;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,yCAHW,OAAO,mBAAmB,EAAE,UAAU,GACrC,gBAAgB,CA0I3B;;;;;aAxJa,aAAa;;;;cACb,OAAO,wCAAwC,EAAE,kBAAkB;;;;gBACnE,OAAO,wCAAwC,EAAE,oBAAoB;;8BAt0BvD,oBAAoB"}
|
package/webgl/styleparser.js
CHANGED
|
@@ -12,14 +12,13 @@ import {
|
|
|
12
12
|
newParsingContext,
|
|
13
13
|
} from '../expr/expression.js';
|
|
14
14
|
import {ShaderBuilder} from './ShaderBuilder.js';
|
|
15
|
+
import {asArray} from '../color.js';
|
|
15
16
|
import {
|
|
16
|
-
arrayToGlsl,
|
|
17
17
|
buildExpression,
|
|
18
18
|
getStringNumberEquivalent,
|
|
19
19
|
stringToGlsl,
|
|
20
20
|
uniformNameForVariable,
|
|
21
21
|
} from '../expr/gpu.js';
|
|
22
|
-
import {asArray} from '../color.js';
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Recursively parses a style expression and outputs a GLSL-compatible string. Takes in a compilation context that
|
|
@@ -202,23 +201,19 @@ function getColorFromDistanceField(
|
|
|
202
201
|
*/
|
|
203
202
|
function parseImageProperties(style, builder, uniforms, prefix, textureId) {
|
|
204
203
|
const image = new Image();
|
|
205
|
-
let size;
|
|
206
204
|
image.crossOrigin =
|
|
207
205
|
style[`${prefix}cross-origin`] === undefined
|
|
208
206
|
? 'anonymous'
|
|
209
207
|
: style[`${prefix}cross-origin`];
|
|
210
208
|
image.src = style[`${prefix}src`];
|
|
211
209
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
builder.addUniform(`vec2 u_texture${textureId}_size`);
|
|
220
|
-
size = `u_texture${textureId}_size`;
|
|
221
|
-
}
|
|
210
|
+
// the size is provided asynchronously using a uniform
|
|
211
|
+
uniforms[`u_texture${textureId}_size`] = () => {
|
|
212
|
+
return image.complete ? [image.width, image.height] : [0, 0];
|
|
213
|
+
};
|
|
214
|
+
builder.addUniform(`vec2 u_texture${textureId}_size`);
|
|
215
|
+
const size = `u_texture${textureId}_size`;
|
|
216
|
+
|
|
222
217
|
uniforms[`u_texture${textureId}`] = image;
|
|
223
218
|
builder.addUniform(`sampler2D u_texture${textureId}`);
|
|
224
219
|
return size;
|