returning Get and Post OnlineResources separately, in addition to the existing href, which is now for get. p=jachym, r=me (closes #3302)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11978 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -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.
|
* full list of contributors). Published under the Clear BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
@@ -303,14 +303,17 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class(
|
|||||||
this.readChildNodes(node, obj);
|
this.readChildNodes(node, obj);
|
||||||
},
|
},
|
||||||
"Get": function(node, obj) {
|
"Get": function(node, obj) {
|
||||||
this.readChildNodes(node, obj);
|
obj.get = {};
|
||||||
|
this.readChildNodes(node, obj.get);
|
||||||
},
|
},
|
||||||
"Post": function(node, obj) {
|
"Post": function(node, obj) {
|
||||||
this.readChildNodes(node, obj);
|
obj.post = {};
|
||||||
|
this.readChildNodes(node, obj.post);
|
||||||
},
|
},
|
||||||
"GetMap": function(node, obj) {
|
"GetMap": function(node, obj) {
|
||||||
obj.getmap = {formats: []};
|
obj.getmap = {formats: []};
|
||||||
this.readChildNodes(node, obj.getmap);
|
this.readChildNodes(node, obj.getmap);
|
||||||
|
obj.getmap.href = obj.getmap.get.href || obj.getmap.post.href; // backwards compatibility
|
||||||
},
|
},
|
||||||
"GetFeatureInfo": function(node, obj) {
|
"GetFeatureInfo": function(node, obj) {
|
||||||
obj.getfeatureinfo = {formats: []};
|
obj.getfeatureinfo = {formats: []};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
function test_read(t) {
|
function test_read(t) {
|
||||||
|
|
||||||
t.plan(15);
|
t.plan(17);
|
||||||
|
|
||||||
var xml = document.getElementById("gssample").firstChild.nodeValue;
|
var xml = document.getElementById("gssample").firstChild.nodeValue;
|
||||||
var doc = new OpenLayers.Format.XML().read(xml);
|
var doc = new OpenLayers.Format.XML().read(xml);
|
||||||
@@ -22,6 +22,16 @@
|
|||||||
"http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&",
|
"http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&",
|
||||||
"getmap href parsed"
|
"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.ok(capability.layers, "layers parsed");
|
||||||
t.eq(capability.layers.length, 22, "correct number of layers parsed");
|
t.eq(capability.layers.length, 22, "correct number of layers parsed");
|
||||||
@@ -422,12 +432,16 @@ Changes:
|
|||||||
<Format>image/jpeg</Format>
|
<Format>image/jpeg</Format>
|
||||||
<DCPType>
|
<DCPType>
|
||||||
<HTTP>
|
<HTTP>
|
||||||
|
|
||||||
<Get>
|
<Get>
|
||||||
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
xlink:type="simple"
|
xlink:type="simple"
|
||||||
xlink:href="http://hostname:port/path" />
|
xlink:href="http://hostname:port/path/get" />
|
||||||
</Get>
|
</Get>
|
||||||
|
<Post>
|
||||||
|
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xlink:type="simple"
|
||||||
|
xlink:href="http://hostname:port/path/post" />
|
||||||
|
</Post>
|
||||||
</HTTP>
|
</HTTP>
|
||||||
</DCPType>
|
</DCPType>
|
||||||
</GetMap>
|
</GetMap>
|
||||||
|
|||||||
Reference in New Issue
Block a user