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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user