The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.
If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.
Hello, thank you for this tip it seems to be very useful. Unfortunately, I have not managed to make the L.control.mousePosition works with this method within a shiny app. Whenever the plugin works if we launch the leaflet by itself (outside the shiny app). The
onRender
function seems to be the cause of the dysfunction.Here there is a reproducible example of my code (you just have to load the .js and .css files locally, doesn’t work with the link (https://github.com/ardhi/Leaflet.MousePosition/tree/master/src)):
I am sorry but I do not know anything about JS code, I am just a R user and maybe it is obvious but I am totally stuck with that and I really need this plugin for my work.
I would be very greatful if you can help me !
Thank you
Gaël