[OpenLayers-Users] rules with multiple filters ?
Didrik Pinte
lists at dipole-consulting.com
Tue Nov 4 11:03:42 EST 2008
On Tue, 2008-11-04 at 16:48 +0100, Didrik Pinte wrote:
> I guess I found the answer (not tested)
>
> Using a Filter.Logical object should solve the problem
>
> var filter1 = new OpenLayers.Filter.Comparison(
> {
> type: OpenLayers.Filter.Comparison.EQUAL_TO,
> property: "count",
> value: 1,
> });
> var filter2 = new OpenLayers.Filter.Comparison(
> {
> type: OpenLayers.Filter.Comparison.EQUAL_TO,
> property: "tree_class",
> value: 1,
> });
>
> var filterAll = new OpenLayers.Filter.Logical({filters: [filter1,
> filter2], type: OpenLayers.Filter.Locical.AND});
The combination of filters works fine BUT the cluster strategy does not
allow me to access the tree_class attribute from my feature.
The cluster "hides" the features it contains in an array object named
cluster. Thus, if cluster contains only one feature, I can access it
like this :
mycluster.cluster[0].attributes.tree_class
How can I do that with the filters ? Could we imagine that when the
cluster holds only one feature, it exposes this feature attributes ?
Didrik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081104/d49bd3ea/attachment.bin
More information about the Users
mailing list