if (FALSE) {
library(mapgl)
# Basic custom control
maplibre() |>
add_control(
html = "
Custom HTML
",
position = "top-left"
)
# Custom control with specific ID for selective removal
maplibre() |>
add_control(
html = "
My Control
",
position = "top-right",
id = "my_custom_control"
)
# Later, remove only this specific control
maplibre_proxy("map") |>
clear_controls("my_custom_control")
}
Run the code above in your browser using DataLab