ol 9.2.4-dev.1716829795912 → 9.2.4
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/expr/cpu.js +1 -10
- package/expr/expression.d.ts +3 -3
- package/expr/expression.d.ts.map +1 -1
- package/expr/expression.js +50 -26
- package/interaction/Snap.d.ts +1 -1
- package/interaction/Snap.js +1 -1
- package/package.json +1 -1
- package/source/Google.d.ts +0 -10
- package/source/Google.d.ts.map +1 -1
- package/source/Google.js +0 -5
- package/util.d.ts.map +1 -1
- package/util.js +1 -1
package/expr/cpu.js
CHANGED
|
@@ -256,16 +256,7 @@ function compileAccessorExpression(expression, context) {
|
|
|
256
256
|
const name = /** @type {string} */ (nameExpression.value);
|
|
257
257
|
switch (expression.operator) {
|
|
258
258
|
case Ops.Get: {
|
|
259
|
-
return (context) =>
|
|
260
|
-
const args = expression.args;
|
|
261
|
-
let value = context.properties[name];
|
|
262
|
-
for (let i = 1, ii = args.length; i < ii; ++i) {
|
|
263
|
-
const keyExpression = /** @type {LiteralExpression} */ (args[i]);
|
|
264
|
-
const key = /** @type {string|number} */ (keyExpression.value);
|
|
265
|
-
value = value[key];
|
|
266
|
-
}
|
|
267
|
-
return value;
|
|
268
|
-
};
|
|
259
|
+
return (context) => context.properties[name];
|
|
269
260
|
}
|
|
270
261
|
case Ops.Var: {
|
|
271
262
|
return (context) => context.variables[name];
|
package/expr/expression.d.ts
CHANGED
|
@@ -135,9 +135,9 @@ export type ArgValidator = (arg0: Array<EncodedExpression>, arg1: ParsingContext
|
|
|
135
135
|
* of bands, depending on the underlying data source and
|
|
136
136
|
* {@link import ("../source/GeoTIFF.js").Options configuration}. `xOffset` and `yOffset` are optional
|
|
137
137
|
* and allow specifying pixel offsets for x and y. This is used for sampling data from neighboring pixels (WebGL only).
|
|
138
|
-
* * `['get', attributeName]` fetches a feature property value, similar to `feature.get('attributeName')
|
|
139
|
-
*
|
|
140
|
-
*
|
|
138
|
+
* * `['get', 'attributeName', typeHint]` fetches a feature property value, similar to `feature.get('attributeName')`
|
|
139
|
+
* A type hint can optionally be specified, in case the resulting expression contains a type ambiguity which
|
|
140
|
+
* will make it invalid. Type hints can be one of: 'string', 'color', 'number', 'boolean', 'number[]'
|
|
141
141
|
* * `['geometry-type']` returns a feature's geometry type as string, either: 'LineString', 'Point' or 'Polygon'
|
|
142
142
|
* `Multi*` values are returned as their singular equivalent
|
|
143
143
|
* `Circle` geometries are returned as 'Polygon'
|
package/expr/expression.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["expression.js"],"names":[],"mappings":"AAsJA;;;;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;
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["expression.js"],"names":[],"mappings":"AAsJA;;;;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,WACjB,cAAc,kCAEb,UAAU,CAyDrB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 +25,9 @@ import {isStringColor} from '../color.js';
|
|
|
25
25
|
* of bands, depending on the underlying data source and
|
|
26
26
|
* {@link import("../source/GeoTIFF.js").Options configuration}. `xOffset` and `yOffset` are optional
|
|
27
27
|
* and allow specifying pixel offsets for x and y. This is used for sampling data from neighboring pixels (WebGL only).
|
|
28
|
-
* * `['get', attributeName]` fetches a feature property value, similar to `feature.get('attributeName')
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* * `['get', 'attributeName', typeHint]` fetches a feature property value, similar to `feature.get('attributeName')`
|
|
29
|
+
* A type hint can optionally be specified, in case the resulting expression contains a type ambiguity which
|
|
30
|
+
* will make it invalid. Type hints can be one of: 'string', 'color', 'number', 'boolean', 'number[]'
|
|
31
31
|
* * `['geometry-type']` returns a feature's geometry type as string, either: 'LineString', 'Point' or 'Polygon'
|
|
32
32
|
* `Multi*` values are returned as their singular equivalent
|
|
33
33
|
* `Circle` geometries are returned as 'Polygon'
|
|
@@ -250,6 +250,27 @@ export function newParsingContext() {
|
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
/**
|
|
254
|
+
* @param {string} typeHint Type hint
|
|
255
|
+
* @return {number} Resulting value type (will be a single type)
|
|
256
|
+
*/
|
|
257
|
+
function getTypeFromHint(typeHint) {
|
|
258
|
+
switch (typeHint) {
|
|
259
|
+
case 'string':
|
|
260
|
+
return StringType;
|
|
261
|
+
case 'color':
|
|
262
|
+
return ColorType;
|
|
263
|
+
case 'number':
|
|
264
|
+
return NumberType;
|
|
265
|
+
case 'boolean':
|
|
266
|
+
return BooleanType;
|
|
267
|
+
case 'number[]':
|
|
268
|
+
return NumberArrayType;
|
|
269
|
+
default:
|
|
270
|
+
throw new Error(`Unrecognized type hint: ${typeHint}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
253
274
|
/**
|
|
254
275
|
* @typedef {LiteralValue|Array} EncodedExpression
|
|
255
276
|
*/
|
|
@@ -377,7 +398,20 @@ export const Ops = {
|
|
|
377
398
|
* @type {Object<string, Parser>}
|
|
378
399
|
*/
|
|
379
400
|
const parsers = {
|
|
380
|
-
[Ops.Get]: createParser(
|
|
401
|
+
[Ops.Get]: createParser(
|
|
402
|
+
([_, typeHint]) => {
|
|
403
|
+
if (typeHint !== undefined) {
|
|
404
|
+
return getTypeFromHint(
|
|
405
|
+
/** @type {string} */ (
|
|
406
|
+
/** @type {LiteralExpression} */ (typeHint).value
|
|
407
|
+
),
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
return AnyType;
|
|
411
|
+
},
|
|
412
|
+
withArgsCount(1, 2),
|
|
413
|
+
withGetArgs,
|
|
414
|
+
),
|
|
381
415
|
[Ops.Var]: createParser(
|
|
382
416
|
([firstArg]) => firstArg.type,
|
|
383
417
|
withArgsCount(1, 1),
|
|
@@ -634,29 +668,19 @@ const parsers = {
|
|
|
634
668
|
* @type ArgValidator
|
|
635
669
|
*/
|
|
636
670
|
function withGetArgs(encoded, context) {
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
args.push(arg);
|
|
641
|
-
if (!(arg instanceof LiteralExpression)) {
|
|
642
|
-
throw new Error('Expected a literal argument for get operation');
|
|
643
|
-
}
|
|
644
|
-
if (i > 1) {
|
|
645
|
-
if (typeof arg.value !== 'string' && typeof arg.value !== 'number') {
|
|
646
|
-
throw new Error(
|
|
647
|
-
'Expected key or array index of a get operation to be a string or number',
|
|
648
|
-
);
|
|
649
|
-
}
|
|
650
|
-
continue;
|
|
651
|
-
}
|
|
652
|
-
if (typeof arg.value !== 'string') {
|
|
653
|
-
throw new Error(
|
|
654
|
-
'Expected the attribute name of a get operation to be a string',
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
context.properties.add(String(arg.value));
|
|
671
|
+
const arg = parse(encoded[1], context);
|
|
672
|
+
if (!(arg instanceof LiteralExpression)) {
|
|
673
|
+
throw new Error('Expected a literal argument for get operation');
|
|
658
674
|
}
|
|
659
|
-
|
|
675
|
+
if (typeof arg.value !== 'string') {
|
|
676
|
+
throw new Error('Expected a string argument for get operation');
|
|
677
|
+
}
|
|
678
|
+
context.properties.add(arg.value);
|
|
679
|
+
if (encoded.length === 3) {
|
|
680
|
+
const hint = parse(encoded[2], context);
|
|
681
|
+
return [arg, hint];
|
|
682
|
+
}
|
|
683
|
+
return [arg];
|
|
660
684
|
}
|
|
661
685
|
|
|
662
686
|
/**
|
package/interaction/Snap.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export type SnapOnSignature<Return> = import("../Observable").OnSignature<import
|
|
|
72
72
|
* as it is added before.
|
|
73
73
|
*
|
|
74
74
|
* The snap interaction modifies map browser event `coordinate` and `pixel`
|
|
75
|
-
* properties to force the snap to occur to any interaction that
|
|
75
|
+
* properties to force the snap to occur to any interaction that them.
|
|
76
76
|
*
|
|
77
77
|
* Example:
|
|
78
78
|
*
|
package/interaction/Snap.js
CHANGED
|
@@ -92,7 +92,7 @@ const tempSegment = [];
|
|
|
92
92
|
* as it is added before.
|
|
93
93
|
*
|
|
94
94
|
* The snap interaction modifies map browser event `coordinate` and `pixel`
|
|
95
|
-
* properties to force the snap to occur to any interaction that
|
|
95
|
+
* properties to force the snap to occur to any interaction that them.
|
|
96
96
|
*
|
|
97
97
|
* Example:
|
|
98
98
|
*
|
package/package.json
CHANGED
package/source/Google.d.ts
CHANGED
|
@@ -67,10 +67,6 @@ export type Options = {
|
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
tileLoadFunction?: import("../Tile.js").LoadFunction | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* An array of values specifying additional options to apply.
|
|
72
|
-
*/
|
|
73
|
-
apiOptions?: string[] | undefined;
|
|
74
70
|
/**
|
|
75
71
|
* Wrap the world horizontally.
|
|
76
72
|
*/
|
|
@@ -123,10 +119,6 @@ export type SessionTokenRequest = {
|
|
|
123
119
|
* The styles.
|
|
124
120
|
*/
|
|
125
121
|
styles?: any[] | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* An array of values specifying additional options to apply.
|
|
128
|
-
*/
|
|
129
|
-
apiOptions?: string[] | undefined;
|
|
130
122
|
};
|
|
131
123
|
export type SessionTokenResponse = {
|
|
132
124
|
/**
|
|
@@ -174,7 +166,6 @@ export type SessionTokenResponse = {
|
|
|
174
166
|
* imageTile.getImage().src = src;
|
|
175
167
|
* };
|
|
176
168
|
* ```
|
|
177
|
-
* @property {Array<string>} [apiOptions] An array of values specifying additional options to apply.
|
|
178
169
|
* @property {boolean} [wrapX=true] Wrap the world horizontally.
|
|
179
170
|
* @property {number} [transition] Duration of the opacity transition for rendering.
|
|
180
171
|
* To disable the opacity transition, pass `transition: 0`.
|
|
@@ -193,7 +184,6 @@ export type SessionTokenResponse = {
|
|
|
193
184
|
* @property {Array<string>} [layerTypes] The layer types.
|
|
194
185
|
* @property {boolean} [overlay] The overlay.
|
|
195
186
|
* @property {Array<Object>} [styles] The styles.
|
|
196
|
-
* @property {Array<string>} [apiOptions] An array of values specifying additional options to apply.
|
|
197
187
|
*/
|
|
198
188
|
/**
|
|
199
189
|
* @typedef {Object} SessionTokenResponse
|
package/source/Google.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Google.d.ts","sourceRoot":"","sources":["Google.js"],"names":[],"mappings":";;;;;SAiBc,MAAM
|
|
1
|
+
{"version":3,"file":"Google.d.ts","sourceRoot":"","sources":["Google.js"],"names":[],"mappings":";;;;;SAiBc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAgCN,MAAM;;;;cACN,MAAM;;;;YACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAWN,MAAM;;;;YACN,MAAM;;;;eACN,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;AAnDpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA2FjB;IArEC;;;OAGG;IACH,gBAA0B;IAE1B;;OAEG;IACH,QAFU,KAAK,GAAC,IAAI,CAEF;IA6BlB;;;OAGG;IACH,6BAA+C;IAE/C;;;OAGG;IACH,2BAAuB;IAEvB;;;OAGG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,qCAAiC;IAEjC;;;OAGG;IACH,gCAA4B;IAK9B;;;;;;;;;;;OAWG;IACH,YAXY,KAAK,GAAC,IAAI,CAarB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,WAAW,GACV,QAAQ,QAAQ,CAAC,CAI5B;IAED;;;OAGG;IACH,uBAyDC;IAED;;;;OAIG;IACH,2BAmCC;CAMF;sBA/SqB,gBAAgB"}
|
package/source/Google.js
CHANGED
|
@@ -37,7 +37,6 @@ const maxZoom = 22;
|
|
|
37
37
|
* imageTile.getImage().src = src;
|
|
38
38
|
* };
|
|
39
39
|
* ```
|
|
40
|
-
* @property {Array<string>} [apiOptions] An array of values specifying additional options to apply.
|
|
41
40
|
* @property {boolean} [wrapX=true] Wrap the world horizontally.
|
|
42
41
|
* @property {number} [transition] Duration of the opacity transition for rendering.
|
|
43
42
|
* To disable the opacity transition, pass `transition: 0`.
|
|
@@ -57,7 +56,6 @@ const maxZoom = 22;
|
|
|
57
56
|
* @property {Array<string>} [layerTypes] The layer types.
|
|
58
57
|
* @property {boolean} [overlay] The overlay.
|
|
59
58
|
* @property {Array<Object>} [styles] The styles.
|
|
60
|
-
* @property {Array<string>} [apiOptions] An array of values specifying additional options to apply.
|
|
61
59
|
*/
|
|
62
60
|
|
|
63
61
|
/**
|
|
@@ -138,9 +136,6 @@ class Google extends TileImage {
|
|
|
138
136
|
if (options.overlay === true) {
|
|
139
137
|
sessionTokenRequest.overlay = true;
|
|
140
138
|
}
|
|
141
|
-
if (options.apiOptions) {
|
|
142
|
-
sessionTokenRequest.apiOptions = options.apiOptions;
|
|
143
|
-
}
|
|
144
139
|
|
|
145
140
|
/**
|
|
146
141
|
* @type {SessionTokenRequest}
|
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