library(sf)
line_data <- sf::st_sf(
id = 1,
geometry = sf::st_sfc(
sf::st_linestring(
cbind(c(172.2041, 163.9383), c(-32.56960, -46.43999))
),
crs = 4326
)
)
map() |>
add_route(route_id = "route_line", points = line_data) |>
add_animation_controls(route_id = "route_line", include_speed_control = TRUE)
Run the code above in your browser using DataLab