Open chalioui opened 3 years ago
This error looks like it's caused by including
<script src='https://maps.googleapis.com/maps/api/js?key=", map_key2, "&libraries=places&callback=initAutocomplete' async defer></script>"))
as this script is already loaded when you call google_map()
.
Have you looked into this other issue and solution as a way to do this?
Yes this this the part of code that causes the error, my app works good when I remove it. I tried the solution :
shinyApp(
ui = fluidPage(
shiny::titlePanel("A Shiny google maps search box"),
fluidRow(column(
3, autocomplete_input("auto", NULL, opts[1:10], max_options = 250, create = TRUE)
))
),
server = function(input, output, session) {
observeEvent(input$auto, {
optPlaces <- googleway::google_place_autocomplete(input$auto, key = "xxxxxxxxxxx")
update_autocomplete_input(session, "auto", options = optPlaces$predictions[,"description"])
}, ignoreInit = TRUE)
}
)
The autocompletion is slow but works partialy : provides suggestions but I get an error when I clear the input : Error in [: incorrect number of dimensions
Hi there! Thank you for this great package! I want to use autocomplete in shiny textInput, and display the location on a google map:
It works but I have an error message on the console of my browser : You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors (and yes some times the map is not visible)