【问题标题】:Adding WMS to Leaflet将 WMS 添加到传单
【发布时间】:2018-01-15 05:53:27
【问题描述】:

我一直试图通过 The National Map 的 WMS 将这张地图(下)作为图层放入 R 中的传单,但没有任何成功。

https://raster.nationalmap.gov/arcgis/services/LandCover/USGS_EROS_LandCover_NLCD/MapServer/WMSServer?request=GetMap&service=WMS&Version=1.3.0&BBOX=-14497453.9,248608.9,-7087933.9,6960328.9&Styles=&Format=image/png&layers=33&crs=EPSG:3857&width=600&height=400&Transparent=true

这是我的代码:

map <- leaflet() %>% addTiles() %>% 
addWMSTiles(baseUrl="https://raster.nationalmap.gov/ArcGIS/services/LandCover/USGS_EROS_LandCover_NLCD/MapServer/WMSServer?",
layers = "33",
group = "NLCD",
options = WMSTileOptions(
format = "image/png",
version = "1.3.0",
transparent = TRUE)) %>%
addLayersControl(
overlayGroups = c("NLCD"),
position = 'bottomleft')

map

【问题讨论】:

    标签: r leaflet


    【解决方案1】:

    我发现了问题。当我查看 RStudio 查看器控制台时,每个光栅图像都有“加载资源失败:无法初始化 SSL 上下文:”。如果其他人遇到此问题,则表示 RStudio 查看器存在问题,他们目前正在修复。如果您在浏览器中将其作为 html 运行,它应该可以正确显示。 Shiny 也是如此。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多