leaflet
leaflet copied to clipboard
`layerId` causes only last observation to be mapped
Consider adding a warning when including layerId and data contains more than one observation. It appears that only the last observation is mapped in this case.
library(leaflet)
data(quakes)
leaflet(data = quakes[1:20, ]) %>% addTiles() %>%
addMarkers(
layerId = "id",
~ long,
~ lat,
popup = ~ as.character(mag),
label = ~ as.character(mag)
)