fix size initialization and resolution/zoom usage
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user