简体   繁体   English

如何在闪亮的上下文中从传单交互式地图中删除背景

[英]how to remove background from a leaflet interactive map in the shiny context

Within Shiny context, I have created the below pretty map.在 Shiny 上下文中,我创建了以下漂亮的地图。 I was wondering to know how can I remove the background (eg, Mexico, Canada, Oceans) in such a way that only US states appear.我想知道如何以仅显示美国各州的方式删除背景(例如,墨西哥、加拿大、海洋)。 I tried the code below but it did not work.我尝试了下面的代码,但没有用。

    .leaflet-tile-container {
    display: none;
  }

在此处输入图片说明

This is what I needed!这就是我需要的! Adding an option to set the opacity to 0.添加一个选项以将不透明度设置为 0。

addProviderTiles("CartoDB.Positron",
                  options = providerTileOptions(opacity = 0)) %>%
                  addTiles(none) 

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM