[OpenLayers-Users] maxFeatures and BBOX..

Eric Lemoine eric.lemoine at camptocamp.com
Mon Dec 7 09:58:26 EST 2009


On Mon, Dec 7, 2009 at 3:37 PM, JuKiM <rifins at gmail.com> wrote:
> Hi,
> I'm trying to create  a vector layer from a WFS, and limiting to 150
> features, in this way:
> wfs = new OpenLayers.Layer.Vector("WFS", {
>     strategies: [new OpenLayers.Strategy.BBOX()],
>         protocol: new OpenLayers.Protocol.WFS({
>             url: "http://localhost:8080/geoserver/wfs",
>             featureType: "test_points",
>             featureNS: "http://www.mapmap.org/g4wd",
>             extractAttributes: false,
>             maxFeatures: "150"
>         }),
>         styleMap: myStyles
>     });
> And the 150 features are displayed ok. The best way to refresh the features
> when zooming or moving, is to catch each event and call to the refresh
> method of the vector layer? Or is there any way to make an automatic

the BBOX strategy should handle this for you. Use resFactor:1 in the
BBOX strategy options if you want the strategy to fetch new features
also when zooming in.

Hope this helps,
-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list