Add start and end markers to a leaflet map
map_add_axis_start_end.Rd
This function adds start and end markers to a Leaflet map based on the provided start and end coordinates.
Examples
library(leaflet)
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
# Create a simple Leaflet map
my_map <- leaflet() %>%
setView(lng = 4.968697, lat = 45.103354, zoom = 8) %>%
addProviderTiles(providers$CartoDB.Positron)
# Create a data frame with start and end coordinates
coordinates_df <- data_get_axis_start_end(network_axis %>%
filter(fid == 5))
# Add start and end markers to the map
my_map <- map_add_axis_start_end(my_map, axis_start_end = coordinates_df)
#> Error: argument "group" is missing, with no default
my_map