Layer.TileCache, Layer.TMS: support a subset of server resolutions. r=tschaub (closes #1944)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8932 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2009-03-02 08:21:01 +00:00
parent 4dc36e4d80
commit a0678fa739
5 changed files with 70 additions and 6 deletions
+8 -1
View File
@@ -33,6 +33,13 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
*/
format: 'image/png',
/**
* APIProperty: serverResolutions
* {Array} A list of all resolutions available on the server. Only set this
* property if the map resolutions differs from the server.
*/
serverResolutions: null,
/**
* Constructor: OpenLayers.Layer.TileCache
* Create a new read only TileCache layer.
@@ -98,7 +105,7 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
var size = this.tileSize;
var tileX = Math.round((bounds.left - bbox.left) / (res * size.w));
var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h));
var tileZ = this.map.zoom;
var tileZ = this.serverResolutions != null ? this.serverResolutions.indexOf(res) : this.map.getZoom();
/**
* Zero-pad a positive integer.
* number - {Int}