我试图在R传单包中添加WMS瓷砖--使用这个示例geoserver WMS没有问题:
leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 4) %>% addWMSTiles(
"http://sedac.ciesin.columbia.edu/geoserver/wms",
layers = "energy:energy-pop-exposure-nuclear-plants-locations_plants",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
tileOptions(tms = TRUE),
attribution = "")然而,当我尝试使用来自国家地图的WMS时,尽管多次尝试为url和层设置参数,我还是继续获得空的传单结果:
leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 4) %>%addWMSTiles(
"http://basemap.nationalmap.gov/arcgis/services/USGSHydroNHD/MapServer/WmsServer?",
layers = "0",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "") 我以前没有在R传单包外使用过传单,所以这可能是使用这种WMS在传单中设置参数时的一个新手错误。
发布于 2015-11-06 00:15:27
你只需要放大一点点,图层就会出现。试试这个:
leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 7) %>%addWMSTiles(
"http://basemap.nationalmap.gov/arcgis/services/USGSHydroNHD/MapServer/WMSServer?",
layers = "0",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "") https://stackoverflow.com/questions/32960050
复制相似问题