ArcGis use RESTful

The OGC documentation is not clear if we should use REST or RESTful.
This commit is contained in:
Bruno Binet
2013-03-20 18:14:48 +01:00
parent ef42daedd4
commit 932c284a2e
+9 -8
View File
@@ -204,21 +204,22 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) {
var encodings = goog.object.getKeys( var encodings = goog.object.getKeys(
gets[0]['constraints']['GetEncoding']['allowedValues']); gets[0]['constraints']['GetEncoding']['allowedValues']);
goog.asserts.assert(encodings.length > 0); 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; var urls;
switch (requestEncoding) { var requestEncoding;
case ol.source.WMTSRequestEncoding.REST: 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'].hasOwnProperty('tile'));
goog.asserts.assert(l['resourceUrls']['tile'].hasOwnProperty(format)); goog.asserts.assert(l['resourceUrls']['tile'].hasOwnProperty(format));
urls = /** @type {Array.<string>} */ urls = /** @type {Array.<string>} */
(l['resourceUrls']['tile'][format]); (l['resourceUrls']['tile'][format]);
break; break;
case ol.source.WMTSRequestEncoding.KVP: case 'KVP':
requestEncoding = ol.source.WMTSRequestEncoding.REST;
urls = []; urls = [];
goog.array.forEach(gets, function(elt, index, array) { goog.array.forEach(gets, function(elt, index, array) {
if (elt['constraints']['GetEncoding']['allowedValues'].hasOwnProperty( if (elt['constraints']['GetEncoding']['allowedValues'].hasOwnProperty(