Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using multiple tag filters in same map #10

Closed
warudin opened this issue Mar 24, 2017 · 14 comments
Closed

using multiple tag filters in same map #10

warudin opened this issue Mar 24, 2017 · 14 comments
Labels
Milestone

Comments

@warudin
Copy link

warudin commented Mar 24, 2017

Hi there,

I would like to use Tag Filter Button, but I'm having a problem. I've added multiple filter buttons, but they are not working together.

Per example:
I want to filter projects in their status (active, ended), but I also want to filter on their topic (trees, plants, animals). So if I use a button to filter on the status 'active' and the topic 'plants', I would like to see only the instances that contain both tags. At the moment only one of two filter tags are used in the filtering, the last one clicked.

I understand that this use case might outside of the scope of the initial project, but I'd like to know if it'd be possible to implement something like this. If not, I'm gonna have to find another solution to my problem.

@maydemirx
Copy link
Owner

maydemirx commented Mar 25, 2017

Maybe, you have to move your features to different layers. Then, you have to use registerCustomSource function. Create an object per each layer. Each object must be contains name and hide function. You have to implement hide function

@warudin
Copy link
Author

warudin commented Mar 27, 2017

I'm not sure if I'm fully understanding your comment. I want to use multiple buttons to filter the same markers. A project could be either active or inactive and also be about different plans.

I've got a list like this (in reality it contains tens of instances):

  1. Project A - Tomato - active
  2. Project B - Tomato - ended
  3. Project C - Tomato - ended
  4. Project D - Strawberry - active
  5. Project E - Strawberry - ended
  6. Project F - Cherry - active
  7. Project G - Cherry - ended

So if the user selects Tomato and Active projects, I want only item 1 to appear and so on. Would this be possible with Tag Filter Button? Could you even maybe provide an example?

@maydemirx
Copy link
Owner

maydemirx commented Mar 27, 2017

You can add two tag filter button to your map. First filter button data must be active and ended and second button data must be contains tomato,cherry etc. Add active or ended and related project as tag option to your markers. Try this. Sorry, i can not add an example right now. Thanks

@warudin
Copy link
Author

warudin commented Mar 27, 2017

I managed to get multiple buttons, but the filtering function doesn't use both buttons.

So if the user first clicks 'ended' on the first button and then 'tomato' on the second one, projects 1, 2 and 3 are shown (all Tomato-projects) instead of only number 2 & 3 (ended Tomato-projects).

@maydemirx
Copy link
Owner

Ok i will check. it seems there is a bug. İf you prepare a little jsfiddle i can fix the bug faster

@warudin
Copy link
Author

warudin commented Mar 28, 2017

Here you go, hope you can find out what goes wrong!

https://jsfiddle.net/DominiquePijnenburg/wx4oqejg/

@maydemirx
Copy link
Owner

maydemirx commented Mar 28, 2017

Ok i understand the question right now. And sory this use case not possible. Because first filter button shows active markers then second filter button searches tomato markers and clears previous search. Wé need a new idea for this use case. İf you have a new idea, like related filter buttons you can send pull request

@warudin
Copy link
Author

warudin commented Mar 28, 2017

Thanks for your response. It's a pity we won't be able to do this right away, I will try to find a solution.

@maydemirx
Copy link
Owner

Ok i will chang this request type from "question" to "feature" and i will be happy develop this feature.

@maydemirx maydemirx added this to the v0.0.4 milestone Mar 29, 2017
maydemirx pushed a commit that referenced this issue Apr 5, 2018
added nice docs. thanks to "Xiaoying Riley"
maydemirx added a commit that referenced this issue Apr 5, 2018
fixed "using multiple tag filters in same map #10" issue.
@prologonline
Copy link

In you example, if i check Active, then check Cherry, it seems ok. But now if i uncheck Active, and only the Cherry is stay checked, but visually on map we have wrong result(.

@prologonline
Copy link

Needed a method
update() | void | Updates markers with last (All) selected tags.

@prologonline
Copy link

And also, tell me, is the script compatible with LeafletMarkerCluster? Thanks.

@maydemirx
Copy link
Owner

In you example, if i check Active, then check Cherry, it seems ok. But now if i uncheck Active, and only the Cherry is stay checked, but visually on map we have wrong result(.

Please reopen issue or create a new issue

@maydemirx
Copy link
Owner

And also, tell me, is the script compatible with LeafletMarkerCluster? Thanks.

Not compatible yet. But you can check #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants