最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

r - Remove draw control only in mapgl clear_controls() - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论