title: shiny leaflet mouseover popup
body: <p>I would like to build a shiny app that has a popup show up when the mouse goes over a shape/circle rather than the standard click</p>
  
  <p>in particular i am trying to get the popup show as the mouse hovers over...and it disappears as the mouse moves away from it.</p>
  
  <p>This page (<a href="https://rstudio.github.io/leaflet/shiny.html" rel="noreferrer">https://rstudio.github.io/leaflet/shiny.html</a>) would suggest i need to have something like an <code>observeEvent({input$mymap_shape_mouseover},{showPopup()})</code></p>
  
  <p>but not sure where to enter it or how to use it, so any help would be much appreciated.</p>
  
  <p>Below is a simple random example...</p>
  
  <pre><code>    library(shiny)
      library(leaflet)
      library(data.table)
  
  
      uu &lt;-  data.table(row_num=seq(100),
                      Latitude=c(52+cumsum(runif(100,-0.001,0.001))),
                      Longitude=c(1+cumsum(runif(100,-0.001,0.001)))
      )
  
  
  
  
  
    ui &lt;- fluidPage(
      leafletOutput("mymap")
    )
  
    server &lt;- function(input, output, session) {
      output$mymap &lt;- renderLeaflet({
        leaflet() %&gt;%
          addTiles() %&gt;%
          addCircles(lng=uu$Longitude,
                     lat=uu$Latitude,
                     radius=2)
      })
  
      # Show a popup at the given location
      show_popup_on_mouseover &lt;- function(id, lat, lng) {
        selected_point &lt;- uu[row_num == id,]
        content &lt;- as.character(selected_point$row_num)
        leafletProxy("mymap") %&gt;% 
          addPopups(lng, lat, content)
      }
  
  
      # When circle is hovered over...show a popup
      observe({
        leafletProxy("mymap") %&gt;% clearPopups()
        event &lt;- input$mymap_shape_mouseover
        print(event)
        if (is.null(event)){
          return()
        } else {
          isolate({
            show_popup_on_mouseover(event$id, event$lat, event$lng)
          })
        }
      })
  
  
    }
  
    shinyApp(ui, server)
  </code></pre>