read legendURL and Dimension from WMTS capabilities docs

This commit is contained in:
Éric Lemoine
2011-10-24 16:07:00 +02:00
parent daa16c08b1
commit babbfa20b0
2 changed files with 34 additions and 2 deletions

View File

@@ -112,6 +112,7 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
var layer = {
styles: [],
formats: [],
dimensions: [],
tileMatrixSetLinks: []
};
layer.layers = [];
@@ -218,7 +219,23 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
obj.serviceMetadataUrl = {};
obj.serviceMetadataUrl.href = node.getAttribute("xlink:href");
// TODO: other attributes of <ServiceMetadataURL> element
}
},
"LegendURL": function(node, obj) {
obj.legend = {};
obj.legend.href = node.getAttribute("xlink:href");
obj.legend.format = node.getAttribute("format");
},
"Dimension": function(node, obj) {
var dimension = {values: []};
this.readChildNodes(node, dimension);
obj.dimensions.push(dimension);
},
"Default": function(node, obj) {
obj["default"] = this.getChildValue(node);
},
"Value": function(node, obj) {
obj.values.push(this.getChildValue(node));
}
},
"ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"]
},