title: shiny leaflet ploygon click event
body: <p>I have a map called <code>business</code> which is downloaded from natural earth website. What I am doing here is I created a basic Map output which shows the map. I am mainly using two columns which are <code>admin</code>(which is the name of the country) and <code>economy</code> here. Then I added a drop down list called <code>Business</code> under ui so that when I click the polygon of the country the list would refresh and show the country that I am clicking. I assume when I write <code>p &lt;- input$Map_shape_click</code> shiny would know p is a <code>business</code> object so it has column <code>admin</code> and I have reference this <code>admin</code> ID  to refresh my <code>Business</code> drop down list. But it doesn't work.The link shows what I am seeing - the list wouldn't refresh when I click a different country.</p>
  
  <p><a href="https://i.stack.imgur.com/VPS13.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/VPS13.jpg" alt="enter image description here"></a></p>
  
  <p><strong>server.r</strong></p>
  
  <pre><code>country &lt;- readOGR(dsn = tmp, layer = "ne_110m_admin_0_countries", encoding   = "UTF-8")
  business&lt;-country[country@data$admin %in% c("Brazil","Colombia","Panama","Kazakhstan","Argentina","India","","Chile","Dominican Republic","United Kingdom","El Salvador","United States of America"),]
  business@data$category &lt;- factor(sample.int(20L, nrow(business@data), FALSE))
  
  
  shinyServer(function(input, output,session) {
  
  output$Map &lt;- renderLeaflet({
    factpal &lt;- colorFactor(topo.colors(20), business@data$category)
    state_popup &lt;- paste0("&lt;strong&gt;Name of the country &lt;/strong&gt;", 
                          business$admin, 
                          "&lt;br&gt;&lt;strong&gt; information is  &lt;/strong&gt;", 
                          business$economy)
      leaflet() %&gt;%
      addProviderTiles("CartoDB.Positron") %&gt;%
      addPolygons(data=business,
                  layerId=~admin,
                  fillColor= ~factpal(category),
                  fillOpacity = 0.7, 
                  color = "#BDBDC3", 
                  weight = 1, 
                  popup = state_popup,
                  highlight = highlightOptions(
                  weight = 5,
                  color = "#666",
                  dashArray = "",
                  fillOpacity = 0.7,
                  bringToFront = TRUE))})
  
  
  observeEvent(input$Map_shape_click, { # update the location selectInput on map clicks
    p &lt;- input$Map_shape_click
    if(!is.null(p$admin)){
      if(is.null(input$Business) || input$Business!=p$admin) updateSelectInput(session, "Business", selected=p$admin)
    }
  })
  }
  )
  </code></pre>
  
  <p><strong>ui.r</strong></p>
  
  <pre><code>navbarPage("Market Portal",
  tabPanel("About",
             bootstrapPage(
               leafletOutput("Map",width="100%",height="800px"),
               absolutePanel(top=100, right=50,
               selectInput("Business", "Business", c("Brazil","Colombia","Panama","Kazakhstan","Argentina","India","Chile","Dominican Republic","United Kingdom","El Salvador","United States of America"), selected="")
  ))))
  </code></pre>