Various fixes for browser compatibility issues (#12740)
* Replace Math.log2 with ol/math.log2 * TypedArray.from() browser compatibility fallback * listen for input and change events for range
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import {Uniforms} from '../renderer/webgl/TileLayer.js';
|
||||
import {asArray, isStringColor} from '../color.js';
|
||||
import {log2} from '../math.js';
|
||||
|
||||
/**
|
||||
* Base type used for literal style parameters; can be a number literal or the output of an operator,
|
||||
@@ -173,7 +174,7 @@ export function getValueType(value) {
|
||||
* @return {boolean} True if only one type flag is enabled, false if zero or multiple
|
||||
*/
|
||||
export function isTypeUnique(valueType) {
|
||||
return Math.log2(valueType) % 1 === 0;
|
||||
return log2(valueType) % 1 === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,7 +73,10 @@ class WebGLArrayBuffer {
|
||||
* @param {Array<number>} array Numerical array
|
||||
*/
|
||||
fromArray(array) {
|
||||
this.array = getArrayClassForType(this.type).from(array);
|
||||
const arrayClass = getArrayClassForType(this.type);
|
||||
this.array = arrayClass.from
|
||||
? arrayClass.from(array)
|
||||
: new arrayClass(array);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user