From f95532ab6f6498489ab2d03e7ccf6e19f9a71f49 Mon Sep 17 00:00:00 2001 From: bartvde Date: Wed, 12 May 2010 14:26:50 +0000 Subject: [PATCH] There can be more than one observedProperty per offering in SOS GetCapabilities, p=sonxurxo, r=me (closes #2548) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10314 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/sos.html | 4 ++-- lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js | 5 +++-- tests/Format/SOSCapabilities/v1_0_0.html | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/sos.html b/examples/sos.html index 5483881bf8..a5d9f31512 100644 --- a/examples/sos.html +++ b/examples/sos.html @@ -69,7 +69,7 @@ getTitleForObservedProperty: function(property) { for (var name in this.SOSCapabilities.contents.offeringList) { var offering = this.SOSCapabilities.contents.offeringList[name]; - if (offering.observedProperty === property) { + if (offering.observedProperties[0] === property) { return offering.name; } } @@ -131,7 +131,7 @@ responseMode: 'inline', procedure: feature.attributes.id, offering: name, - observedProperty: offering.observedProperty, + observedProperty: offering.observedProperties[0], responseFormat: this.responseFormat }); OpenLayers.Request.POST({ diff --git a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js index bfdcf8b491..0073296bc7 100644 --- a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js @@ -115,6 +115,7 @@ OpenLayers.Format.SOSCapabilities.v1_0_0 = OpenLayers.Class( var id = this.getAttributeNS(node, this.namespaces.gml, "id"); offeringList[id] = { procedures: [], + observedProperties: [], featureOfInterestIds: [], responseFormats: [], resultModels: [], @@ -131,8 +132,8 @@ OpenLayers.Format.SOSCapabilities.v1_0_0 = OpenLayers.Class( this.namespaces.xlink, "href")); }, "observedProperty": function(node, offering) { - offering.observedProperty = this.getAttributeNS(node, - this.namespaces.xlink, "href"); + offering.observedProperties.push(this.getAttributeNS(node, + this.namespaces.xlink, "href")); }, "featureOfInterest": function(node, offering) { offering.featureOfInterestIds.push(this.getAttributeNS(node, diff --git a/tests/Format/SOSCapabilities/v1_0_0.html b/tests/Format/SOSCapabilities/v1_0_0.html index 9987bf3bf8..7b13185e3a 100644 --- a/tests/Format/SOSCapabilities/v1_0_0.html +++ b/tests/Format/SOSCapabilities/v1_0_0.html @@ -57,7 +57,7 @@ // Contents (from SOS) t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.name, "Pressure of the atmosphere", "Name of offering correctly parsed"); - t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.observedProperty, "urn:x-ogc:def:property:OGC::BarometricPressure", "ObservedProperty correctly parsed"); + t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.observedProperties[0], "urn:x-ogc:def:property:OGC::BarometricPressure", "ObservedProperty correctly parsed"); t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.featureOfInterestIds[0], "urn:ogc:object:feature:OSIRIS-HWS:3d3b239f-7696-4864-9d07-15447eae2b93", "Allowed value (1) for featureOfInterest correctly parsed"); t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.featureOfInterestIds[1], "urn:ogc:object:feature:OSIRIS-HWS:efeb807b-bd24-4128-a920-f6729bcdd111", "Allowed value (2) for featureOfInterest correctly parsed"); t.eq(obj.contents.offeringList.ATMOSPHERIC_PRESSURE.procedures[0], "urn:ogc:object:feature:OSIRIS-HWS:3d3b239f-7696-4864-9d07-15447eae2b93", "Allowed value (1) for procedures correctly parsed");