Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add "ondragstart" marker event #873

Open
daattali opened this issue Aug 12, 2023 · 0 comments
Open

Feature request: add "ondragstart" marker event #873

daattali opened this issue Aug 12, 2023 · 0 comments

Comments

@daattali
Copy link

daattali commented Aug 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant