I have a leaflet map that is plotting data and works as expected for me.
leaflet(demo_data) %>%
addTiles() %>%
addCircleMarkers(lng = ~lg, lat = ~lt, color = ~color, opacity = 1,
popup = ~sprintf("<h3><b>Vehicle No : %s</b></h3>", termid)) %>%
leaflet::addLegend(
position = 'bottomright',
opacity = 1,
color = ~unique(color),
labels = ~unique(label),
title = 'Color Range Chart'
)
Now, I have another kml file that has additional data about the same coordinates. How do I plot information from kml file on top of already existing leaflet map?
I am reading kml file using sf package with st_read function
kml_data <- sf::st_read('data.kml')
I have searched extensively for this issue and try out various things with plotting sf data with leaflet, tried out rmaps, simplevis package but none of them works for me.