[OpenLayers-Commits] r11978 - in trunk/openlayers: lib/OpenLayers/Format/WMSCapabilities tests/Format/WMSCapabilities

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu May 19 10:45:11 EDT 2011


Author: ahocevar
Date: 2011-05-19 07:45:08 -0700 (Thu, 19 May 2011)
New Revision: 11978

Modified:
   trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js
   trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html
Log:
returning Get and Post OnlineResources separately, in addition to the existing href, which is now for get. p=jachym, r=me (closes #3302)

Modified: trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js	2011-05-19 14:02:44 UTC (rev 11977)
+++ trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1.js	2011-05-19 14:45:08 UTC (rev 11978)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for 
+/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for 
  * full list of contributors). Published under the Clear BSD license.  
  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
  * full text of the license. */
@@ -303,14 +303,17 @@
                 this.readChildNodes(node, obj);
             },
             "Get": function(node, obj) {
-                this.readChildNodes(node, obj);
+                obj.get = {};
+                this.readChildNodes(node, obj.get);
             },
             "Post": function(node, obj) {
-                this.readChildNodes(node, obj);
+                obj.post = {};
+                this.readChildNodes(node, obj.post);
             },
             "GetMap": function(node, obj) {
                 obj.getmap = {formats: []};
                 this.readChildNodes(node, obj.getmap);
+                obj.getmap.href = obj.getmap.get.href || obj.getmap.post.href; // backwards compatibility
             },
             "GetFeatureInfo": function(node, obj) {
                 obj.getfeatureinfo = {formats: []};

Modified: trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html
===================================================================
--- trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html	2011-05-19 14:02:44 UTC (rev 11977)
+++ trunk/openlayers/tests/Format/WMSCapabilities/v1_1_1.html	2011-05-19 14:45:08 UTC (rev 11978)
@@ -5,7 +5,7 @@
     
     function test_read(t) {
         
-        t.plan(15);
+        t.plan(17);
 
         var xml = document.getElementById("gssample").firstChild.nodeValue;
         var doc = new OpenLayers.Format.XML().read(xml);
@@ -22,6 +22,16 @@
             "http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&",
             "getmap href parsed"
         );
+        t.eq(
+            getmap.get.href,
+            getmap.href,
+            "getmap.get.href parsed"
+        );
+        t.eq(
+            getmap.post,
+            undefined,
+            "getmap.post not available"
+        );
         
         t.ok(capability.layers, "layers parsed");
         t.eq(capability.layers.length, 22, "correct number of layers parsed");
@@ -422,12 +432,16 @@
       <Format>image/jpeg</Format>
       <DCPType>
         <HTTP>
-
           <Get>
             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
              xlink:type="simple"
-             xlink:href="http://hostname:port/path" />
+             xlink:href="http://hostname:port/path/get" />
           </Get>
+          <Post>
+            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
+             xlink:type="simple"
+             xlink:href="http://hostname:port/path/post" />
+          </Post>
         </HTTP>
       </DCPType>
     </GetMap>



More information about the Commits mailing list