From 3bfbd47fdbd42b7e51f37fe9f8900202a5baa91d Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:27:12 +0100 Subject: [PATCH 1/5] 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 */ From 61d2506970415ec432cd3cff6c49f572dcb0f053 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:31:56 +0100 Subject: [PATCH 2/5] Add new ol.source.WMTS#getStyle 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 e75f859e6d..fb10384567 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -62,6 +62,12 @@ ol.source.WMTS = function(options) { */ this.layer_ = options.layer; + /** + * @private + * @type {string} + */ + this.style_ = options.style; + // 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) ? @@ -76,7 +82,7 @@ ol.source.WMTS = function(options) { // replacement as some services use different naming conventions var context = { 'layer': this.layer_, - 'style': options.style, + 'style': this.style_, 'tilematrixset': options.matrixSet }; @@ -229,6 +235,15 @@ ol.source.WMTS.prototype.getLayer = function() { }; +/** + * @return {string} Style. + * @api + */ +ol.source.WMTS.prototype.getStyle = function() { + return this.style_; +}; + + /** * @private */ From b42a2142523996c8559821e5d6729f5914883e59 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:33:35 +0100 Subject: [PATCH 3/5] Add new ol.source.WMTS#getVersion api function --- src/ol/source/wmtssource.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index fb10384567..913948fa6b 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -40,7 +40,12 @@ ol.source.WMTS = function(options) { // TODO: add support for TileMatrixLimits - var version = goog.isDef(options.version) ? options.version : '1.0.0'; + /** + * @private + * @type {string} + */ + this.version_ = goog.isDef(options.version) ? options.version : '1.0.0'; + var format = goog.isDef(options.format) ? options.format : 'image/jpeg'; /** @@ -90,7 +95,7 @@ ol.source.WMTS = function(options) { goog.object.extend(context, { 'Service': 'WMTS', 'Request': 'GetTile', - 'Version': version, + 'Version': this.version_, 'Format': format }); } @@ -244,6 +249,15 @@ ol.source.WMTS.prototype.getStyle = function() { }; +/** + * @return {string} Version. + * @api + */ +ol.source.WMTS.prototype.getVersion = function() { + return this.version_; +}; + + /** * @private */ From 9d37090e6becfcef41c22d3824b8347e9ea54869 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:34:53 +0100 Subject: [PATCH 4/5] Add new ol.source.WMTS#getFormat api function --- src/ol/source/wmtssource.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 913948fa6b..0de3b78f7c 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -46,7 +46,11 @@ ol.source.WMTS = function(options) { */ this.version_ = goog.isDef(options.version) ? options.version : '1.0.0'; - var format = goog.isDef(options.format) ? options.format : 'image/jpeg'; + /** + * @private + * @type {string} + */ + this.format_ = goog.isDef(options.format) ? options.format : 'image/jpeg'; /** * @private @@ -96,7 +100,7 @@ ol.source.WMTS = function(options) { 'Service': 'WMTS', 'Request': 'GetTile', 'Version': this.version_, - 'Format': format + 'Format': this.format_ }); } @@ -223,6 +227,15 @@ ol.source.WMTS.prototype.getDimensions = function() { }; +/** + * @return {string} Format. + * @api + */ +ol.source.WMTS.prototype.getFormat = function() { + return this.format_; +}; + + /** * @inheritDoc */ From 54bea174ff6697f1fada48db147011b873d7fbd4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 2 Mar 2015 09:51:11 +0100 Subject: [PATCH 5/5] Add new ol.source.WMTS#getMatrixSet 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 0de3b78f7c..af266dda76 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -71,6 +71,12 @@ ol.source.WMTS = function(options) { */ this.layer_ = options.layer; + /** + * @private + * @type {string} + */ + this.matrixSet_ = options.matrixSet; + /** * @private * @type {string} @@ -92,7 +98,7 @@ ol.source.WMTS = function(options) { var context = { 'layer': this.layer_, 'style': this.style_, - 'tilematrixset': options.matrixSet + 'tilematrixset': this.matrixSet_ }; if (requestEncoding == ol.source.WMTSRequestEncoding.KVP) { @@ -253,6 +259,15 @@ ol.source.WMTS.prototype.getLayer = function() { }; +/** + * @return {string} MatrixSet. + * @api + */ +ol.source.WMTS.prototype.getMatrixSet = function() { + return this.matrixSet_; +}; + + /** * @return {string} Style. * @api