I'm working on creating an RShiny dashboard with a leaflet map; I want my map to be fullscreen, but I can't quite seem to get the borders/margins to go away. I have tried the solutions offered in a previous post (https://stackoverflow.com/questions/61341817/making-leaflet-map-fullscreen-in-rshiny), but with those solutions I just get a completely blank screen--the map does not seem to render at all. Here is my code:
library(leaflet)
library(shiny)
library(tidyverse)
# UI
ui <- navbarPage("Dashboard",
tabPanel("Fullscreen Map",
fillPage(
leafletOutput("map", width = "98vw", height = "90vh"))
)
)
# FUNCTION
server <- function(input, output, session) {
output$map <- renderLeaflet({
leaflet() %>%
addTiles() %>%
setView(lat = 0, lng = 0, zoom = 5)
})
}
# RUN APP
shinyApp(ui = ui, server = server)
As you can see, my current workaround is to set the map size based on view height/view width (width = "98vw", height = "90vh"). If I set either of those to 100, the right and bottom edges of the map go off the screen. Again, I have tried both solutions offered in the post I have linked above and both do not work. Unfortunately, I am not familiar enough with HTML, CSS, or JavaScript to really adjust the code in the answers for my situation.
Thanks in advance for any suggestions or solutions!
EDIT: Below is a screenshot to help @L D
