mapdeck
mapdeck copied to clipboard
mapdeck in flexdashbord
Describe the bug
The mapdeck map does not fill in the full "page" within flexdashboard
To Reproduce run document: ftp://ftp.hafro.is/pub/reiknid/einar/test.Rmd
Expected behaviour Same as what appears under the Leaflet-tab when test.Rmd is run
Versions What version of mapdeck are you using
> packageVersion("mapdeck")
[1] ‘0.2.1006’
e
@einarhjorleifsson Do you happen to know which css
values make the leaflet full screen?
not a clue, sorry e
You need
.mapdeckmap {
height: 100%;
}
@trafficonese that didn't work for me.
What if you use 100% !important
instead?
It worked for me without !important
in the browser, but not in the RStudio Viewer.
@trafficonese Where are you setting this value?
I was just setting it in the browser inspector. But I think this should do it for the markdown:
---
title: "trial"
runtime: shiny
output:
flexdashboard::flex_dashboard:
css: styles.css
---
and the styles.css
is in the same directory and contains:
.mapdeckmap {
height: 100% !important;
}
ok yeah, i have it working in flexdashboard using
.mapdeckmap {
height: 100% !important;
}
but this doesn't work for shiny - it makes the map disappear
Indeed, interesting.
In shiny I thought it would work by setting mapdeckOutput("map", height = "100%")
which should achieve the same thing. Apparently setting the height
to any percentage doesnt work, you have to specify the height in px
.
@trafficonese when I had the same issue with leaflet in shiny, it turns out that the map has padding to its parent container (I was using tabbox)

so when you specify 100% it does give you all 100% that it can give under the limitation of padding etc., while if you specify px (or vw) it is able to force the size to go beyond the parent container and the limitations