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

Support TagFilterButton in PolyLine, AntPath and GeoJson #1756

Merged

Conversation

jamiechoi1995
Copy link
Contributor

Support TagFilterButton in PolyLine, AntPath and GeoJson
Fix #1751

@jamiechoi1995 jamiechoi1995 changed the title Jamiechoi1995 patch 1 Support TagFilterButton in PolyLine, AntPath and GeoJson May 4, 2023
@Conengmo Conengmo self-requested a review May 17, 2023 09:32
@Conengmo
Copy link
Member

Hi Jamie, thanks for your PR! Nice to see that the TagFilterButton works for more than just markers. Since they don't specify this in their own documentation (https:/maydemirx/leaflet-tag-filter-button) I'm hesitant to 'officially' support this in Folium.

I took your branch and added some changes, hope you don't mind.

  • allow the tags parameter in any vector layer, not just PolyLine. Don't add it to the documentation though.
  • allow any extra options in GeoJson as a keyword argument. This makes it possible to use a tags argument.

With this, you will be able to use TagFilterButton with GeoJson, PolyLine and Antpath. But Folium won't officially support it, so no guarantees this will continue working. Since we are dependent on an externally maintained plugin we don't have control over that.

@jamiechoi1995
Copy link
Contributor Author

Your solution is more elegant, looks good to me. 😄

I think supporting this in Folium is needed.
In fact, TagFilterButton claim that they can also support geojson,
https:/maydemirx/leaflet-tag-filter-button/blob/cddc7491f1e3816c120bdf8ca6c0236a09fbe52d/README.md?plain=1#L2
although they have not shown this in their live demo.

@Conengmo
Copy link
Member

Sounds good. I added a specification to the docstring. Once the tests pass we can merge this one.

@Conengmo Conengmo merged commit 9a64cec into python-visualization:main May 24, 2023
@jamiechoi1995 jamiechoi1995 deleted the jamiechoi1995-patch-1 branch May 24, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I filter PolyLine or AntPath
2 participants