[OpenLayers-Users] How to load Vector Data depending on MaxScaleDenominator RuleBased Style

Ignacio Talavera ignacio.talavera at gmail.com
Wed Jun 15 12:13:58 EDT 2011


Hi, I'm working with Vector layer and I have a big amount of data to
process; the problem is that the browser crashes while trying to load all
this data. I'm using a rule based Style with a MaxScaleDenominator, under
the assumption that the data will be loaded on demand depending on the zoom
level. But unfortunately OL makes the WFS request to retrieve ALL Data,
instead of only the data I need. In conclusion: is there an OpenLayers
strategy to load only the data needed for the zoom level I am using? It
would have to be some kind of on demand loading, depending of the Max and
Min ScaleDenominator; instead of retrieving all features and filtering in
client. Thanks.

Heres is a code snippet.

var paradas_wfs = new OpenLayers.Layer.Vector(
"paradas_vector",
{
styleMap: getRuleBasedStyleMap(),
reportError: true,
strategies : [ new OpenLayers.Strategy.BBOX()],
projection : new OpenLayers.Projection("EPSG:900913"),
protocol : new OpenLayers.Protocol.WFS(
{
version : "1.1.0",
srsName : "EPSG:900913",
url : geoserverWFSURL,
featureType : featureType,
featureNS : "http://www.imm.gub.uy",
featurePrefix : "imm",
geometryName : "the_geom",
schema : geoserverWFSURL
+ "?service=WFS&version=1.1.0&request=DescribeFeatureType&TypeName="
+ typeName
})

});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110615/cad1da93/attachment-0001.html


More information about the Users mailing list