Dear community,
I have a problem when deploying the shiny app and I can't directly say where in the code the error is occurring. From my previous research I think that the error is occurring in the leaflet function.
Error in logs: 2024-04-08T09:32:51.991434+00:00 shinyapps[11559906]: Warning: Error in UseMethod: no applicable method for 'metaData' applied to an object of class "function"
This is my function:
session$onFlushed(once = T, function() {
icons <- awesomeIcons(
icon = 'ios-close',
iconColor = 'black',
library = 'ion',
markerColor = "red"
)
output$map <- renderLeaflet({
leaflet(data=data) %>%
addTiles() %>%
addAwesomeMarkers( lat = ~latitude, lng = ~longitude, icon=icons,
clusterOptions = markerClusterOptions(zoomToBoundsOnClick = T),
popup = ~paste(
paste('<b>', 'River:', '</b>', river),
paste('<b>', 'Station:', '</b>', station),
paste('<b>', 'Timespan [Years]:', '</b>', d_years ),
sep = '<br/>'),
popupOptions = popupOptions(closeButton = FALSE)
)%>%
addProviderTiles(providers$OpenStreetMap.HOT, group = "Open Street Map") %>%
addProviderTiles(providers$Stamen.TerrainBackground, group = "Terrain Background") %>%
addLayersControl(
baseGroups = c("Open Street Map", "Terrain Background"),
position = "topright",
options = layersControlOptions(collapsed = F)
)
})
})
I would be happy if someone could help me.
All the best