Tiles should not load data outside maxExtent unless the

'displayOutsideMaxExtent' option on the layer is set to true. Add
tests, docs, and code.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1531 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-10-03 01:08:00 +00:00
parent 66a5d90965
commit 2cb4306beb
5 changed files with 67 additions and 10 deletions

View File

@@ -78,6 +78,9 @@ OpenLayers.Layer.prototype = {
/** @type float */
maxScale: null,
/** @type Boolean */
displayOutsideMaxExtent: false,
/**

View File

@@ -49,13 +49,17 @@ OpenLayers.Tile.Image.prototype =
}
this.imgDiv.style.display = "none";
if (this.layer.alpha) {
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,
null, this.position, this.size, this.url);
} else {
this.imgDiv.src = this.url;
OpenLayers.Util.modifyDOMElement(this.imgDiv,
null, this.position, this.size) ;
if (this.layer.displayOutsideMaxExtent || (this.layer.maxExtent &&
(this.bounds.intersectsBounds(this.layer.maxExtent,false))
)) {
if (this.layer.alpha) {
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,
null, this.position, this.size, this.url);
} else {
this.imgDiv.src = this.url;
OpenLayers.Util.modifyDOMElement(this.imgDiv,
null, this.position, this.size) ;
}
}
},

View File

@@ -63,7 +63,10 @@ OpenLayers.Tile.WFS.prototype =
this.clear();
}
OpenLayers.Tile.prototype.draw.apply(this, arguments);
this.loadFeaturesForRegion(this.requestSuccess);
if (this.layer.displayOutsideMaxExtent || (this.layer.maxExtent &&
this.layer.maxExtent.intersectsBounds(this.bounds, false))) {
this.loadFeaturesForRegion(this.requestSuccess);
}
},
/** get the full request string from the ds and the tile params