I want to leaflet layers interact with sidebar in bslib

I am intermediate to R. This is my first time using bslib package and I would like to have the map layers be selected in the sidebar. I am having trouble how to do this. This is the function I have created, it has more lines, just example. Let me know your thoughts! Thank you.

map <- leaflet( options = leafletOptions(
  crs = leafletCRS("L.CRS.EPSG3857"),
  doubleClickZoom = FALSE,
  maxZoom = 26
  addScaleBar( position = "bottomleft",
               options = scaleBarOptions(imperial = FALSE)) %>%
  #add base mapping and trenches
  addPolygons(data = vectorWater,
              group = "Base Mapping",
              fillColor = "#17baff",
              color = "#17baff",
              opacity = 1,
              fillOpacity = 0.4,
              weight = 1,
              options = pathOptions(interactive = FALSE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.