ol 9.2.5-dev.1718182619798 → 9.2.5-dev.1718183112915
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/color.js +2 -2
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/expr/cpu.d.ts.map +1 -1
- package/expr/cpu.js +2 -16
- package/expr/expression.d.ts +7 -14
- package/expr/expression.d.ts.map +1 -1
- package/expr/expression.js +388 -508
- package/expr/gpu.d.ts.map +1 -1
- package/expr/gpu.js +1 -14
- package/package.json +1 -1
- package/render/canvas/style.d.ts.map +1 -1
- package/render/canvas/style.js +6 -5
- package/util.js +1 -1
- package/webgl/styleparser.d.ts.map +1 -1
- package/webgl/styleparser.js +54 -66
package/expr/gpu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu.d.ts","sourceRoot":"","sources":["gpu.js"],"names":[],"mappings":"
|
|
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,MAAM,MAAM,CAAC,GACZ,MAAM,CASjB;AAED;;;;;;GAMG;AACH,mCALW,MAAM,GAAC,OAAO,aAAa,EAAE,KAAK,GAGjC,MAAM,CAYjB;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;;GAEG;AACH,yCAFY,kBAAkB,CAW7B;AAMD;;GAEG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AACH,yCANW,OAAO,iBAAiB,EAAE,iBAAiB,QAC3C,MAAM,kBACN,OAAO,iBAAiB,EAAE,cAAc,sBACxC,kBAAkB,GACjB,kBAAkB,CAU7B;AA1BD,wDAAyD;6BApD5C,OAAO,iBAAiB,EAAE,cAAc;yBAIxC,OAAO,iBAAiB,EAAE,UAAU;gCAIpC,OAAO,iBAAiB,EAAE,iBAAiB;;;;;UAK1C,MAAM;;;;UACN,MAAM;;;;wBACG,OAAO,eAAe,EAAE,WAAW;;;;;;UAK5C,MAAM;;;;UACN,MAAM;;;;;;;;;;;;;;;YAOC,MAAM,GAAE,0BAA0B;;;;;;YAClC,MAAM,GAAE,0BAA0B;;;;;;YAClC,MAAM,GAAE,MAAM;;;;;;;;;;;;;WAGrB,OAAO,mBAAmB,EAAE,UAAU;;iCAsBvC,MAAM;;;;8BAIG,kBAAkB,QAAE,cAAc,QAAE,MAAM,KAAG,MAAM;2BAhL9C,4BAA4B;+BAahD,iBAAiB"}
|
package/expr/gpu.js
CHANGED
|
@@ -6,15 +6,12 @@ import {
|
|
|
6
6
|
BooleanType,
|
|
7
7
|
CallExpression,
|
|
8
8
|
ColorType,
|
|
9
|
-
NoneType,
|
|
10
9
|
NumberArrayType,
|
|
11
10
|
NumberType,
|
|
12
11
|
Ops,
|
|
13
12
|
SizeType,
|
|
14
13
|
StringType,
|
|
15
14
|
computeGeometryType,
|
|
16
|
-
isType,
|
|
17
|
-
overlapsType,
|
|
18
15
|
parse,
|
|
19
16
|
typeName,
|
|
20
17
|
} from './expression.js';
|
|
@@ -197,17 +194,7 @@ export function buildExpression(
|
|
|
197
194
|
parsingContext,
|
|
198
195
|
compilationContext,
|
|
199
196
|
) {
|
|
200
|
-
const expression = parse(encoded,
|
|
201
|
-
if (isType(expression.type, NoneType)) {
|
|
202
|
-
throw new Error(`No matching type was found`);
|
|
203
|
-
}
|
|
204
|
-
if (!overlapsType(type, expression.type)) {
|
|
205
|
-
const expected = typeName(type);
|
|
206
|
-
const actual = typeName(expression.type);
|
|
207
|
-
throw new Error(
|
|
208
|
-
`Expected expression to be of type ${expected}, got ${actual}`,
|
|
209
|
-
);
|
|
210
|
-
}
|
|
197
|
+
const expression = parse(encoded, type, parsingContext);
|
|
211
198
|
return compile(expression, type, compilationContext);
|
|
212
199
|
}
|
|
213
200
|
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.js"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,4CAHW,MAAM,OAAO,qBAAqB,EAAE,IAAI,CAAC,GACxC,OAAO,sBAAsB,EAAE,aAAa,CAwBvD;AAED;;;;;;;GAOG;AACH,sDAHW,MAAM,OAAO,qBAAqB,EAAE,SAAS,CAAC,GAC7C,OAAO,sBAAsB,EAAE,aAAa,CA0CvD;AAED;;GAEG;AAEH;;;;GAIG;AAEH;;;;GAIG;AACH,oCAJW,MAAM,OAAO,qBAAqB,EAAE,IAAI,CAAC,WACzC,cAAc,GACb,gBAAgB,CA6D3B;AAED;;GAEG;AAEH;;;;;GAKG;AACH,sCALW,SAAS,WACT,cAAc,GACb,cAAc,CAgEzB;wBApQY,OAAO,qBAAqB,EAAE,SAAS;gCAIvC,OAAO,0BAA0B,EAAE,iBAAiB;6BAIpD,OAAO,0BAA0B,EAAE,cAAc;6BAIjD,OAAO,0BAA0B,EAAE,cAAc;gCAIjD,OAAO,mBAAmB,EAAE,iBAAiB;kCAI7C,OAAO,mBAAmB,EAAE,mBAAmB;sCA8FtC,iBAAiB,KAAE,MAAM,KAAK,CAAC;;;;;YAKvC,mBAAmB;;;;YACnB,MAAM,cAAc,CAAC;;oCAsEb,iBAAiB,KAAE,KAAK,GAAC,IAAI;mCAyE7B,iBAAiB,KAAE,IAAI,GAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.js"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,4CAHW,MAAM,OAAO,qBAAqB,EAAE,IAAI,CAAC,GACxC,OAAO,sBAAsB,EAAE,aAAa,CAwBvD;AAED;;;;;;;GAOG;AACH,sDAHW,MAAM,OAAO,qBAAqB,EAAE,SAAS,CAAC,GAC7C,OAAO,sBAAsB,EAAE,aAAa,CA0CvD;AAED;;GAEG;AAEH;;;;GAIG;AAEH;;;;GAIG;AACH,oCAJW,MAAM,OAAO,qBAAqB,EAAE,IAAI,CAAC,WACzC,cAAc,GACb,gBAAgB,CA6D3B;AAED;;GAEG;AAEH;;;;;GAKG;AACH,sCALW,SAAS,WACT,cAAc,GACb,cAAc,CAgEzB;wBApQY,OAAO,qBAAqB,EAAE,SAAS;gCAIvC,OAAO,0BAA0B,EAAE,iBAAiB;6BAIpD,OAAO,0BAA0B,EAAE,cAAc;6BAIjD,OAAO,0BAA0B,EAAE,cAAc;gCAIjD,OAAO,mBAAmB,EAAE,iBAAiB;kCAI7C,OAAO,mBAAmB,EAAE,mBAAmB;sCA8FtC,iBAAiB,KAAE,MAAM,KAAK,CAAC;;;;;YAKvC,mBAAmB;;;;YACnB,MAAM,cAAc,CAAC;;oCAsEb,iBAAiB,KAAE,KAAK,GAAC,IAAI;mCAyE7B,iBAAiB,KAAE,IAAI,GAAC,IAAI;qCAyC5B,iBAAiB,KAAE,MAAM,GAAC,IAAI;mCA2G9B,iBAAiB,KAAE,IAAI;oCAgOvB,iBAAiB,KAAE,OAAO,sBAAsB,EAAE,OAAO;kBAnpB7D,sBAAsB;iBAJvB,qBAAqB;mBAGnB,uBAAuB;iBAEzB,qBAAqB"}
|
package/render/canvas/style.js
CHANGED
|
@@ -308,6 +308,11 @@ function buildFill(flatStyle, prefix, context) {
|
|
|
308
308
|
if (prefix + 'fill-pattern-src' in flatStyle) {
|
|
309
309
|
evaluateColor = patternEvaluator(flatStyle, prefix + 'fill-', context);
|
|
310
310
|
} else {
|
|
311
|
+
if (flatStyle[prefix + 'fill-color'] === 'none') {
|
|
312
|
+
// avoids hit detection
|
|
313
|
+
return (context) => null;
|
|
314
|
+
}
|
|
315
|
+
|
|
311
316
|
evaluateColor = colorLikeEvaluator(
|
|
312
317
|
flatStyle,
|
|
313
318
|
prefix + 'fill-color',
|
|
@@ -1029,11 +1034,7 @@ function colorLikeEvaluator(flatStyle, name, context) {
|
|
|
1029
1034
|
if (!(name in flatStyle)) {
|
|
1030
1035
|
return null;
|
|
1031
1036
|
}
|
|
1032
|
-
const evaluator = buildExpression(
|
|
1033
|
-
flatStyle[name],
|
|
1034
|
-
ColorType | StringType,
|
|
1035
|
-
context,
|
|
1036
|
-
);
|
|
1037
|
+
const evaluator = buildExpression(flatStyle[name], ColorType, context);
|
|
1037
1038
|
return function (context) {
|
|
1038
1039
|
return requireColorLike(evaluator(context), name);
|
|
1039
1040
|
};
|
package/util.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleparser.d.ts","sourceRoot":"","sources":["styleparser.js"],"names":[],"mappings":"AAuBA;;;;;;;GAOG;AACH,qDALW,OAAO,gBAAgB,EAAE,kBAAkB,SAC3C,OAAO,uBAAuB,EAAE,iBAAiB,sCAEhD,MAAM,
|
|
1
|
+
{"version":3,"file":"styleparser.d.ts","sourceRoot":"","sources":["styleparser.js"],"names":[],"mappings":"AAuBA;;;;;;;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,MAAM,MAAM,CAAC,CASxB;AAqCD;;;;GAIG;AACH,mCAHW,MAAO,MAAM,GACZ,MAAM,CAOjB;AAgvBD;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,yCAHW,OAAO,mBAAmB,EAAE,UAAU,GACrC,gBAAgB,CA0I3B;;;;;aAxJa,aAAa;;;;cACb,OAAO,wCAAwC,EAAE,kBAAkB;;;;gBACnE,OAAO,wCAAwC,EAAE,oBAAoB;;8BA30BvD,oBAAoB"}
|
package/webgl/styleparser.js
CHANGED
|
@@ -31,7 +31,6 @@ import {asArray} from '../color.js';
|
|
|
31
31
|
*/
|
|
32
32
|
export function expressionToGlsl(compilationContext, value, expectedType) {
|
|
33
33
|
const parsingContext = newParsingContext();
|
|
34
|
-
parsingContext.style = compilationContext.style;
|
|
35
34
|
return buildExpression(
|
|
36
35
|
value,
|
|
37
36
|
expectedType,
|
|
@@ -917,38 +916,32 @@ export function parseLiteralStyle(style) {
|
|
|
917
916
|
}
|
|
918
917
|
|
|
919
918
|
// define one uniform per variable
|
|
920
|
-
|
|
919
|
+
for (const varName in fragContext.variables) {
|
|
921
920
|
const variable = fragContext.variables[varName];
|
|
922
921
|
const uniformName = uniformNameForVariable(variable.name);
|
|
923
922
|
builder.addUniform(`${getGlslTypeFromType(variable.type)} ${uniformName}`);
|
|
924
923
|
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
/** @type {boolean} */ (style.variables[variable.name]) ? 1.0 : 0.0;
|
|
943
|
-
} else {
|
|
944
|
-
callback = () => /** @type {number} */ (style.variables[variable.name]);
|
|
945
|
-
}
|
|
946
|
-
uniforms[uniformName] = callback;
|
|
947
|
-
});
|
|
924
|
+
uniforms[uniformName] = () => {
|
|
925
|
+
const value = style.variables[variable.name];
|
|
926
|
+
if (typeof value === 'number') {
|
|
927
|
+
return value;
|
|
928
|
+
}
|
|
929
|
+
if (typeof value === 'boolean') {
|
|
930
|
+
return value ? 1 : 0;
|
|
931
|
+
}
|
|
932
|
+
if (variable.type === ColorType) {
|
|
933
|
+
return packColor([...asArray(value || '#eee')]);
|
|
934
|
+
}
|
|
935
|
+
if (typeof value === 'string') {
|
|
936
|
+
return getStringNumberEquivalent(value);
|
|
937
|
+
}
|
|
938
|
+
return value;
|
|
939
|
+
};
|
|
940
|
+
}
|
|
948
941
|
|
|
949
942
|
// for each feature attribute used in the fragment shader, define a varying that will be used to pass data
|
|
950
943
|
// from the vertex to the fragment shader, as well as an attribute in the vertex shader (if not already present)
|
|
951
|
-
|
|
944
|
+
for (const propName in fragContext.properties) {
|
|
952
945
|
const property = fragContext.properties[propName];
|
|
953
946
|
if (!vertContext.properties[propName]) {
|
|
954
947
|
vertContext.properties[propName] = property;
|
|
@@ -961,41 +954,15 @@ export function parseLiteralStyle(style) {
|
|
|
961
954
|
builder.addVertexShaderFunction(UNPACK_COLOR_FN);
|
|
962
955
|
}
|
|
963
956
|
builder.addVarying(`v_prop_${property.name}`, type, expression);
|
|
964
|
-
}
|
|
957
|
+
}
|
|
965
958
|
|
|
966
959
|
// for each feature attribute used in the vertex shader, define an attribute in the vertex shader.
|
|
967
|
-
|
|
960
|
+
for (const propName in vertContext.properties) {
|
|
968
961
|
const property = vertContext.properties[propName];
|
|
969
962
|
builder.addAttribute(
|
|
970
963
|
`${getGlslTypeFromType(property.type)} a_prop_${property.name}`,
|
|
971
964
|
);
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
const attributes = Object.keys(vertContext.properties).map(
|
|
975
|
-
function (propName) {
|
|
976
|
-
const property = vertContext.properties[propName];
|
|
977
|
-
let callback;
|
|
978
|
-
if (property.evaluator) {
|
|
979
|
-
callback = property.evaluator;
|
|
980
|
-
} else if (property.type === StringType) {
|
|
981
|
-
callback = (feature) =>
|
|
982
|
-
getStringNumberEquivalent(feature.get(property.name));
|
|
983
|
-
} else if (property.type === ColorType) {
|
|
984
|
-
callback = (feature) =>
|
|
985
|
-
packColor([...asArray(feature.get(property.name) || '#eee')]);
|
|
986
|
-
} else if (property.type === BooleanType) {
|
|
987
|
-
callback = (feature) => (feature.get(property.name) ? 1.0 : 0.0);
|
|
988
|
-
} else {
|
|
989
|
-
callback = (feature) => feature.get(property.name);
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
return {
|
|
993
|
-
name: property.name,
|
|
994
|
-
size: getGlslSizeFromType(property.type),
|
|
995
|
-
callback,
|
|
996
|
-
};
|
|
997
|
-
},
|
|
998
|
-
);
|
|
965
|
+
}
|
|
999
966
|
|
|
1000
967
|
// add functions that were collected in the compilation contexts
|
|
1001
968
|
for (const functionName in vertContext.functions) {
|
|
@@ -1005,15 +972,36 @@ export function parseLiteralStyle(style) {
|
|
|
1005
972
|
builder.addFragmentShaderFunction(fragContext.functions[functionName]);
|
|
1006
973
|
}
|
|
1007
974
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
975
|
+
/**
|
|
976
|
+
* @type {import('../render/webgl/VectorStyleRenderer.js').AttributeDefinitions}
|
|
977
|
+
*/
|
|
978
|
+
const attributes = {};
|
|
979
|
+
for (const propName in vertContext.properties) {
|
|
980
|
+
const property = vertContext.properties[propName];
|
|
981
|
+
let callback;
|
|
982
|
+
if (property.evaluator) {
|
|
983
|
+
callback = property.evaluator;
|
|
984
|
+
} else {
|
|
985
|
+
callback = (feature) => {
|
|
986
|
+
const value = feature.get(property.name);
|
|
987
|
+
if (property.type === ColorType) {
|
|
988
|
+
return packColor([...asArray(value || '#eee')]);
|
|
989
|
+
}
|
|
990
|
+
if (typeof value === 'string') {
|
|
991
|
+
return getStringNumberEquivalent(value);
|
|
992
|
+
}
|
|
993
|
+
if (typeof value === 'boolean') {
|
|
994
|
+
return value ? 1 : 0;
|
|
995
|
+
}
|
|
996
|
+
return value;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
attributes[property.name] = {
|
|
1001
|
+
size: getGlslSizeFromType(property.type),
|
|
1002
|
+
callback,
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
return {builder, attributes, uniforms};
|
|
1019
1007
|
}
|