disable layer at start leaflet

1,627 views
Skip to first unread message

John froeschke

unread,
Sep 22, 2015, 10:10:14 AM9/22/15
to Shiny - Web Framework for R
Enter code here...

Hi, I'm building a shiny app https://gulfcouncilportal
shinyapps.io/coralhapc with four layers.  I would like one layer (i.e., coral locations) to be turned off by default while the others are "on".  The relevant bit of code is below.  Any guidance on how to accomplish this would be greatly appreciated. 


addLayersControl(
  overlayGroups = c("HAPCs with fishing restrictions", "Proposed HAPCs", 
                    "HAPCs without fishing restrictions", "Coral locations"),
  position=c("bottomleft"),
  options = layersControlOptions(collapsed = FALSE)
                )

John froeschke

unread,
Sep 22, 2015, 10:22:55 AM9/22/15
to Shiny - Web Framework for R

Joe Cheng

unread,
Sep 22, 2015, 3:01:20 PM9/22/15
to John froeschke, Shiny - Web Framework for R
You can use the hideGroup() function to control it. This is documented at the bottom of this page under "Programmatic Layer Display".

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/76a0f74a-56a7-4339-8d45-e05ae2527ddd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages