R leaflet map, add button that expands on hover and shows some text

891 views Asked by At

Expanding on an example from addEasyButton in RStudios leaflet package, I wonder if it is possible to create a button that automatically expands on hover to show some text? Something like the code below, but not via alert on click but via expand on hover (behaving similar to the layer control button).

library(leaflet)

leaflet() %>% 
  addTiles() %>% 
  addEasyButton(
    button = easyButton(
      icon = 'fa-info',
      onClick = JS('function(btn, map){ alert("sometext"); }')
    )
  )
0

There are 0 answers