title: How to can i add two different markers with two different inputs in R shiny?
body: <p>I am trying to add two different markers for two different inputs. I got the first one working but not for the second one. Here is my code</p>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  library(leaflet)
  
  
  shinyUI(fluidPage(
  
  
    # Application title
    titlePanel("Aspen GBS Population Structure results on map"),
  
    # Side bar layout
    sidebarLayout(
      sidebarPanel(
        selectInput("structure", label = "Select K for display", choices = c("2", "3", "4", "5", "6"), selected = "2"),
        checkboxInput("origin", label = "Flood path")),
  
        mainPanel(
      leafletOutput("map")
        )
      )
    )
  )
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>leafIcons &lt;- icons(
    iconUrl = ifelse(data_K2$FP_Icon == "greenleafIcon",
                     "http://leafletjs.com/docs/images/leaf-green.png",
                     "http://leafletjs.com/docs/images/leaf-red.png"
    ),
    iconWidth = 38, iconHeight = 95,
    iconAnchorX = 22, iconAnchorY = 94,
    shadowUrl = "http://leafletjs.com/docs/images/leaf-shadow.png",
    shadowWidth = 50, shadowHeight = 64,
    shadowAnchorX = 4, shadowAnchorY = 62
  )
  
  
  
  
  library(shiny)
  
  
  shinyServer(function(input, output, session) {
      dt &lt;- reactive(
          switch(input$structure,
                "2" = data_K2$Structure.2,
                "3" = data_K2$Structure.3))
  
      output$map &lt;- renderLeaflet(
        leaflet(data = data_K2) %&gt;% addTiles() %&gt;% setView(lng = -106.1039361,lat = 50.543981, zoom = 4) %&gt;% 
        addCircleMarkers(lat = ~Lat, lng = ~Long, popup = ~Location_discription, radius=2, color = ~dt(), fill = TRUE) %&gt;%
        addMarkers(lat = ~Lat, lng = ~Long, popup = ~Location_discription, icon = leafIcons)
      )
  })
  </code></pre>
  
  <p>I want the <code>addMarkers</code> to get activated when i use the <code>checkboxInput</code> button only. But right now it is selected by default.</p>