I'm trying to get the bounds of a vector layer I have using the
getDataExtent function of OpenLayers.Layer.Vector. However, when I use
the function, it returns a null value. Is this a bug in 2.10? I know
previous versions had a bug, but I thought it might be fixed by now.
Below are the relevant portions of my code :
var landunits = new OpenLayers.Layer.Vector("Land Units", {
styleMap: myStyles,
filter: new OpenLayers.Filter({
type:
OpenLayers.Filter.Comparison.NOT_EQUAL_TO,
property: "lat",
value: 0
}),
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://igsaceeswsmwime:8080/geoserver/wfs",
featureType: "lupoints",
featureNS: "
http://igsaceeswsmwime:8080/geoserver/monitoring",
})
});
//Then I try to retrieve the bounds for this layer
map.addLayers([landunits]);
var bounds = landunits.getDataExtent();
map.zoomToExtent(bounds);
-------------------------------------------------
However, this does not work and firebug tells me that bounds variable is
null.
any suggestions?
All the Best,
Dan
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users