Is there a way to differentiate the "draw a polygon" and "draw a marker" events with the "adddrawtoolbar" function in Rshiny?

Viewed 89

Thanks to the leaflet.extras package it is easy to draw a polygon and/or a marker on a leaflet map as shown in the picture below.

enter image description here

Once clicked on those buttons it is possible to trigger an event like this:

observeEvent(input$map_draw_new_feature, { random_function() })

However I'm looking for a way to differentiate the observeEvent according if the user draw a polygon or a marker on the leaflet map. Something like that for instance:

observeEvent(input$map_draw_new_polygon, { random_function() })
observeEvent(input$map_draw_new_marker, { random_function() })

Is there a way to do such thing or there is no way to detect the feature type selected by the user before drawing it on the map ?!

0 Answers
Related