I am using the leaflet package for a Shiny application, and want to include a global switch (<script>L_PREFER_CANVAS = true;</script>
) in the head tag BEFORE the leaflet.js script is called, but the tags$head
function adds the content at the end of the tag after <script src="leaflet-0.7.3/leaflet.js"></script>
so the switch doesn't work. (Source: http://leafletjs.com/reference.html#global)
Is there any way to tell Shiny to add this switch to the beginning of the head tag?