leaflet icon indicating copy to clipboard operation
leaflet copied to clipboard

Feature request: add "ondragstart" marker event

Open daattali opened this issue 2 years ago • 0 comments

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.

daattali avatar Aug 12 '23 23:08 daattali