replace containsExtent with equals in strategy
This commit is contained in:
committed by
Andreas Hocevar
parent
99a1641afe
commit
6013763480
@@ -25,8 +25,7 @@ import {
|
|||||||
getWidth,
|
getWidth,
|
||||||
intersects,
|
intersects,
|
||||||
isEmpty,
|
isEmpty,
|
||||||
buffer as bufferExtent,
|
wrapX as wrapExtentX
|
||||||
wrapX
|
|
||||||
} from '../extent.js';
|
} from '../extent.js';
|
||||||
import {clamp} from '../math.js';
|
import {clamp} from '../math.js';
|
||||||
import Style from '../style/Style.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
|
// extents may be passed in different worlds, to avoid endless loop we use only one
|
||||||
const realExtent = extent.slice();
|
const realExtent = extent.slice();
|
||||||
if (this.projection_ && this.getSource().getWrapX()) {
|
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
|
// we should not keep track of loaded extents
|
||||||
this.getSource().removeLoadedExtent(this.loadedExtent_);
|
this.getSource().removeLoadedExtent(this.loadedExtent_);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user