2017-02-02 6 views
0

私は次の例に従おうとしています:https://rpubs.com/cyclemumner/228100、特にwmsタイルがcustum投影で追加されている部分ですが、コードを実行するとwmsタイルが得られないようです。 githubからリーフレットをインストールしました。RリーフレットaddWMStiles with投影

if (!require('devtools')) install.packages('devtools') 
devtools::install_github('rstudio/leaflet') 

リーフレット1.0.2.9010、R R-3.3.2およびRStudio 1.0.136を使用します。

私が実行したコードは、私が何を得る次

library(leaflet) 

zoom <- 1 
maxZoom <- 5 

crsAntartica <- leafletCRS(
    crsClass = 'L.Proj.CRS', 
    code = 'EPSG:3031', 
    proj4def = '+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs', 
    resolutions = c(8192, 4096, 2048, 1024, 512, 256), 
    origin = c(-4194304, 4194304), 
    bounds = list(c(-4194304, -4194304), c(4194304, 4194304)) 
) 

leaflet(options= leafletOptions(crs=crsAntartica, minZoom = zoom, maxZoom=maxZoom, worldCopyJump = FALSE)) %>% 
    setView(0, -90, 0) %>% 
    addWMSTiles(baseUrl="https://maps.environments.aq/mapcache/antarc/?", 
       layers="antarc_ramp_bath_shade_mask", 
       options=WMSTileOptions(format="image/png",transparent=TRUE), 
       attribution="xxx") %>% 
    addGraticule() 

あるこの

enter image description here

私が間違ってやっている上の任意のアイデアですか?

答えて

1

私はそれが動作するようにしなかった理由を発見した。 WMSタイルはRStudioビューアで表示されません。私は、光沢のあるアプリの中にコードを置くと、私はwmsのタイルが表示されます。