Support for multiple resource urls

With this change, createLayer generates url arrays for both KVP and REST
encoding if multiple resource urls are provided. To make this work, the
WMTSCapabilities format got a new resourceUrls property, because
previously only the first resourceUrl for a format was stored.
This commit is contained in:
ahocevar
2012-10-01 15:28:30 +02:00
parent 51ae75a54f
commit 22c5e76b0b
4 changed files with 68 additions and 15 deletions

View File

@@ -195,10 +195,16 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
},
"ResourceURL": function(node, obj) {
obj.resourceUrl = obj.resourceUrl || {};
obj.resourceUrl[node.getAttribute("resourceType")] = {
var resourceType = node.getAttribute("resourceType");
if (!obj.resourceUrls) {
obj.resourceUrls = [];
}
var resourceType = obj.resourceUrl[resourceType] = {
format: node.getAttribute("format"),
template: node.getAttribute("template")
template: node.getAttribute("template"),
resourceType: resourceType
};
obj.resourceUrls.push(resourceType);
},
// not used for now, can be added in the future though
/*"Themes": function(node, obj) {