Using util method for array indexOf in TMS layer. r=crschmidt (pullup #2100)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9403 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-05-21 14:52:38 +00:00
parent 16715f41f6
commit d178a7675b
2 changed files with 9 additions and 5 deletions

View File

@@ -105,7 +105,9 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
var res = this.map.getResolution();
var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
var z = this.serverResolutions != null ? this.serverResolutions.indexOf(res) : this.map.getZoom();
var z = this.serverResolutions != null ?
OpenLayers.Util.indexOf(this.serverResolutions, res) :
this.map.getZoom();
var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
var url = this.url;
if (url instanceof Array) {