Ich versuche, eine App zu erstellen, die eine Broschüre Karte zeigt. Nutzer, die die App nutzen, tun dies meist von mobilen Geräten aus. Daher wäre es praktisch, die Karte auf dem gesamten Bildschirm anzubieten. können Sie die App sehen hier: https://js1984.shinyapps.io/stackoverflow/Broschüre in R-glänzend: 100% Höhe der Broschüre Karte
Es funktioniert für Breite fein mit leafletOutput("mymap", width = "100%")
jedoch kann ich Höhe nicht zu leafletOutput("mymap", width = "100%", height = "100%")
: die Karte verschwindet, wenn ich die app laufen ... Höheneinstellung auf einen festen Wert Werke Gut, aber ist keine Option, wie Sie sich vorstellen können.
Alle Lösungen, die ich bisher gefunden habe für mich nicht: wie Einstellung height: 100% im CSS:
html, body, #mymap {
height:100%;
width:100%;
padding:0px;
margin:0px;
}
Der UI Teil der App wie folgt aussieht:
ui <- navbarPage(title = "test",
collapsible = T,
position= "static-top",
inverse = T,
#####################################
# the tab panel that includes the MAP
#####################################
tabPanel("Map",
includeCSS(path="www/bootstrap.css"),
leafletOutput("mymap", width = "100%")
),
#####################################
# other tab panels
#####################################
tabPanel("Fri",
fluidRow(
includeCSS(path="www/bootstrap.css"),
column(6,
offset = 3,
wellPanel(
checkboxGroupInput("freitag",
h3("Freitag"),
list_fr,
selected = 1
)
)
)
)
),
tabPanel("Sat",
fluidRow(
column(6,
offset = 3,
wellPanel(
checkboxGroupInput("samstag",
h3("Samstag"),
list_sa
)
)
)
)
),
tabPanel("Sun",
fluidRow(
column(6,
offset = 3,
wellPanel(
checkboxGroupInput("sonntag",
h3("Sonntag"),
list_so
)
)
)
)
),
tabPanel("Mon",
fluidRow(
column(6,
offset = 3,
wellPanel(
checkboxGroupInput("montag",
h3("Montag"),
list_mo
)
)
)
)
),
tabPanel("Tues",
fluidRow(
column(6,
offset = 3,
wellPanel(
checkboxGroupInput("dienstag",
h3("Dienstag"),
list_di
)
)
)
)
)
)
Soweit ich weiß ist es nicht möglich, beide Attribute (Höhe UND Breite) auf% zu setzen. – Stophface
Es ist tatsächlich möglich, es ist in [Superzip] (http://shiny.studio.com/gallery/superzip-example.html) implementiert. Aber ich konnte auch nicht herausfinden, wie. –
Aber wie auch immer, hier ist die [Lösung] (http://stackoverflow.com/questions/36469631/how-to-get-leaflet-for-r-use-100-of-shiny-dashboard-height?rq=1). –