[Users] FeatureStore filter

Christian Spanring christian at spanring.eu
Tue Nov 17 22:36:21 CET 2009


Thanks!

However, I'm not sure if

myvectorlayer.filter( ... )

works with a GeoJSON layer at all, at least it didn't for me. So, what
I ended up doing is rule-based styling with my filter criteria and
basically hiding non-filtered features with

OpenLayers.Rule({
   elseFilter: true,
   symbolizer: {
      strokeOpacity: 0,
       fillOpacity: 0
    }
});

Clearly not the most elegant method, but it seems to work.

Christian

On Tue, Nov 17, 2009 at 1:44 PM, Matt Priour
<mpriour at kestrelcomputer.com> wrote:
> That is because the ExtJS store filter does not affect the underlying data
> in the store, it just affects what records are available.
> To filter the features on the map you would also need to apply a filter to
> the vector layer as well.
>
> ie:
> MyFeatureStore.layer.filter(new
> OpenLayer.Filter.Comparision({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:"key",value:"value"}));
>
> If you actually deleted a record from the store, then that feature should be
> deleted from the layer.
>
> Matt Priour
> Kestrel Computer Consulting
>
> --------------------------------------------------
> From: "Christian Spanring" <christian at spanring.eu>
> Sent: Tuesday, November 17, 2009 12:29 PM
> To: <users at geoext.org>
> Subject: [Users] FeatureStore filter
>
>> Hi,
>>
>> I'm trying to apply a filter to a FeatureStore (GeoJSON format) and
>> would like to synchronize it with the features drawn on the map.
>> Using
>>
>> MyFeatureStore.filter("key","value");
>>
>> filters my records nicely in the GridPanel, but I'm not sure if that's
>> the right way to go, since it doesn't seem to affect the features on
>> the map (a
>>
>> myvectorlayer.refresh({force: true});
>>
>> didn't help either).
>>
>> Any hints in this direction are highly appreciated!
>>
>> Thanks!
>>
>> Christian
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>
>


More information about the Users mailing list