[R-sig-Geo] leaflet in shiny error message

basile.lenormand b@@||e@|enorm@nd @end|ng |rom protonm@||@com
Mon Jan 3 01:49:33 CET 2022


Hello everyone!

I am trying to create a shiny app with leaflet stuff in it. I have a problem when I am displaying the application, I got this error message :

"Error in dispatch: argument "map" is missing, with no default".

I searched some clues on the net, I found some examples which are working but I do not get where I going wrong. I double checked the brackets, try to change the name of the map, put the name of the spatial data frame that I am using, etc.

If someone can give me some clues I will be really glad.
Have a great day,
thank you for your time,
Basile.

Here is my code:

ui <- fluidPage(
titlePanel(""),

sidebarLayout(
sidebarPanel(
helpText(""),

selectInput("var",
label = "Choose a variable to display",
choices = spdf$koppen,
selected = ""
),
sliderInput("range", "surface brûlée en hectare", min(spdf$V11), max(spdf$V11),
value = range(df$V11), step = 2500
),
sliderInput("range", "Nombre d'incendie", min(spdf$n), max(spdf$n),
value = range(df$V11), step = 2
),
checkboxInput("legend", "Show legend", TRUE)),
mainPanel(leafletOutput("map"))
)
)

server <- function(input, output, session) {
output$map <- renderLeaflet({
leaflet(df) %>%
addTiles(group = "OSM") %>%
addProviderTiles("Esri.NatGeoWorldMap", group="ESRI") %>%
addProviderTiles("CartoDB.DarkMatter", group= "CartoDB") %>%
#fitBounds(~min(long), ~min(lat), ~max(long), ~max(lat))%>%
addPolygons(
data=spdf,
fillColor = "viridis",
weight = 0,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7)#%>%
setView(lat= 44.2, lng=5.9, zoom=5)
})
}
shinyApp(ui, server)

Sent with [ProtonMail](https://protonmail.com) Secure Email.
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list