From a29009be91dcb44c5423aa80695f6197707eb48a Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 2 Jun 2012 01:43:31 +0200 Subject: [PATCH] Revert "URL switching for all REST encoded WMTS layers." This was accidentally committed to master. This reverts commit df44a79e1b0c47d2310433a1b9a4217fc9c03693. --- lib/OpenLayers/Layer/WMTS.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/OpenLayers/Layer/WMTS.js b/lib/OpenLayers/Layer/WMTS.js index ad3822db63..bf4cc5a38f 100644 --- a/lib/OpenLayers/Layer/WMTS.js +++ b/lib/OpenLayers/Layer/WMTS.js @@ -417,19 +417,10 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, { var matrixId = this.matrix.identifier; var dimensions = this.dimensions, params; - if (OpenLayers.Util.isArray(this.url)) { - url = this.selectUrl([ - this.version, this.style, this.matrixSet, - this.matrix.identifier, info.row, info.col - ].join(","), this.url); - } else { - url = this.url; - } - if (this.requestEncoding.toUpperCase() === "REST") { params = this.params; - if (url.indexOf("{") !== -1) { - var template = url.replace(/\{/g, "${"); + if (typeof this.url === "string" && this.url.indexOf("{") !== -1) { + var template = this.url.replace(/\{/g, "${"); var context = { // spec does not make clear if capital S or not style: this.style, Style: this.style, @@ -463,6 +454,11 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, { path = path + this.matrixSet + "/" + this.matrix.identifier + "/" + info.row + "/" + info.col + "." + this.formatSuffix; + if (OpenLayers.Util.isArray(this.url)) { + url = this.selectUrl(path, this.url); + } else { + url = this.url; + } if (!url.match(/\/$/)) { url = url + "/"; }