ol 9.2.2-dev.1716041028869 → 9.2.2
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.d.ts +0 -4
- package/dist/ol.d.ts.map +1 -1
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/expr/expression.d.ts +0 -1
- package/expr/expression.d.ts.map +1 -1
- package/expr/expression.js +5 -14
- package/expr/gpu.d.ts +0 -6
- package/expr/gpu.d.ts.map +1 -1
- package/expr/gpu.js +0 -18
- package/package.json +1 -1
- package/util.d.ts.map +1 -1
- package/util.js +1 -1
- package/webgl/styleparser.d.ts.map +1 -1
- package/webgl/styleparser.js +13 -6
package/expr/expression.d.ts
CHANGED
|
@@ -59,7 +59,6 @@ export const NumberType: number;
|
|
|
59
59
|
export const StringType: number;
|
|
60
60
|
export const ColorType: number;
|
|
61
61
|
export const NumberArrayType: number;
|
|
62
|
-
export const SizeType: number;
|
|
63
62
|
export const AnyType: number;
|
|
64
63
|
/**
|
|
65
64
|
* @typedef {boolean|number|string|Array<number>} LiteralValue
|
package/expr/expression.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["expression.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["expression.js"],"names":[],"mappings":"AAoJA;;;;GAIG;AACH,+BAHW,MAAM,GACL,MAAM,CAgBjB;AAED;;;;GAIG;AACH,oCAJW,MAAM,YACN,MAAM,GACL,OAAO,CAIlB;AAED;;;;GAIG;AACH,sCAJW,MAAM,aACN,MAAM,GACL,OAAO,CAIlB;AAED;;;;GAIG;AACH,6BAJW,MAAM,YACN,MAAM,GACL,OAAO,CAIlB;AA8BD;;GAEG;AAEH;;;;;;;GAOG;AAEH;;GAEG;AACH,qCAFY,cAAc,CAUzB;AAuBD;;GAEG;AAEH;;;;;GAKG;AACH,+BALW,iBAAiB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js
CHANGED
|
@@ -134,7 +134,6 @@ export const NumberType = 1 << numTypes++;
|
|
|
134
134
|
export const StringType = 1 << numTypes++;
|
|
135
135
|
export const ColorType = 1 << numTypes++;
|
|
136
136
|
export const NumberArrayType = 1 << numTypes++;
|
|
137
|
-
export const SizeType = 1 << numTypes++;
|
|
138
137
|
export const AnyType = Math.pow(2, numTypes) - 1;
|
|
139
138
|
|
|
140
139
|
const typeNames = {
|
|
@@ -143,7 +142,6 @@ const typeNames = {
|
|
|
143
142
|
[StringType]: 'string',
|
|
144
143
|
[ColorType]: 'color',
|
|
145
144
|
[NumberArrayType]: 'number[]',
|
|
146
|
-
[SizeType]: 'size',
|
|
147
145
|
};
|
|
148
146
|
|
|
149
147
|
const namedTypes = Object.keys(typeNames).map(Number).sort(ascending);
|
|
@@ -287,10 +285,7 @@ export function parse(encoded, context, typeHint) {
|
|
|
287
285
|
return new LiteralExpression(BooleanType, encoded);
|
|
288
286
|
}
|
|
289
287
|
case 'number': {
|
|
290
|
-
return new LiteralExpression(
|
|
291
|
-
typeHint === SizeType ? SizeType : NumberType,
|
|
292
|
-
encoded,
|
|
293
|
-
);
|
|
288
|
+
return new LiteralExpression(NumberType, encoded);
|
|
294
289
|
}
|
|
295
290
|
case 'string': {
|
|
296
291
|
let type = StringType;
|
|
@@ -327,9 +322,7 @@ export function parse(encoded, context, typeHint) {
|
|
|
327
322
|
}
|
|
328
323
|
|
|
329
324
|
let type = NumberArrayType;
|
|
330
|
-
if (encoded.length ===
|
|
331
|
-
type |= SizeType;
|
|
332
|
-
} else if (encoded.length === 3 || encoded.length === 4) {
|
|
325
|
+
if (encoded.length === 3 || encoded.length === 4) {
|
|
333
326
|
type |= ColorType;
|
|
334
327
|
}
|
|
335
328
|
if (typeHint) {
|
|
@@ -629,11 +622,9 @@ const parsers = {
|
|
|
629
622
|
),
|
|
630
623
|
[Ops.Array]: createParser(
|
|
631
624
|
(parsedArgs) => {
|
|
632
|
-
return parsedArgs.length ===
|
|
633
|
-
? NumberArrayType |
|
|
634
|
-
:
|
|
635
|
-
? NumberArrayType | ColorType
|
|
636
|
-
: NumberArrayType;
|
|
625
|
+
return parsedArgs.length === 3 || parsedArgs.length === 4
|
|
626
|
+
? NumberArrayType | ColorType
|
|
627
|
+
: NumberArrayType;
|
|
637
628
|
},
|
|
638
629
|
withArgsCount(1, Infinity),
|
|
639
630
|
parseArgsOfType(NumberType),
|
package/expr/gpu.d.ts
CHANGED
|
@@ -18,12 +18,6 @@ export function arrayToGlsl(array: Array<number>): string;
|
|
|
18
18
|
* @return {string} The color expressed in the `vec4(1.0, 1.0, 1.0, 1.0)` form.
|
|
19
19
|
*/
|
|
20
20
|
export function colorToGlsl(color: string | import("../color.js").Color): string;
|
|
21
|
-
/**
|
|
22
|
-
* Normalizes and converts a number or array toa `vec2` array compatible with GLSL.
|
|
23
|
-
* @param {number|import('../size.js').Size} size Size.
|
|
24
|
-
* @return {string} The color expressed in the `vec4(1.0, 1.0, 1.0, 1.0)` form.
|
|
25
|
-
*/
|
|
26
|
-
export function sizeToGlsl(size: number | import('../size.js').Size): string;
|
|
27
21
|
/**
|
|
28
22
|
* Returns a stable equivalent number for the string literal.
|
|
29
23
|
* @param {string} string String literal value
|
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":"AA+BA;;;;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;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,CAoB7B;AApCD,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;2BAvK9C,4BAA4B;+BAehD,iBAAiB"}
|
package/expr/gpu.js
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
NumberArrayType,
|
|
11
11
|
NumberType,
|
|
12
12
|
Ops,
|
|
13
|
-
SizeType,
|
|
14
13
|
StringType,
|
|
15
14
|
computeGeometryType,
|
|
16
15
|
isType,
|
|
@@ -20,7 +19,6 @@ import {
|
|
|
20
19
|
} from './expression.js';
|
|
21
20
|
import {Uniforms} from '../renderer/webgl/TileLayer.js';
|
|
22
21
|
import {asArray} from '../color.js';
|
|
23
|
-
import {toSize} from '../size.js';
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* @param {string} operator Operator
|
|
@@ -74,16 +72,6 @@ export function colorToGlsl(color) {
|
|
|
74
72
|
]);
|
|
75
73
|
}
|
|
76
74
|
|
|
77
|
-
/**
|
|
78
|
-
* Normalizes and converts a number or array toa `vec2` array compatible with GLSL.
|
|
79
|
-
* @param {number|import('../size.js').Size} size Size.
|
|
80
|
-
* @return {string} The color expressed in the `vec4(1.0, 1.0, 1.0, 1.0)` form.
|
|
81
|
-
*/
|
|
82
|
-
export function sizeToGlsl(size) {
|
|
83
|
-
const array = toSize(size);
|
|
84
|
-
return arrayToGlsl(array);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
75
|
/** @type {Object<string, number>} */
|
|
88
76
|
const stringToFloatMap = {};
|
|
89
77
|
let stringToFloatCounter = 0;
|
|
@@ -497,12 +485,6 @@ function compile(expression, returnType, context) {
|
|
|
497
485
|
return arrayToGlsl(/** @type {Array<number>} */ (expression.value));
|
|
498
486
|
}
|
|
499
487
|
|
|
500
|
-
if ((expression.type & SizeType) > 0) {
|
|
501
|
-
return sizeToGlsl(
|
|
502
|
-
/** @type {number|import('../size.js').Size} */ (expression.value),
|
|
503
|
-
);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
488
|
throw new Error(
|
|
507
489
|
`Unexpected expression ${expression.value} (expected type ${typeName(
|
|
508
490
|
returnType,
|
package/package.json
CHANGED
package/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,4BAFY,KAAK,CAIhB;AASD;;;;;;;;GAQG;AACH,kCAHY,MAAM,CAKjB;AAED;;;GAGG;AACH,sBAFU,MAAM,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,4BAFY,KAAK,CAIhB;AASD;;;;;;;;GAQG;AACH,kCAHY,MAAM,CAKjB;AAED;;;GAGG;AACH,sBAFU,MAAM,CAEe"}
|
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,CAWjB;AAED;;;;GAIG;AACH,iCAHW,OAAO,aAAa,EAAE,KAAK,GAAC,MAAM,GACjC,MAAM,MAAM,CAAC,CASxB;AAqCD;;;;GAIG;AACH,mCAHW,MAAO,MAAM,GACZ,MAAM,CAOjB;AAwvBD;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,yCAHW,OAAO,mBAAmB,EAAE,UAAU,GACrC,gBAAgB,CAqJ3B;;;;;aAnKa,aAAa;;;;cACb,OAAO,wCAAwC,EAAE,kBAAkB;;;;gBACnE,OAAO,wCAAwC,EAAE,oBAAoB;;8BAp1BvD,oBAAoB"}
|
package/webgl/styleparser.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
ColorType,
|
|
8
8
|
NumberArrayType,
|
|
9
9
|
NumberType,
|
|
10
|
-
SizeType,
|
|
11
10
|
StringType,
|
|
12
11
|
newParsingContext,
|
|
13
12
|
} from '../expr/expression.js';
|
|
@@ -68,7 +67,7 @@ const UNPACK_COLOR_FN = `vec4 unpackColor(vec2 packedColor) {
|
|
|
68
67
|
* @return {1|2|3|4} The amount of components for this value
|
|
69
68
|
*/
|
|
70
69
|
function getGlslSizeFromType(type) {
|
|
71
|
-
if (type === ColorType
|
|
70
|
+
if (type === ColorType) {
|
|
72
71
|
return 2;
|
|
73
72
|
}
|
|
74
73
|
if (type === NumberArrayType) {
|
|
@@ -135,7 +134,7 @@ function parseCommonSymbolProperties(style, builder, vertContext, prefix) {
|
|
|
135
134
|
const scale = expressionToGlsl(
|
|
136
135
|
vertContext,
|
|
137
136
|
style[`${prefix}scale`],
|
|
138
|
-
|
|
137
|
+
NumberType | NumberArrayType,
|
|
139
138
|
);
|
|
140
139
|
builder.setSymbolSizeExpression(
|
|
141
140
|
`${builder.getSymbolSizeExpression()} * ${scale}`,
|
|
@@ -302,7 +301,7 @@ function parseCircleProperties(
|
|
|
302
301
|
const scale = expressionToGlsl(
|
|
303
302
|
fragContext,
|
|
304
303
|
style['circle-scale'],
|
|
305
|
-
|
|
304
|
+
NumberType | NumberArrayType,
|
|
306
305
|
);
|
|
307
306
|
currentPoint = `coordsPx / ${scale}`;
|
|
308
307
|
}
|
|
@@ -421,7 +420,11 @@ function parseShapeProperties(
|
|
|
421
420
|
// SCALE
|
|
422
421
|
let currentPoint = 'coordsPx';
|
|
423
422
|
if ('shape-scale' in style) {
|
|
424
|
-
const scale = expressionToGlsl(
|
|
423
|
+
const scale = expressionToGlsl(
|
|
424
|
+
fragContext,
|
|
425
|
+
style['shape-scale'],
|
|
426
|
+
NumberType | NumberArrayType,
|
|
427
|
+
);
|
|
425
428
|
currentPoint = `coordsPx / ${scale}`;
|
|
426
429
|
}
|
|
427
430
|
|
|
@@ -581,7 +584,11 @@ function parseIconProperties(
|
|
|
581
584
|
);
|
|
582
585
|
let scale = `1.0`;
|
|
583
586
|
if (`icon-scale` in style) {
|
|
584
|
-
scale = expressionToGlsl(
|
|
587
|
+
scale = expressionToGlsl(
|
|
588
|
+
vertContext,
|
|
589
|
+
style[`icon-scale`],
|
|
590
|
+
NumberType | NumberArrayType,
|
|
591
|
+
);
|
|
585
592
|
}
|
|
586
593
|
let shiftPx;
|
|
587
594
|
if (
|