Skip to content

Feature request: dynamic style functions #1112

Open

Description

@Trollgeir

If you have multiple features on a geojson file, it would be handy to keep the features as 'abstract' layers to select which style to be used. By 'abstract' here I mean that they're working on the same data.

An example could be to highlight a set of polygons reflecting feature A in abstract layer 1, while it would highlight feature B in abstract layer 2.

Right now I would have to add the same polygons (geojson) with different style functions to achieve this, essentially duplicating the data. The problem grows with more features I would want to illustrate..

Activity

  1. Conengmo commented on Mar 25, 2019

    @Conengmo
    Member

    Hi @Trollgeir, I think I understand what you mean. We currently don't have that exact functionality in folium.

    We recently merged a change where you can use GeoJson with a style_function and still not embed the data in the html, if you pass a URL or a file path. Would that work for you? You can make multiple GeoJson objects, each with their own style_function, but not embed the data so they can use the same data source.

  2. Trollgeir commented on Mar 25, 2019

    @Trollgeir
    Author

    @Conengmo what merge is this? This could possibly contribute to another issue: #975 (comment)

  3. changed the title [-]Feature request: conditional style functions[/-] [+]Feature request: dynamic style functions[/+] on Mar 25, 2019
  4. Conengmo commented on Mar 25, 2019

    @Conengmo
    Member

    That was #1058.

    As I understood it #975 is more about general solutions to reduce the html size, not about optimizing a single class (like GeoJson). Though of course ideas to improve are welcome whatever their scope. But if you want to talk about GeoJson specifically let's open a new issue.

  5. added
    enhancement
    on Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions