[OpenLayers-Users] Reusing Strategy objects

Matthew Foster matthew.foster at noaa.gov
Wed Jul 18 11:48:33 PDT 2012


I've found that reusing a strategy object on more than one layer doesn't
work...at least not for me.  For example, if I do something like this...

...
filter = new OpenLayers.Filter.Comparison({...});
strat = new OpenLayers.Strategy.Filter({filter: filter});
layer1 = new OpenLayers.Layer.Vector("Layer1", {strategies: [strat]...});
layer2 = new OpenLayers.Layer.Vector("Layer2", {strategies: [strat]...});

The filter strategy does not work on either layer.  If I create a unique
strategy object for each layer, it works fine.  I've found this to be true
of both Filter and Refresh strategy objects.

Is this a known issue?  Is it not an issue, and I am trying to do something
I should not be?

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120718/e9447f65/attachment.html>


More information about the Users mailing list