I would need to able to catch map event pm:create when user draw a shape with shift key pressed.
Leaflet provides originalEvent object in MouseEvent object to be able to catch mouse events with a key pressed.
I think it would be possible to implement this by creating click event on map. There I can find out if shift was pressed on the first and the last click when a new shape was created by geoman. In pm:create event I can get the global variable and check if shift was pressed.
I am wondering if there is a better way to find out if shift was pressed directly in pm:create without implementing an additional click event on map.
I would need to able to catch map event
pm:create
when user draw a shape withshift
key pressed.Leaflet provides originalEvent object in
MouseEvent
object to be able to catch mouse events with a key pressed.I think it would be possible to implement this by creating
click
event on map. There I can find out ifshift
was pressed on the first and the last click when a new shape was created by geoman. Inpm:create
event I can get the global variable and check ifshift
was pressed.I am wondering if there is a better way to find out if
shift
was pressed directly inpm:create
without implementing an additional click event on map.