URL switching for all REST encoded WMTS layers.
This commit is contained in:
@@ -417,10 +417,19 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
|||||||
var matrixId = this.matrix.identifier;
|
var matrixId = this.matrix.identifier;
|
||||||
var dimensions = this.dimensions, params;
|
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") {
|
if (this.requestEncoding.toUpperCase() === "REST") {
|
||||||
params = this.params;
|
params = this.params;
|
||||||
if (typeof this.url === "string" && this.url.indexOf("{") !== -1) {
|
if (url.indexOf("{") !== -1) {
|
||||||
var template = this.url.replace(/\{/g, "${");
|
var template = url.replace(/\{/g, "${");
|
||||||
var context = {
|
var context = {
|
||||||
// spec does not make clear if capital S or not
|
// spec does not make clear if capital S or not
|
||||||
style: this.style, Style: this.style,
|
style: this.style, Style: this.style,
|
||||||
@@ -454,11 +463,6 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
|||||||
path = path + this.matrixSet + "/" + this.matrix.identifier +
|
path = path + this.matrixSet + "/" + this.matrix.identifier +
|
||||||
"/" + info.row + "/" + info.col + "." + this.formatSuffix;
|
"/" + 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(/\/$/)) {
|
if (!url.match(/\/$/)) {
|
||||||
url = url + "/";
|
url = url + "/";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user