selection of points from leaflet using leafpm in shiny

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))


image

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.