Ticket #2841 (closed feature: fixed)

Opened 3 years ago

Last modified 3 years ago

Filter strategy constructor should not need filter

Reported by: bartvde Owned by: fredj
Priority: minor Milestone: 2.11 Release
Component: Strategy.Filter Version: 2.10
Keywords: Cc:
State: Commit

Description (last modified by bartvde) (diff)

My use case is: at the startup of my application, I want to show all features. Then later on users can control the visibility of features by using checkboxes in a legend, so I will use setFilter then. However, now I have to instantiate my Filter strategy with something like (a filter that matches everything):

    new OpenLayers.Strategy.Filter({
        filter: new OpenLayers.Filter.Comparison({type: OpenLayers.Filter.Comparison.LIKE, property: 'categorie', value: ''})
    })

How about allowing instantiating the strategy with no filter?

Attachments

openlayers-2841.patch Download (1.2 KB) - added by bartvde 3 years ago.
2841.patch Download (1.7 KB) - added by tschaub 3 years ago.
filter strategy without filter

Change History

Changed 3 years ago by bartvde

  • component changed from Strategy to Strategy.Filter

Changed 3 years ago by bartvde

Changed 3 years ago by bartvde

  • state set to Review

Tests still pass in FF 3.6, please review.

Changed 3 years ago by bartvde

  • description modified (diff)

Changed 3 years ago by fredj

  • state changed from Review to Commit

Changed 3 years ago by tschaub

filter strategy without filter

Changed 3 years ago by tschaub

There's no reason to take all features off the event and then push them back. If you agree, please commit the version I put up.

Changed 3 years ago by bartvde

Thanks Tim, that makes more sense indeed.

Changed 3 years ago by bartvde

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.