From 147b32b7e34f18996f79437f7b80f512aba46515 Mon Sep 17 00:00:00 2001 From: fredj Date: Wed, 15 Feb 2012 12:33:14 +0100 Subject: [PATCH] Don't compute limit if it's not needed --- lib/OpenLayers/Layer/XYZ.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Layer/XYZ.js b/lib/OpenLayers/Layer/XYZ.js index cc52d97fc6..43535dff79 100644 --- a/lib/OpenLayers/Layer/XYZ.js +++ b/lib/OpenLayers/Layer/XYZ.js @@ -147,10 +147,9 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, { OpenLayers.Util.indexOf(resolutions, res) : this.getServerZoom() + this.zoomOffset; - var limit = Math.pow(2, z); - if (this.wrapDateLine) - { - x = ((x % limit) + limit) % limit; + if (this.wrapDateLine) { + var limit = Math.pow(2, z); + x = ((x % limit) + limit) % limit; } return {'x': x, 'y': y, 'z': z};