OpenStreetMap 不在 RStudio 中显示(使用 R 3.2.1) [英] OpenStreetMap doesn't display in RStudio (with R 3.2.1)

查看:22
本文介绍了OpenStreetMap 不在 RStudio 中显示(使用 R 3.2.1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

I am using code from here

library(leaflet)

m <- leaflet() %>%
  addTiles() %>%  
  addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
m  

A point appears in the middle of the screen, but no map. Then I found package to download, i.e. osmar, and included that, i.e.

library(osmar)

And map is still not displaying. How to fix?

Update

I am able to access openstreetmap.com on my web browser. Javascript is enabled. Some places they mentioned use setView to display openstreetmap but when I try, the screen is now blank, no pop-up pointer

library(osmar)
library(leaflet)

m <- leaflet() %>%
  addTiles() %>%  
  setView(174.768, lat=-36.852, zoom=18)
m

解决方案

I had the same issue, found this and worked very well for me:

%>% addProviderTiles(providers$OpenStreetMap) %>% 

found it here: https://gis.stackexchange.com/questions/187926/leaflet-output-is-grey

这篇关于OpenStreetMap 不在 RStudio 中显示(使用 R 3.2.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆