replace containsExtent with equals in strategy

This commit is contained in:
mike-000
2020-03-30 23:43:26 +01:00
committed by Andreas Hocevar
parent 99a1641afe
commit 6013763480

View File

@@ -25,8 +25,7 @@ import {
getWidth,
intersects,
isEmpty,
buffer as bufferExtent,
wrapX
wrapX as wrapExtentX
} from '../extent.js';
import {clamp} from '../math.js';
import Style from '../style/Style.js';
@@ -484,9 +483,11 @@ class Graticule extends VectorLayer {
// extents may be passed in different worlds, to avoid endless loop we use only one
const realExtent = extent.slice();
if (this.projection_ && this.getSource().getWrapX()) {
wrapX(realExtent, this.projection_);
wrapExtentX(realExtent, this.projection_);
}
if (this.loadedExtent_ && !containsExtent(bufferExtent(this.loadedExtent_, resolution / 2), realExtent)) {
realExtent[0] = Math.round(realExtent[0] * 1e8) / 1e8;
realExtent[2] = Math.round(realExtent[2] * 1e8) / 1e8;
if (this.loadedExtent_ && !equals(this.loadedExtent_, realExtent)) {
// we should not keep track of loaded extents
this.getSource().removeLoadedExtent(this.loadedExtent_);
}