我在让rMaps leaflet在R-shiny中全屏显示时遇到了一些困难。在这个问题上,有人能给我指出正确的方向吗?
ui.R:
library(shiny);library(rCharts)
shinyUI(navbarPage("rMaps Leaflet Sizing",
tabPanel("Map",
# tags$style('.leaflet {height: 100%; width: 100%}'), --no change
mapOutput('mapPlotJSON')
)
))server.R:
library(shiny);library(rCharts);library(rMaps)
shinyServer(function(input, output, session) {
output$mapPlotJSON <- renderMap({
map1 = Leaflet$new()
map1$setView(c(45.5236, -122.675), 13)
map1$tileLayer(provider ='Stamen.Terrain')
# map1$set(width = "100%", height = "100%") --doesn't show map
map1
})
})发布于 2014-11-11 06:27:06
我也遇到过同样的问题。我建议使用下一页http://www.d3noob.org/2014/02/make-your-leafletjs-map-full-screen.html中的提示
例如,在您的.css文件中添加:
body {
height: 100%;
width: 100%;
}
html {
height: 100%;
width: 100%;
}
.leaflet {
height: 100%;
width: 100%;
}发布于 2014-07-31 10:10:14
应该是map1$fullScreen(TRUE)
请参阅https://github.com/ramnathv/rCharts/issues/290#issue-21794686中的示例
https://stackoverflow.com/questions/25049375
复制相似问题