[英]blank, white background for leaflet map
I would like to make a leaflet map with a white background -- that is with either no tiles at all and with a white background, or with tiles that are all white.我想制作一张白色背景的传单地图——要么根本没有瓷砖,要么有白色背景,要么全是白色的瓷砖。
Here's the leaflet "hello world":这是传单“你好世界”:
library(leaflet)图书馆(传单)
leaflet() %>%
addTiles() %>%
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
Leaving out the addTiles()
gives me a grey instead of a white background and none of the tiles in the gallery are all white. addTiles()
会给我一个灰色而不是白色的背景,并且画廊中的瓷砖都不是全白的。
Thanks to @JoSerra for the pointer, here's how to achieve this in the context of an RMarkdown document.感谢@JoSerra 的指针,这里是如何在 RMarkdown 文档的上下文中实现这一点。 Just add the following to the doc:只需将以下内容添加到文档中:
```{r results="asis"}
cat("
<style>
.leaflet-container {
background: #FFF;
}
</style>
")
```
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.