fix for WFS Layer getDataExtent always pulls from markers subclass, r=tschaub
(Closes #1725) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8929 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -532,5 +532,24 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIMethod: getDataExtent
|
||||||
|
* Calculates the max extent which includes all of the layer data.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* {<OpenLayers.Bounds>}
|
||||||
|
*/
|
||||||
|
getDataExtent: function () {
|
||||||
|
var extent;
|
||||||
|
//get all additions from superclasses
|
||||||
|
if (this.vectorMode) {
|
||||||
|
extent = OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this);
|
||||||
|
} else {
|
||||||
|
extent = OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return extent;
|
||||||
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Layer.WFS"
|
CLASS_NAME: "OpenLayers.Layer.WFS"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,6 +15,16 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_Layer_WFS_getDataExtent(t) {
|
||||||
|
t.plan(1);
|
||||||
|
|
||||||
|
var layer = new OpenLayers.Layer.WFS(name, "url", {});
|
||||||
|
layer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0, 0)));
|
||||||
|
layer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0, 1)));
|
||||||
|
t.eq(layer.getDataExtent().toBBOX(), "0,0,0,1", "bbox is correctly pulled from vectors.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function test_Layer_WFS_destroy(t) {
|
function test_Layer_WFS_destroy(t) {
|
||||||
t.plan(13);
|
t.plan(13);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user