我正在使用 MapDeck 使用该mb_isochrone
函数来绘制与伊利诺伊州阿灵顿高地特定位置的距离。
到目前为止,这是我的代码:
arlington.race <- c("-88.010102466048", "42.093383772976495")
isochrones <- mb_isochrone(arlington.race,
distance = c(8046,
16093,
24140,
32186))
mapdeck(style = mapdeck_style("streets"),
location = c("-88.010102466048", "42.093383772976495"),
zoom = 8.5) %>%
add_polygon(data = isochrones,
fill_colour = "distance",
fill_opacity = 0.5,
legend = TRUE,
update_view = FALSE,
legend_format = c(5, 10, 15, 20))
meters2miles <- c(5,10,15,20)
正如您在底部看到的那样,我正在尝试使用该legend_format
功能来编辑图例以显示以英里为单位的距离(5 英里、10 英里、15 英里、20 英里)。同样,我尝试过多种方式,包括:
legend_format = list(meters2miles)
但是,无论我的方法/尝试如何,我都无法让图例从显示米切换到英里。