How to change sheet map background in RStudio?

I am creating a Shiny application using the flyer widget. My map has a simple Shapefile without a basemap. The flyer displays gray gray by default. I would like to change the background to white.

I see some answers using javascript code, but I don’t know how to implement this in R.

+4
source share
1 answer

You can change the default background color for the leaflet using CSS, see this related question .

You can use custom CSS in your Shiny application by adding it to the Shiny HTML output header:

ui <- fluidPage(
  tags$head(
    tags$style(HTML(".leaflet-container { background: #f00; }"))
  ),
  # etc.
)
# etc.

, , CSS, Shiny documentation.

+3

Source: https://habr.com/ru/post/1674934/


All Articles