From 932c284a2e7899ca6c42d8d1f87fea71e40bf713 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 20 Mar 2013 18:14:48 +0100 Subject: [PATCH] ArcGis use RESTful The OGC documentation is not clear if we should use REST or RESTful. --- src/ol/source/wmtssource.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 0139709b92..157e8d0f76 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -204,21 +204,22 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) { var encodings = goog.object.getKeys( gets[0]['constraints']['GetEncoding']['allowedValues']); goog.asserts.assert(encodings.length > 0); - var requestEncoding = /** @type {ol.source.WMTSRequestEncoding} */ - (encodings[0]); - // TODO: arcgis support, quote from ol2: - // The OGC documentation is not clear if we should use REST or RESTful, - // ArcGis use RESTful, and OpenLayers use REST. var urls; - switch (requestEncoding) { - case ol.source.WMTSRequestEncoding.REST: + var requestEncoding; + switch (encodings[0]) { + case 'REST': + case 'RESTful': + // The OGC documentation is not clear if we should use REST or RESTful, + // ArcGis use RESTful, and OpenLayers use REST. + requestEncoding = ol.source.WMTSRequestEncoding.REST; goog.asserts.assert(l['resourceUrls'].hasOwnProperty('tile')); goog.asserts.assert(l['resourceUrls']['tile'].hasOwnProperty(format)); urls = /** @type {Array.} */ (l['resourceUrls']['tile'][format]); break; - case ol.source.WMTSRequestEncoding.KVP: + case 'KVP': + requestEncoding = ol.source.WMTSRequestEncoding.REST; urls = []; goog.array.forEach(gets, function(elt, index, array) { if (elt['constraints']['GetEncoding']['allowedValues'].hasOwnProperty(