The funciton addSearchGoogle
from leaflet.extras
is throwing this error in a Shiny-app:
Warning in renderWidget(instance) : Ignoring appended content; appendContent can't be used in a Shiny render call
The problem is this line: https://github.com/trafficonese/leaflet.extras/blob/master/R/search.R#L210
Somehow it is not possible to use this function htmlwidgets::appendContent
anymore.
Does anyone know how to solve this issue? What is the new way of doing that or is that strictly forbidden now?
I tried something like this:
map$dependencies <- c(map$dependencies,
leafletSearchDependencies(),
list(htmltools::htmlDependency(
"googlesearchapi", "0.0.1",
src = c(href = url),
script = "js?v=3",
all_files = FALSE
)))
But then in the browser Console i am getting warnings that "google" is not defined