title: How to set Leaflet layerId using mapview
body: <p>In my shiny app, I would like to click on a polygon of my mapview map and be able to extract the layerId attribute to a variable using <code>input$map_shape_click</code>. In the following code, when you click a polygon, it prints out the id, but it is set to null by default in mapview. </p>
  
  <pre><code>library(shiny)
  library(tmap)
  library(leaflet)
  library(mapview)
  
  ui &lt;- bootstrapPage(
    title = "Standardized Crop Production Index",
    tags$style(type = "text/css", "html, body {width:100%;height:100%}"),
    mapview::mapviewOutput("map", width = "100%", height = "100%")
  )
  
  data("World") #from the tmap library
  
  server &lt;- function(input, output, session) {
  
    out_plot &lt;- observeEvent(input$map_shape_click, {
      p &lt;- input$map_shape_click
      print(p)
    })
  
    output$map &lt;- renderLeaflet({
  
      test &lt;- mapview(World)
      test@map
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Is there a way to set the layerId of a mapview object? I know that I could set it using <code>addPolygons()</code> if I were to just use Leaflet instead of mapview. However, I would eventually like to use the data gathered from clicking the polygon as input into mapview's <code>popupGraph()</code>. </p>
  
  <p>Even better would be if there is a way to retrieve the attributes from the table that pops up when you click a polygon. For example, if I click on Antarctica, the following attribute table pops up: <a href="https://i.stack.imgur.com/Z2eWW.png" rel="nofollow noreferrer">Antarctica Attribute Table</a>. Is there any way to retrieve the "name" attribute and store it as a variable when a polygon  clicked?</p>
  
  <p>Thanks!</p>