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,10 +147,9 @@ 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;
var limit = Math.pow(2, z); if (this.wrapDateLine) {
if (this.wrapDateLine) var limit = Math.pow(2, z);
{ x = ((x % limit) + limit) % limit;
x = ((x % limit) + limit) % limit;
} }
return {'x': x, 'y': y, 'z': z}; return {'x': x, 'y': y, 'z': z};