Add new ol.source.WMTS#getLayer api function

This commit is contained in:
Frederic Junod
2015-03-02 09:27:12 +01:00
parent 4f5cc22ba0
commit 3bfbd47fdb

View File

@@ -56,6 +56,12 @@ ol.source.WMTS = function(options) {
this.coordKeyPrefix_ = ''; this.coordKeyPrefix_ = '';
this.resetCoordKeyPrefix_(); this.resetCoordKeyPrefix_();
/**
* @private
* @type {string}
*/
this.layer_ = options.layer;
// FIXME: should we guess this requestEncoding from options.url(s) // FIXME: should we guess this requestEncoding from options.url(s)
// structure? that would mean KVP only if a template is not provided. // structure? that would mean KVP only if a template is not provided.
var requestEncoding = goog.isDef(options.requestEncoding) ? 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 // context property names are lower case to allow for a case insensitive
// replacement as some services use different naming conventions // replacement as some services use different naming conventions
var context = { var context = {
'layer': options.layer, 'layer': this.layer_,
'style': options.style, 'style': options.style,
'tilematrixset': options.matrixSet '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 * @private
*/ */