Skip to content

filter argument in add_line_layer() renders correctly in renderMaplibre, but not in renderMaplibreCompare #198

@twagner-cmap

Description

@twagner-cmap

I have geometry at the county and municipal level. I want the user to be able to toggle between viewing the county data and the municipal data using a select input.
The default selected choice is "county," so I want the map to show only county level data when rendered. The following code works when using maplibreOutput() and renderMaplibre(). The code does not work when using maplibreCompareOutput() and renderMaplibreCompare(). It renders all of the geometry rather than just the filtered geometry.

add_line_layer(
          id = "layer1",
          source = "sf1",
          filter = list("==", get_column("level"), "county"),
          tooltip = "test"
        )

However, after the user changes the selected input once, set_filter() works with the compare proxy in the same way it works with the normal proxy.

app.R.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions