From 398b1f86cefb70b5046a763bf481e3dc62d3bfe2 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 27 Oct 2014 13:48:47 +0100 Subject: [PATCH] Allow olx.source.WMTSOptions#requestEncoding to be a string --- examples/wmts-hidpi.js | 2 +- externs/olx.js | 4 ++-- src/ol/source/wmtssource.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/wmts-hidpi.js b/examples/wmts-hidpi.js index 682a08c5fb..52a0d7b669 100644 --- a/examples/wmts-hidpi.js +++ b/examples/wmts-hidpi.js @@ -29,7 +29,7 @@ var source = new ol.source.WMTS({ style: 'normal', matrixSet: 'google3857', urls: urls, - requestEncoding: /** @type {ol.source.WMTSRequestEncoding} */ ('REST'), + requestEncoding: 'REST', tileGrid: new ol.tilegrid.WMTS({ origin: [-20037508.3428, 20037508.3428], resolutions: [ diff --git a/externs/olx.js b/externs/olx.js index c0567017b0..27dbc962ec 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -4987,7 +4987,7 @@ olx.source.StaticVectorOptions.prototype.urls; * logo: (string|olx.LogoOptions|undefined), * tileGrid: ol.tilegrid.WMTS, * projection: ol.proj.ProjectionLike, - * requestEncoding: (ol.source.WMTSRequestEncoding|undefined), + * requestEncoding: (ol.source.WMTSRequestEncoding|string|undefined), * layer: string, * style: string, * tilePixelRatio: (number|undefined), @@ -5049,7 +5049,7 @@ olx.source.WMTSOptions.prototype.projection; /** * Request encoding. Default is `KVP`. - * @type {ol.source.WMTSRequestEncoding|undefined} + * @type {ol.source.WMTSRequestEncoding|string|undefined} * @api */ olx.source.WMTSOptions.prototype.requestEncoding; diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 0d37688c8c..8581772b72 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -59,7 +59,8 @@ ol.source.WMTS = function(options) { // 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) ? - options.requestEncoding : ol.source.WMTSRequestEncoding.KVP; + /** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) : + ol.source.WMTSRequestEncoding.KVP; // FIXME: should we create a default tileGrid? // we could issue a getCapabilities xhr to retrieve missing configuration