also consider the resolutions array if no zoomOffset is provided. r=bartvde (closes #3485)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12357 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-09-12 04:26:32 +00:00
parent 98be6e313b
commit 22bd5fa546
5 changed files with 37 additions and 10 deletions

View File

@@ -144,8 +144,9 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
(res * this.tileSize.w));
var y = Math.round((this.maxExtent.top - bounds.top) /
(res * this.tileSize.h));
var z = this.serverResolutions != null ?
OpenLayers.Util.indexOf(this.serverResolutions, res) :
var resolutions = this.serverResolutions || this.resolutions;
var z = this.zoomOffset == 0 ?
OpenLayers.Util.indexOf(resolutions, res) :
this.map.getZoom() + this.zoomOffset;
var limit = Math.pow(2, z);