BBOX strategy should not request data if its layer is out of range when changing layer visibility

This commit is contained in:
Bart van den Eijnden
2012-05-15 12:18:42 +02:00
parent 685eae7c04
commit bca3e45940
2 changed files with 8 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
"refresh": this.update,
scope: this
});
if(this.layer.visibility === true && this.layer.inRange === true) {
if(this.layer.visibility === true) {
this.update();
} else {
this.layer.events.on({
@@ -134,7 +134,7 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
update: function(options) {
var mapBounds = this.getMapBounds();
if (mapBounds !== null && ((options && options.force) ||
this.invalidBounds(mapBounds))) {
(this.layer.calculateInRange() && this.invalidBounds(mapBounds)))) {
this.calculateBounds(mapBounds);
this.resolution = this.layer.map.getResolution();
this.triggerRead(options);