Hi, I was wondering if someone can help me overlaying a map onto my leaflet map in Shiny?
A little context, my post history shows that i've been asking some help regarding geo-spatial plotting. I have a project where i am trying to overlay flood damage using a slider bar to represent elevation levels similar to <https://www.floodmap.net/>. But we have different objectives. We want to show how much flood damage a neighbourhood can occur in our city by rising elevation levels using a slider.
I just dont know what shiny output does this nor how to code it, if anyone can either show me or direct me to resources this will be highly appreciated. I am still learning Shiny, Leaflet, and sf. what i wrote so far is below, my greatest appreciation in advance.
library(shiny)
library(leaflet)
## This is the UI Section
ui <- fluidPage(
leafletOutput("mymap"),
sliderInput(inputId = "num",
label = "Water Levels in Metres",
value = 25, min = 1, max = 100),
plotOutput("mapwithflood")
)
## This is the Server Section
server <- function(input, output) {
output$mymap <- renderLeaflet({
leaflet() %>%
addProviderTiles(providers$Esri.NatGeoWorldMap,
options = providerTileOptions(noWrap = TRUE)
)
})
output$mapwithflood
}
## This is where the UI gets combined with the server
shinyApp(ui = ui, server = server)