0

I build a leaflet in R like this:

my_leaflet <- my_data %>%
leaflet (options = leafletOptions(
-
) %>^%
addProvidersTiles(
-
)
setView(
-
) %>%
addMarkers (
--
) %>%
addCircleMarkers(
-
) %>%
addLegend(  ..  )

I get "height: 100%" in this part of the generated html code: without browseable()

But when i use browsable() :

browsable(
  tagList(list(
    tags$head(
      tags$style(
        ".leaflet .legend i{
            border-radius: 50%;
            width:12px;
            height: 12px;
            margin-top: 4px;

         }",
    ),
     my_leaflet
  ))
))

then i get "height: 400px" inside the generated html code (see the picture below) and the leaflet map only shows the half of my screen.

with browsable()

Is there a way to get the html code to show a full screen height? i am not sure if the "height: 400px" is the cause of this. is there a way to get this height to 100% when using browsable() ?

1
  • It looks like somehow the default style generated by browsable() is "height: 400px" for that html tag.
    – Luk7
    Commented Dec 24, 2020 at 13:36

1 Answer 1

0

Try vh unit. In your case modify my_leaflet with leaflet(height = '100vh', ...).

Not the answer you're looking for? Browse other questions tagged or ask your own question.