ol 9.0.1-dev.1709105228771 → 9.0.1-dev.1709147539193
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 +21 -2
- package/expr/expression.d.ts +2 -2
- package/expr/expression.js +2 -2
- package/package.json +1 -1
- package/source/StadiaMaps.d.ts.map +1 -1
- package/source/StadiaMaps.js +4 -0
- package/util.js +1 -1
package/expr/cpu.js
CHANGED
|
@@ -148,6 +148,8 @@ function compileExpression(expression, context) {
|
|
|
148
148
|
}
|
|
149
149
|
case Ops.Any:
|
|
150
150
|
case Ops.All:
|
|
151
|
+
case Ops.Between:
|
|
152
|
+
case Ops.In:
|
|
151
153
|
case Ops.Not: {
|
|
152
154
|
return compileLogicalExpression(expression, context);
|
|
153
155
|
}
|
|
@@ -194,8 +196,6 @@ function compileExpression(expression, context) {
|
|
|
194
196
|
// TODO: unimplemented
|
|
195
197
|
// Ops.Zoom
|
|
196
198
|
// Ops.Time
|
|
197
|
-
// Ops.Between
|
|
198
|
-
// Ops.In
|
|
199
199
|
// Ops.Array
|
|
200
200
|
// Ops.Color
|
|
201
201
|
// Ops.Band
|
|
@@ -335,6 +335,25 @@ function compileLogicalExpression(expression, context) {
|
|
|
335
335
|
return true;
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
+
case Ops.Between: {
|
|
339
|
+
return (context) => {
|
|
340
|
+
const value = args[0](context);
|
|
341
|
+
const min = args[1](context);
|
|
342
|
+
const max = args[2](context);
|
|
343
|
+
return value >= min && value <= max;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
case Ops.In: {
|
|
347
|
+
return (context) => {
|
|
348
|
+
const value = args[0](context);
|
|
349
|
+
for (let i = 1; i < length; ++i) {
|
|
350
|
+
if (value === args[i](context)) {
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return false;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
338
357
|
case Ops.Not: {
|
|
339
358
|
return (context) => !args[0](context);
|
|
340
359
|
}
|
package/expr/expression.d.ts
CHANGED
|
@@ -193,9 +193,9 @@ export type ArgValidator = (arg0: Array<EncodedExpression>, arg1: ParsingContext
|
|
|
193
193
|
* * `['all', value1, value2, ...]` returns `true` if all the inputs are `true`, `false` otherwise.
|
|
194
194
|
* * `['any', value1, value2, ...]` returns `true` if any of the inputs are `true`, `false` otherwise.
|
|
195
195
|
* * `['between', value1, value2, value3]` returns `true` if `value1` is contained between `value2` and `value3`
|
|
196
|
-
* (inclusively), or `false` otherwise
|
|
196
|
+
* (inclusively), or `false` otherwise.
|
|
197
197
|
* * `['in', needle, haystack]` returns `true` if `needle` is found in `haystack`, and
|
|
198
|
-
* `false` otherwise
|
|
198
|
+
* `false` otherwise.
|
|
199
199
|
* This operator has the following limitations:
|
|
200
200
|
* * `haystack` has to be an array of numbers or strings (searching for a substring in a string is not supported yet)
|
|
201
201
|
* * Only literal arrays are supported as `haystack` for now; this means that `haystack` cannot be the result of an
|
package/expr/expression.js
CHANGED
|
@@ -84,9 +84,9 @@ import {isStringColor} from '../color.js';
|
|
|
84
84
|
* * `['all', value1, value2, ...]` returns `true` if all the inputs are `true`, `false` otherwise.
|
|
85
85
|
* * `['any', value1, value2, ...]` returns `true` if any of the inputs are `true`, `false` otherwise.
|
|
86
86
|
* * `['between', value1, value2, value3]` returns `true` if `value1` is contained between `value2` and `value3`
|
|
87
|
-
* (inclusively), or `false` otherwise
|
|
87
|
+
* (inclusively), or `false` otherwise.
|
|
88
88
|
* * `['in', needle, haystack]` returns `true` if `needle` is found in `haystack`, and
|
|
89
|
-
* `false` otherwise
|
|
89
|
+
* `false` otherwise.
|
|
90
90
|
* This operator has the following limitations:
|
|
91
91
|
* * `haystack` has to be an array of numbers or strings (searching for a substring in a string is not supported yet)
|
|
92
92
|
* * Only literal arrays are supported as `haystack` for now; this means that `haystack` cannot be the result of an
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StadiaMaps.d.ts","sourceRoot":"","sources":["StadiaMaps.js"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"StadiaMaps.d.ts","sourceRoot":"","sources":["StadiaMaps.js"],"names":[],"mappings":";;;;;;;;;;;;;;WAwHc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AALpB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAsDjB;CACF;gBAzMe,UAAU"}
|
package/source/StadiaMaps.js
CHANGED
package/util.js
CHANGED