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:
@@ -61,13 +61,11 @@ const map = new Map({
|
||||
],
|
||||
});
|
||||
|
||||
const updateSourceDimension = function (source, sliderVal) {
|
||||
source.updateDimensions({'threshold': sliderVal});
|
||||
document.getElementById('theinfo').innerHTML = sliderVal + ' meters';
|
||||
const slider = document.getElementById('slider');
|
||||
const updateSourceDimension = function () {
|
||||
wmtsSource.updateDimensions({'threshold': slider.value});
|
||||
document.getElementById('theinfo').innerHTML = slider.value + ' meters';
|
||||
};
|
||||
|
||||
updateSourceDimension(wmtsSource, 10);
|
||||
|
||||
document.getElementById('slider').addEventListener('input', function () {
|
||||
updateSourceDimension(wmtsSource, this.value);
|
||||
});
|
||||
slider.addEventListener('input', updateSourceDimension);
|
||||
slider.addEventListener('change', updateSourceDimension);
|
||||
updateSourceDimension();
|
||||
|
||||
Reference in New Issue
Block a user