Add RESTful compatibility support

This commit is contained in:
Stéphane Brunner
2012-09-14 17:16:46 +02:00
parent b57540ecfc
commit 0915fb72a2
2 changed files with 89 additions and 3 deletions

View File

@@ -139,8 +139,13 @@ OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Vers
// Get first get method
if (http.get[0].constraints) {
var constraints = http.get[0].constraints;
if (!constraints.GetEncoding.allowedValues.KVP &&
constraints.GetEncoding.allowedValues.REST) {
var allowedValues = constraints.GetEncoding.allowedValues;
// The OGC documentation is not clear if we should use
// REST or RESTful, ArcGis use RESTful,
// and OpenLayers use REST.
if (!allowedValues.KVP &&
(allowedValues.REST || allowedValues.RESTful)) {
requestEncoding = "REST";
}
}