How do you select points from a leaflet map using 'leafpm'?
Ideally I would want the points inside the drawn polygon. Otherwise just the drawn polygon would probably be fine as I can intersect the selected points. This would be done in a shiny app.
I have had a look at 'crosstalk', but I want to select via the map, rather than via a graph.
Reprex:
library(leaflet)
library(leafpm)
data(quakes)
leaflet(data = quakes[1:20,]) %>% addTiles() %>%
addMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag)) %>%
addPmToolbar(toolbarOptions = pmToolbarOptions(drawMarker = FALSE,
drawPolyline = FALSE,
editMode = FALSE,
cutPolygon = FALSE,
removalMode = FALSE))