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.
@nash1119 @rickyars @Bignoozer @chintanp please take a look at the question below:
https://stackoverflow.com/questions/52846472/leaflet-plugin-and-leafletproxy-with-polylinedecorator-as-example
It worked for my case as a workaround. You need to anticipate what is coming by creating a function associated to an event listener inside
onRender
, and call this directly onleaflet
, notleafletProxy
.Maybe @jcheng5 could have some idea on why the main approach described in this gist doesn't work well with
leafletProxy
.