首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >全屏制作rMaps单张地图

全屏制作rMaps单张地图
EN

Stack Overflow用户
提问于 2014-07-31 09:02:25
回答 2查看 3.3K关注 0票数 1

我在让rMaps leafletR-shiny中全屏显示时遇到了一些困难。在这个问题上,有人能给我指出正确的方向吗?

ui.R:

代码语言:javascript
复制
library(shiny);library(rCharts)
shinyUI(navbarPage("rMaps Leaflet Sizing",
  tabPanel("Map",
#  tags$style('.leaflet {height: 100%; width: 100%}'), --no change 
    mapOutput('mapPlotJSON')
  )
))

server.R:

代码语言:javascript
复制
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
  })
})
EN

回答 2

Stack Overflow用户

发布于 2014-11-11 06:27:06

我也遇到过同样的问题。我建议使用下一页http://www.d3noob.org/2014/02/make-your-leafletjs-map-full-screen.html中的提示

例如,在您的.css文件中添加:

代码语言:javascript
复制
body {
  height: 100%;
  width: 100%;
}

html {
  height: 100%;
  width: 100%;
}

.leaflet {
  height: 100%; 
  width: 100%;
}
票数 1
EN

Stack Overflow用户

发布于 2014-07-31 10:10:14

应该是map1$fullScreen(TRUE)

请参阅https://github.com/ramnathv/rCharts/issues/290#issue-21794686中的示例

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25049375

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档