我正在尝试使用带有自定义基本映射的leafletR。它适用于任何人,但使用这个特殊的:
http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer
它没有工作任何人有任何提示?谢谢!
library(leafletR)
## Not run:
# duplicates osm base map
addBaseMap(
name="myosm",
title="Duplicated OpenStreetMap",
url="http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}.png"
)
map <- leaflet(base.map="myosm")
## End(Not run)
rstudio::viewer(map)
答案 0 :(得分:1)
从.png
媒体资源中移除url
扩展程序,它可以正常运行。参见:
http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/0/0/0
http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/0/0/0.png
答案 1 :(得分:1)
该网站的API似乎没有使用&#34; .png&#34;在瓷砖上的扩展。这对我有用
addBaseMap(
name="myosm",
title="Duplicated OpenStreetMap",
url="http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}"
)