Merge remote branch 'ahocevar/wmtscaps' into wmtscaps
Conflicts: lib/OpenLayers/Format/OWSCommon/v1.js tests/Format/WMTSCapabilities/v1_0_0.html
This commit is contained in:
@@ -171,24 +171,24 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
this.readChildNodes(node, dcp.http);
|
||||
},
|
||||
"Get": function(node, http) {
|
||||
http.get = this.getAttributeNS(node,
|
||||
this.namespaces.xlink, "href");
|
||||
if (!http.constraints) {
|
||||
http.constraints = {};
|
||||
if (!http.get) {
|
||||
http.get = [];
|
||||
}
|
||||
var obj = {};
|
||||
var obj = {
|
||||
url: this.getAttributeNS(node, this.namespaces.xlink, "href")
|
||||
};
|
||||
this.readChildNodes(node, obj);
|
||||
http.constraints.get = obj.constraints;
|
||||
http.get.push(obj);
|
||||
},
|
||||
"Post": function(node, http) {
|
||||
http.post = this.getAttributeNS(node,
|
||||
this.namespaces.xlink, "href");
|
||||
if (!http.constraints) {
|
||||
http.constraints = {};
|
||||
if (!http.post) {
|
||||
http.post = [];
|
||||
}
|
||||
var obj = {};
|
||||
var obj = {
|
||||
url: this.getAttributeNS(node, this.namespaces.xlink, "href")
|
||||
};
|
||||
this.readChildNodes(node, obj);
|
||||
http.constraints.post = obj.constraints;
|
||||
http.post.push(obj);
|
||||
},
|
||||
"Parameter": function(node, operation) {
|
||||
if (!operation.parameters) {
|
||||
|
||||
@@ -116,7 +116,7 @@ OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Vers
|
||||
OpenLayers.Util.applyDefaults(config, {
|
||||
url: config.requestEncoding === "REST" && layerDef.resourceUrl ?
|
||||
layerDef.resourceUrl.tile.template :
|
||||
capabilities.operationsMetadata.GetTile.dcp.http.get,
|
||||
capabilities.operationsMetadata.GetTile.dcp.http.get[0].url,
|
||||
name: layerDef.title,
|
||||
style: style.identifier,
|
||||
matrixIds: matrixSet.matrixIds,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
function test_read_exception(t) {
|
||||
t.plan(6);
|
||||
var text = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<ows:ExceptionReport xml:lang="en" version="1.0.0"' +
|
||||
'<ows:ExceptionReport xml:lang="en" version="1.1.0"' +
|
||||
' xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"' +
|
||||
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows/1.1">' +
|
||||
' <ows:Exception locator="foo" exceptionCode="InvalidParameterValue">' +
|
||||
@@ -18,7 +18,7 @@
|
||||
var format = new OpenLayers.Format.OWSCommon();
|
||||
var result = format.read(text);
|
||||
var report = result.exceptionReport;
|
||||
t.eq(report.version, "1.0.0", "Version parsed correctly");
|
||||
t.eq(report.version, "1.1.0", "Version parsed correctly");
|
||||
t.eq(report.language, "en", "Language parsed correctly");
|
||||
var exception = report.exceptions[0];
|
||||
t.eq(exception.code, "InvalidParameterValue", "exceptionCode properly parsed");
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
t.eq(obj.serviceProvider.serviceContact.contactInfo.phone.voice, "+49-251-83-30088", "Voice phone correctly parsed");
|
||||
|
||||
// operationsMetadata (from OWSCommon)
|
||||
t.eq(obj.operationsMetadata.DescribeSensor.dcp.http.post, "http://v-swe.uni-muenster.de:8080/WeatherSOS/sos", "POST url for DescribeSensor correctly parsed");
|
||||
t.eq(obj.operationsMetadata.DescribeSensor.dcp.http.post[0].url, "http://v-swe.uni-muenster.de:8080/WeatherSOS/sos", "POST url for DescribeSensor correctly parsed");
|
||||
var counter = 0;
|
||||
for (var key in obj.operationsMetadata.DescribeSensor.parameters.procedure.allowedValues) {
|
||||
if (counter == 0) {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
t.eq(numOfLayers, 1, "correct count of layers");
|
||||
|
||||
var layer = contents.layers[0];
|
||||
t.eq(layer.abstract, "Coastline/shorelines (BA010)", "layer abstract is correct");
|
||||
t.eq(layer['abstract'], "Coastline/shorelines (BA010)", "layer abstract is correct");
|
||||
t.eq(layer.identifier, "coastlines", "layer identifier is correct");
|
||||
t.eq(layer.title, "Coastlines", "layer title is correct");
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
var dimensions = layer.dimensions;
|
||||
t.eq(dimensions.length, 1, "correct count of dimensions");
|
||||
t.eq(dimensions[0].title, "Time", "first dimension title is correct");
|
||||
t.eq(dimensions[0].abstract, "Monthly datasets", "first dimension abstract is correct");
|
||||
t.eq(dimensions[0]['abstract'], "Monthly datasets", "first dimension abstract is correct");
|
||||
t.eq(dimensions[0].identifier, "TIME", "first dimension identifier is correct");
|
||||
t.eq(dimensions[0]['default'], "default", "first dimension default is correct");
|
||||
t.eq(dimensions[0].values.length, 3, "first dimension has correct count of values");
|
||||
|
||||
Reference in New Issue
Block a user