SRS sent with WFS requests should match projection of requested extents.
(Closes #1537) git-svn-id: http://svn.openlayers.org/trunk/openlayers@7415 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -433,7 +433,7 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
|
||||
* altUrl - {String} Use this as the url instead of the layer's url
|
||||
*/
|
||||
getFullRequestString:function(newParams, altUrl) {
|
||||
var projectionCode = this.map.getProjection();
|
||||
var projectionCode = this.projection.getCode() || this.map.getProjection();
|
||||
this.params.SRS = (projectionCode == "none") ? null : projectionCode;
|
||||
|
||||
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
|
||||
|
||||
@@ -129,6 +129,16 @@
|
||||
t.eq(layer.tile.url, "http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?typename=OWLS&maxfeatures=10&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A4326&BBOX=-187.890625%2C-36.679687%2C-12.109375%2C156.679688", "Tile URL is set correctly when not encoded");
|
||||
map.destroy();
|
||||
}
|
||||
function test_projection_srs(t) {
|
||||
t.plan(1);
|
||||
var map = new OpenLayers.Map('map');
|
||||
map.addLayer(new OpenLayers.Layer("",{isBaseLayer: true} ));
|
||||
var layer = new OpenLayers.Layer.WFS("","",{},{'projection': new OpenLayers.Projection("EPSG:900913")});
|
||||
map.addLayer(layer);
|
||||
map.zoomToMaxExtent();
|
||||
var params = OpenLayers.Util.getParameters(layer.getFullRequestString());
|
||||
t.eq(params.SRS, "EPSG:900913", "SRS represents projection of WFS layer, instead of map (#1537)");
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user