【问题标题】:R Leaflet: How to plot a map with a specific geographic location within addTiles Function?R Leaflet:如何在 addTiles 函数中绘制具有特定地理位置的地图?
【发布时间】:2017-10-14 17:26:13
【问题描述】:

我尝试使用 Leaflet Package 中的 addTiles 函数绘制德里位置。下面是代码:

leaflet()%>%
addTiles(map = "Delhi",urlTemplate = "http://www.openstreetmap.org/search?query=delhi#map=11/28.6518/77.2219",attribution = 'Google')

收到此错误:map$x 中的错误:$ 运算符对原子向量无效

我搜索了解决方案,但找不到特定问题的答案。

【问题讨论】:

    标签: r ggplot2 leaflet


    【解决方案1】:

    运行这段代码

    library(leaflet)
    leaflet()%>%
      addTiles()%>%
      setView(lng = 77.209021,lat =28.613939,zoom = 10 )
    

    结果

    【讨论】:

    • 您的代码很有帮助。你能告诉我你是怎么得到经度和纬度值的吗?
    • 要查找经纬度,请在本网站上输入地名link
    • 太棒了。很有帮助!
    猜你喜欢
    • 2020-11-09
    • 1970-01-01
    • 1970-01-01
    • 2011-12-23
    • 1970-01-01
    • 2019-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多