我正在制作一个有页脚的shiny
应用程序.页脚将有一些徽标和其他信息,它应该始终显示在屏幕底部,即使在上下滚动时也是如此.该应用程序是多个选项卡,在一个选项卡上,我有一个用tmap
制作的互动 map .我遇到的问题是,tmap
个内置的zoom 按钮、层菜单、图例和leaflet
信息显示在页脚前面,而我希望它出现在页脚后面.请参见屏幕截图.
下面是一个可重复使用的小例子:
library(shiny)
library(shinythemes)
library(tmap)
library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
ui <- navbarPage(
"App",
theme = bslib::bs_theme(bg = "#202123", fg = "#B8BCC2"),
tabPanel("tab", tmapOutput("map")),
footer = fluidRow(
tags$div(
h4("THIS IS A FOOTER"),
class = "footer",
style = "position:fixed;bottom:0;width:100%;background-color: white;",
)
)
)
server <- function(input, output, session) {
tmap_mode("view")
output$map <- renderTmap({
tm_shape(nc) +
tm_polygons("AREA")
})
}
shinyApp(ui, server)