From 3bfbd47fdbd42b7e51f37fe9f8900202a5baa91d Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:27:12 +0100 Subject: [PATCH] Add new ol.source.WMTS#getLayer api function --- src/ol/source/wmtssource.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 6654005fdf..e75f859e6d 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -56,6 +56,12 @@ ol.source.WMTS = function(options) { this.coordKeyPrefix_ = ''; this.resetCoordKeyPrefix_(); + /** + * @private + * @type {string} + */ + this.layer_ = options.layer; + // FIXME: should we guess this requestEncoding from options.url(s) // structure? that would mean KVP only if a template is not provided. var requestEncoding = goog.isDef(options.requestEncoding) ? @@ -69,7 +75,7 @@ ol.source.WMTS = function(options) { // context property names are lower case to allow for a case insensitive // replacement as some services use different naming conventions var context = { - 'layer': options.layer, + 'layer': this.layer_, 'style': options.style, 'tilematrixset': options.matrixSet }; @@ -214,6 +220,15 @@ ol.source.WMTS.prototype.getKeyZXY = function(z, x, y) { }; +/** + * @return {string} Layer. + * @api + */ +ol.source.WMTS.prototype.getLayer = function() { + return this.layer_; +}; + + /** * @private */