leaflet
leaflet copied to clipboard
Feature request: add "ondragstart" marker event
Draggable markers currently trigger an event when the drag is finished (map_marker_dragend), but there is no event when the dragging begins.
Example to show that only a dragend event is given:
library(shiny)
shinyApp(
ui = fluidPage(leafletOutput('myMap'), verbatimTextOutput("inputs")),
server = function(input, output) {
map = leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 17) %>%
addMarkers(lat=42.0285, lng=-93.65, options = markerOptions(draggable = TRUE))
output$myMap = renderLeaflet(map)
output$inputs <- renderText(names(input))
}
)
Leaflet in javascript does support that event. My usecase is that once a marker begins being dragged, I want to grey out all other markers.