improvements suggested by bartvde
This commit is contained in:
@@ -183,17 +183,15 @@ OpenLayers.Tile = OpenLayers.Class({
|
||||
// (3) left bound negative (exceeding world), right bound positive
|
||||
var maxExtents = [maxExtent];
|
||||
if (this.layer.map.baseLayer.wrapDateLine) {
|
||||
var worldExtentWidth = this.layer.map.getMaxExtent().getWidth();
|
||||
maxExtent = this.layer.maxExtent.clone();
|
||||
if (maxExtent.left > maxExtent.right) {
|
||||
maxExtent.left -= worldExtentWidth;
|
||||
var worldWidth = this.layer.map.getMaxExtent().getWidth();
|
||||
maxExtent = this.layer.maxExtent.clone();
|
||||
maxExtent.left -= worldWidth;
|
||||
maxExtents.push(maxExtent);
|
||||
maxExtent = this.layer.maxExtent.clone();
|
||||
maxExtent.right += worldWidth;
|
||||
maxExtents.push(maxExtent);
|
||||
}
|
||||
maxExtents.push(maxExtent);
|
||||
maxExtent = this.layer.maxExtent.clone();
|
||||
if (maxExtent.right < maxExtent.left) {
|
||||
maxExtent.right += worldExtentWidth;
|
||||
}
|
||||
maxExtents.push(maxExtent);
|
||||
}
|
||||
for (var i=maxExtents.length-1; i>=0; --i) {
|
||||
if (this.bounds.intersectsBounds(maxExtents[i], false)) {
|
||||
@@ -215,8 +213,8 @@ OpenLayers.Tile = OpenLayers.Class({
|
||||
*/
|
||||
setBounds: function(bounds) {
|
||||
bounds = bounds.clone();
|
||||
var worldExtent = this.layer.map.getMaxExtent();
|
||||
if (this.layer.map.baseLayer.wrapDateLine) {
|
||||
var worldExtent = this.layer.map.getMaxExtent();
|
||||
bounds = bounds.wrapDateLine(worldExtent);
|
||||
}
|
||||
this.bounds = bounds;
|
||||
|
||||
Reference in New Issue
Block a user