title: Select or highlight data on map by click on legend
body: <p>Is there any way to select or highlight data on a leaflet map in by clicking on the legend in Rshiny?
  example code:</p>
  
  <pre><code>library(shiny)
  library(leaflet)
  library(RColorBrewer)
  library(leafletGeocoderRshiny)
  
  ui &lt;- fluidPage(
    leafletOutput("map"),
    p(),
    actionButton("recalc", "New points")
  )
  
  server &lt;- function(input, output, session) {
  
    df = data.frame(x = rnorm(100), y = rexp(100, 2), z = runif(100))
    pal = colorBin('PuOr', df$z, bins = c(0, .1, .4, .9, 1))
  
    output$map &lt;- renderLeaflet({ leaflet(df) %&gt;%
      addCircleMarkers(~x, ~y, color = ~pal(z)) %&gt;%
      addLegend(pal = pal, values = ~z)
    })
  
  }
  
  shinyApp(ui, server) 
  </code></pre>