TR: [OpenLayers-Users] WFS layer data extent and loading strategies

Favre, Sebastien Sebastien.Favre at spotimage.fr
Tue May 17 10:14:04 EDT 2011


Hello Eric,

I have tried to use : wfs.events.on({'loadend': function() { var extent = wfs.getDataExtent(); }}); But when the loading strategy is BBOX, extent is NULL if there is no feature to display on the map current bounding box.
If there are some features to display from the layer , extent has a value. 
If the loading strategy is FIXED, extent has always a value.
It seems logical but do you have any alternative to get data extent of a layer with BBOX loading strategy ?
Thank you.

Sébastien

-----Message d'origine-----
De : Eric Lemoine [mailto:eric.lemoine at camptocamp.com]
Envoyé : mardi 17 mai 2011 15:43
À : Favre, Sebastien
Cc : users at openlayers.org
Objet : Re: [OpenLayers-Users] WFS layer data extend ans loading strategies

2011/5/17 Favre, Sebastien <Sebastien.Favre at spotimage.fr>:
> Hello to all,
>
> I'm trying to use function getDataExtent() on a WFS layer object.
> The function works well when the loading strategy of the layer is FIXED.
> When loading strategy is BBOX, function returns NULL.
> Does someone has a solution to know max extent of the layer objects using a BBOX loading strategy ?

Do you call getDataExtent from a loadend listener? If not, you should.

wfs.events.on({'loadend': function() { var extent = wfs.getDataExtent(); }});

Good luck.

--
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

-------------- next part --------------

Ce courrier électronique et toutes les pièces éventuellement jointes qu?il contient sont CONFIDENTIELS et destinés exclusivement à l?usage de leur destinataire. Si une erreur de transmission ou une adresse erronée a mal dirigée ce courrier, merci d?en informer l?expéditeur en lui faisant une réponse par courrier électronique dès réception. Si vous n?êtes pas le destinataire de ce courrier, vous ne devez pas l?utiliser, le conserver, en faire état, le distribuer, le copier, l?imprimer ou en révéler le contenu à une tierce partie.
Ce courrier électronique est à usage strictement informatif et ne saurait engager de quelque manière que ce soit SPOT IMAGE SA, ni ses filiales.

This e-mail and any attachments hereto are CONFIDENTIAL and intended solely for the use of the addressee. If you have received this e-mail in error please send it back to the person that sent it to you.
If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it.
This email is for information only and will not bind SPOT IMAGE SA in any contract or obligation, nor its subsidiaries.


More information about the Users mailing list