return previous extent if extents are approx equal
This commit is contained in:
@@ -481,13 +481,18 @@ class Graticule extends VectorLayer {
|
|||||||
*/
|
*/
|
||||||
strategyFunction(extent, resolution) {
|
strategyFunction(extent, resolution) {
|
||||||
// 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 realWorldExtent = extent.slice();
|
let realWorldExtent = extent.slice();
|
||||||
if (this.projection_ && this.getSource().getWrapX()) {
|
if (this.projection_ && this.getSource().getWrapX()) {
|
||||||
wrapExtentX(realWorldExtent, this.projection_);
|
wrapExtentX(realWorldExtent, this.projection_);
|
||||||
}
|
}
|
||||||
if (this.loadedExtent_ && !approximatelyEquals(this.loadedExtent_, realWorldExtent, resolution)) {
|
if (this.loadedExtent_) {
|
||||||
// we should not keep track of loaded extents
|
if (approximatelyEquals(this.loadedExtent_, realWorldExtent, resolution)) {
|
||||||
this.getSource().removeLoadedExtent(this.loadedExtent_);
|
// make sure result is exactly equal to previous extent
|
||||||
|
realWorldExtent = this.loadedExtent_.slice();
|
||||||
|
} else {
|
||||||
|
// we should not keep track of loaded extents
|
||||||
|
this.getSource().removeLoadedExtent(this.loadedExtent_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return [realWorldExtent];
|
return [realWorldExtent];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user