I am using MapDeck to use the mb_isochrone
function to draw distances from a specific location in Arlington Heights, Illinois.
This is my code so far:
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)
As you can see at the bottom, I am trying to use the legend_format
function to edit the legend to show the distances in miles (5 miles, 10 miles, 15 miles, 20 miles). As well, I have tried to do it multiple ways including doing:
legend_format = list(meters2miles)
However, I cannot get the legend to switch from showing meters to miles no matter my method/attempt.