only change bounds when wrapDateLine is true; remove unused variable
This commit is contained in:
@@ -404,6 +404,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
*/
|
*/
|
||||||
calculateGridLayout: function(bounds, origin, resolution) {
|
calculateGridLayout: function(bounds, origin, resolution) {
|
||||||
bounds = bounds.clone();
|
bounds = bounds.clone();
|
||||||
|
if (this.map.baseLayer.wrapDateLine) {
|
||||||
var maxExtent = this.map.getMaxExtent(),
|
var maxExtent = this.map.getMaxExtent(),
|
||||||
width = maxExtent.getWidth();
|
width = maxExtent.getWidth();
|
||||||
// move the bounds one world width to the right until the origin is
|
// move the bounds one world width to the right until the origin is
|
||||||
@@ -412,6 +413,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
bounds.left += width;
|
bounds.left += width;
|
||||||
bounds.right += width;
|
bounds.right += width;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var tilelon = resolution * this.tileSize.w;
|
var tilelon = resolution * this.tileSize.w;
|
||||||
var tilelat = resolution * this.tileSize.h;
|
var tilelat = resolution * this.tileSize.h;
|
||||||
|
|||||||
@@ -215,9 +215,8 @@ OpenLayers.Tile = OpenLayers.Class({
|
|||||||
*/
|
*/
|
||||||
setBounds: function(bounds) {
|
setBounds: function(bounds) {
|
||||||
bounds = bounds.clone();
|
bounds = bounds.clone();
|
||||||
var maxExtent = this.layer.maxExtent,
|
var worldExtent = this.layer.map.getMaxExtent();
|
||||||
worldExtent = this.layer.map.getMaxExtent();
|
if (this.layer.map.baseLayer.wrapDateLine) {
|
||||||
if (maxExtent && this.layer.map.baseLayer.wrapDateLine) {
|
|
||||||
bounds = bounds.wrapDateLine(worldExtent);
|
bounds = bounds.wrapDateLine(worldExtent);
|
||||||
}
|
}
|
||||||
this.bounds = bounds;
|
this.bounds = bounds;
|
||||||
|
|||||||
Reference in New Issue
Block a user