[OpenLayers-Users] design advice

Roger Kunkel rakunkel at ucdavis.edu
Tue May 29 18:43:50 EDT 2007


Hi,

I'm in need of some design advice.

My application uses a vector layer created via a WFS call with a  
Filter to query and display intersecting geometries.
This generally works well, but I need to alter the Filter and reload  
the result frequently. So far, I've been destroying the
vector layer and creating a new one each time. Is this an inefficient  
approach? and what sequence of methods should I use?
I noticed there is a removeFeatures() and a destroyFeatures()  
function in vector.js.

Should I just use destroy() and recreate the layer or use  
removeFeatures() and somehow reload the layer.
I also use the selectFeature control - should it also be destroyed  
and recreated.

Thoughts and sample code appreciated.



Roger Kunkel
CERES Program
Dept. of Land Air & Water Resources
UC Davis
rakunkel at ucdavis.edu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070529/a4a64911/attachment.html


More information about the Users mailing list