addEasyButton() call R code rather than JS

Hi there,

I'd like to add a EasyButton to my Leaflet map, however I want it to run methods from my R code, not JavaScript code. Is there a way to do this? I don't want to have a Shiny button as this doesn't fit with the rest of the UI.

For example:

addEasyButton(easyButton(icon="fa-tint", onClick=myMethodHere()))

Rather than:

addEasyButton(easyButton(icon="fa-tint", onClick=JS(some java script)))

Many thanks!

you can send a message from JS to R to achieve this, see scenario 2

1 Like

Awesome, thanks for the response! I'll give it a go!

Many thanks, this worked a treat!

1 Like