observe({ click = input$mapa_marker_click
if(is.null(click))
return()
else
my_list <- list()
r <- 1
if(click$id== "Free")
{
my_route <- viaroute(click$lat,click$lng,df_map$lat[4], df_map$lng[4])
geom <- decode_geom(my_route$routes[[1]]$geometry)
my_list[[r]] <- geom
my_list2<-as.data.frame(my_list)
leafletProxy("mapa") %>%
addPolylines(lng=my_list2$lng,lat=my_list2$lat, layerId = df_map$id)}})
How to identify each Marker individually?
I'm trying to create an if so that if the name of the Marker is equal to "Free" the function calculates a specific route. and if it's another name, the function does something else, but I have a problem, I can't identify each CircleMarker individually... How can I do this? is there any way to access a Circlemarker?