remove tabs and trailing whitespace. Non functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10439 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -46,30 +46,30 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
/**
|
||||
* Property: numberOfTiers
|
||||
* {Integer} Depth of the Zoomify pyramid, number of tiers (zoom levels)
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
*/
|
||||
numberOfTiers: 0,
|
||||
numberOfTiers: 0,
|
||||
|
||||
/**
|
||||
* Property: tileCountUpToTier
|
||||
* {Array(Integer)} Number of tiles up to the given tier of pyramid.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
*/
|
||||
tileCountUpToTier: new Array(),
|
||||
tileCountUpToTier: new Array(),
|
||||
|
||||
/**
|
||||
* Property: tierSizeInTiles
|
||||
* {Array(<OpenLayers.Size>)} Size (in tiles) for each tier of pyramid.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
*/
|
||||
tierSizeInTiles: new Array(),
|
||||
tierSizeInTiles: new Array(),
|
||||
|
||||
/**
|
||||
* Property: tierImageSize
|
||||
* {Array(<OpenLayers.Size>)} Image size in pixels for each pyramid tier.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
* - filled during Zoomify pyramid initialization.
|
||||
*/
|
||||
tierImageSize: new Array(),
|
||||
tierImageSize: new Array(),
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.Zoomify
|
||||
@@ -84,8 +84,8 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
*/
|
||||
initialize: function(name, url, size, options) {
|
||||
|
||||
// initilize the Zoomify pyramid for given size
|
||||
this.initializeZoomify( size );
|
||||
// initilize the Zoomify pyramid for given size
|
||||
this.initializeZoomify( size );
|
||||
|
||||
var newArguments = [];
|
||||
newArguments.push(name, url, size, {}, options);
|
||||
@@ -101,45 +101,45 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* size - {<OpenLayers.Size>} The size of the image in pixels
|
||||
*
|
||||
*/
|
||||
initializeZoomify: function( size ) {
|
||||
initializeZoomify: function( size ) {
|
||||
|
||||
var imageSize = size.clone()
|
||||
var tiles = new OpenLayers.Size(
|
||||
Math.ceil( imageSize.w / this.standardTileSize ),
|
||||
Math.ceil( imageSize.h / this.standardTileSize )
|
||||
);
|
||||
var imageSize = size.clone()
|
||||
var tiles = new OpenLayers.Size(
|
||||
Math.ceil( imageSize.w / this.standardTileSize ),
|
||||
Math.ceil( imageSize.h / this.standardTileSize )
|
||||
);
|
||||
|
||||
this.tierSizeInTiles.push( tiles );
|
||||
this.tierImageSize.push( imageSize );
|
||||
this.tierSizeInTiles.push( tiles );
|
||||
this.tierImageSize.push( imageSize );
|
||||
|
||||
while (imageSize.w > this.standardTileSize ||
|
||||
imageSize.h > this.standardTileSize ) {
|
||||
while (imageSize.w > this.standardTileSize ||
|
||||
imageSize.h > this.standardTileSize ) {
|
||||
|
||||
imageSize = new OpenLayers.Size(
|
||||
Math.floor( imageSize.w / 2 ),
|
||||
Math.floor( imageSize.h / 2 )
|
||||
);
|
||||
tiles = new OpenLayers.Size(
|
||||
Math.ceil( imageSize.w / this.standardTileSize ),
|
||||
Math.ceil( imageSize.h / this.standardTileSize )
|
||||
);
|
||||
this.tierSizeInTiles.push( tiles );
|
||||
this.tierImageSize.push( imageSize );
|
||||
}
|
||||
imageSize = new OpenLayers.Size(
|
||||
Math.floor( imageSize.w / 2 ),
|
||||
Math.floor( imageSize.h / 2 )
|
||||
);
|
||||
tiles = new OpenLayers.Size(
|
||||
Math.ceil( imageSize.w / this.standardTileSize ),
|
||||
Math.ceil( imageSize.h / this.standardTileSize )
|
||||
);
|
||||
this.tierSizeInTiles.push( tiles );
|
||||
this.tierImageSize.push( imageSize );
|
||||
}
|
||||
|
||||
this.tierSizeInTiles.reverse();
|
||||
this.tierImageSize.reverse();
|
||||
this.tierSizeInTiles.reverse();
|
||||
this.tierImageSize.reverse();
|
||||
|
||||
this.numberOfTiers = this.tierSizeInTiles.length;
|
||||
this.numberOfTiers = this.tierSizeInTiles.length;
|
||||
|
||||
this.tileCountUpToTier[0] = 0;
|
||||
for (var i = 1; i < this.numberOfTiers; i++) {
|
||||
this.tileCountUpToTier.push(
|
||||
this.tierSizeInTiles[i-1].w * this.tierSizeInTiles[i-1].h +
|
||||
this.tileCountUpToTier[i-1]
|
||||
);
|
||||
}
|
||||
},
|
||||
this.tileCountUpToTier[0] = 0;
|
||||
for (var i = 1; i < this.numberOfTiers; i++) {
|
||||
this.tileCountUpToTier.push(
|
||||
this.tierSizeInTiles[i-1].w * this.tierSizeInTiles[i-1].h +
|
||||
this.tileCountUpToTier[i-1]
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod:destroy
|
||||
@@ -148,10 +148,10 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
// for now, nothing special to do here.
|
||||
OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments);
|
||||
|
||||
// Remove from memory the Zoomify pyramid - is that enough?
|
||||
this.tileCountUpToTier.length = 0
|
||||
this.tierSizeInTiles.length = 0
|
||||
this.tierImageSize.length = 0
|
||||
// Remove from memory the Zoomify pyramid - is that enough?
|
||||
this.tileCountUpToTier.length = 0
|
||||
this.tierSizeInTiles.length = 0
|
||||
this.tierImageSize.length = 0
|
||||
|
||||
},
|
||||
|
||||
@@ -169,7 +169,7 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Layer.Zoomify(this.name,
|
||||
this.url,
|
||||
this.size,
|
||||
this.size,
|
||||
this.options);
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
var y = Math.round((this.tileOrigin.lat - bounds.top) / (res * this.tileSize.h));
|
||||
var z = this.map.getZoom();
|
||||
|
||||
var tileIndex = x + y * this.tierSizeInTiles[z].w + this.tileCountUpToTier[z];
|
||||
var path = "TileGroup" + Math.floor( (tileIndex) / 256 ) +
|
||||
"/" + z + "-" + x + "-" + y + ".jpg";
|
||||
var tileIndex = x + y * this.tierSizeInTiles[z].w + this.tileCountUpToTier[z];
|
||||
var path = "TileGroup" + Math.floor( (tileIndex) / 256 ) +
|
||||
"/" + z + "-" + x + "-" + y + ".jpg";
|
||||
var url = this.url;
|
||||
if (url instanceof Array) {
|
||||
url = this.selectUrl(path, url);
|
||||
@@ -216,24 +216,24 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
*
|
||||
*/
|
||||
getImageSize: function() {
|
||||
if (arguments.length > 0) {
|
||||
bounds = this.adjustBounds(arguments[0]);
|
||||
var res = this.map.getResolution();
|
||||
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 w = this.standardTileSize;
|
||||
var h = this.standardTileSize;
|
||||
if (x == this.tierSizeInTiles[z].w -1 ) {
|
||||
var w = this.tierImageSize[z].w % this.standardTileSize;
|
||||
};
|
||||
if (y == this.tierSizeInTiles[z].h -1 ) {
|
||||
var h = this.tierImageSize[z].h % this.standardTileSize;
|
||||
};
|
||||
return (new OpenLayers.Size(w, h));
|
||||
} else {
|
||||
return this.tileSize;
|
||||
}
|
||||
if (arguments.length > 0) {
|
||||
bounds = this.adjustBounds(arguments[0]);
|
||||
var res = this.map.getResolution();
|
||||
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 w = this.standardTileSize;
|
||||
var h = this.standardTileSize;
|
||||
if (x == this.tierSizeInTiles[z].w -1 ) {
|
||||
var w = this.tierImageSize[z].w % this.standardTileSize;
|
||||
};
|
||||
if (y == this.tierSizeInTiles[z].h -1 ) {
|
||||
var h = this.tierImageSize[z].h % this.standardTileSize;
|
||||
};
|
||||
return (new OpenLayers.Size(w, h));
|
||||
} else {
|
||||
return this.tileSize;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user