This constraint exists because add_x_layer() updates all of a layer's props, but the layer's visibility cannot (currently) be known in shiny. Updating a layer's visibility every time a reactive changes would be an irritating user experience.
Proposed change: visible = NULL to use the state in the browser, TRUE / FALSE to change it.
Example:
observe({
rdeck_proxy("map") |>
add_h3_hexagon_layer(
id = "layer_id",
data = some_new_data(),
# client = truth
visible = NULL,
)
})
A layer's visibility cannot be changed if the following conditions are met:
rdeck_proxy
layer_selector = TRUE
and layervisibility_toggle = TRUE
https://github.com/anthonynorth/rdeck/blob/master/widget/widget.tsx#L49-L50
This constraint exists because add_x_layer() updates all of a layer's props, but the layer's visibility cannot (currently) be known in shiny. Updating a layer's visibility every time a reactive changes would be an irritating user experience.
Proposed change:
visible = NULL
to use the state in the browser, TRUE / FALSE to change it.Example: