Reputation: 97
I wanted to remove draw control from a Mapbox map in Shiny R based on a observeEvent. I am using mapgl package
output$map <-renderMapboxgl({
mapboxgl() %>%
add_navigation_control() %>%
add_draw_control()
...})
Once a shape has been provided, I would like to remove the
add_draw_control()
but keep the other controls. mapgl
package provides an option to clear_controls
which removes all, but there is no option to remove specific controls. I wanted to remove it (see image) based on observeEvent
e.g.
observeEvent(input$xyz, {
mapboxgl_proxy("map") %>% clear_controls([here I want to be able to
specify what to remove...])
or any other solution that removes the draw control only.
Upvotes: 0
Views: 29