我正在尝试重现此示例:https ://github.com/SymbolixAU/mapdeck ,使用 mapdeck r 包。
我在 mapbox 网站上注册了自己并创建了我的令牌。每当我运行我的脚本时,都没有错误,但也没有地图。
library(mapdeck)
library(leaflet)
key <- set_token("pk.eyJ1IjoicmFxdWVsc2FyYWl2YTE5ODgiLCJhIjoiY2p4MzM2eHh5MG95aTN5cDQxdjVocDlxMCJ9.Wskus8QqYwjAufGpW71OVg")
df <- readRDS("df.rds")
df$Station_Long = as.numeric(as.character(df$lon_Pay))
df$Station_Lat = as.numeric(as.character(df$lat_Pay))
df$id = as.factor(as.numeric(as.factor(df$ID)))
mapdeck(
token = key,
style = mapdeck_style('dark')
, location = c(104, 1)
, zoom = 8
, pitch = 45
) %>%
add_arc(
data = df
, origin = c("centroid_lon", "centroid_lat")
, destination = c("lon_Pay", "lat_Pay")
, layer_id = 'arclayer'
, stroke_width = 3
, stroke_from = "#ccffff"
, stroke_to = "#ccffff"
)
我的密钥是 NULL(空)。
有谁知道为什么会这样?