Don't compute limit if it's not needed

This commit is contained in:
fredj
2012-02-15 12:33:14 +01:00
parent cd3ffa2058
commit 147b32b7e3

View File

@@ -147,9 +147,8 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
OpenLayers.Util.indexOf(resolutions, res) : OpenLayers.Util.indexOf(resolutions, res) :
this.getServerZoom() + this.zoomOffset; this.getServerZoom() + this.zoomOffset;
if (this.wrapDateLine) {
var limit = Math.pow(2, z); var limit = Math.pow(2, z);
if (this.wrapDateLine)
{
x = ((x % limit) + limit) % limit; x = ((x % limit) + limit) % limit;
} }