From 7b91c9c26fa0edcafcea4d886c4a83dfbe5fb84e Mon Sep 17 00:00:00 2001 From: dregade Date: Thu, 28 Jun 2012 17:16:22 +0200 Subject: [PATCH] fix size initialization and resolution/zoom usage --- lib/OpenLayers/Layer/Zoomify.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Layer/Zoomify.js b/lib/OpenLayers/Layer/Zoomify.js index 6179cccd14..b9ed54ff9b 100644 --- a/lib/OpenLayers/Layer/Zoomify.js +++ b/lib/OpenLayers/Layer/Zoomify.js @@ -105,6 +105,7 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, { initializeZoomify: function( size ) { var imageSize = size.clone(); + this.size = size.clone(); var tiles = new OpenLayers.Size( Math.ceil( imageSize.w / this.standardTileSize ), Math.ceil( imageSize.h / this.standardTileSize ) @@ -195,10 +196,10 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, { */ getURL: function (bounds) { bounds = this.adjustBounds(bounds); - var res = this.map.getResolution(); + var res = this.getServerResolution(); var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w)); var y = Math.round((this.tileOrigin.lat - bounds.top) / (res * this.tileSize.h)); - var z = this.map.getZoom(); + var z = this.getZoomForResolution( res ); var tileIndex = x + y * this.tierSizeInTiles[z].w + this.tileCountUpToTier[z]; var path = "TileGroup" + Math.floor( (tileIndex) / 256 ) + @@ -219,10 +220,10 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, { getImageSize: function() { if (arguments.length > 0) { var bounds = this.adjustBounds(arguments[0]); - var res = this.map.getResolution(); + var res = this.getServerResolution(); var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w)); var y = Math.round((this.tileOrigin.lat - bounds.top) / (res * this.tileSize.h)); - var z = this.map.getZoom(); + var z = this.getZoomForResolution( res ); var w = this.standardTileSize; var h = this.standardTileSize; if (x == this.tierSizeInTiles[z].w -1 ) {