[Question] How to trigger cancel automatically #861
-
Hi! I would like to trigger a "cancel" event. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
with
or
you can force a cancel. The Event 'pm:drawend' is fired, but this only works with the drawing tools and not with the edit tools To disable drawing if you don't know the active type or to disable drawing and edit tools, you can call
First you change the drawing type and then you disable now knowing the type. |
Beta Was this translation helpful? Give feedback.
-
Very nice project! I really like it! :) I have a HTML select element where the user should select the layerGroup he wants to draw in. If none is selected, I want the draw/edit operation to be cancled. I tried as suggested: However, it seems the suggested code fails with "Uncaught RangeError: Maximum call stack size exceeded". Is there any other way to fire a cancle directly? In my opinion it would be a way cleaner approach. Thanks and best regards |
Beta Was this translation helpful? Give feedback.
-
Hi @pate313373 you run into this error, because you create a loop. When you call The better version is:
BUT we have a bug in the Library so I have to fix this first. The Until them you have to use a workaround with
|
Beta Was this translation helpful? Give feedback.
-
Excellent, thx for the fast help! :) |
Beta Was this translation helpful? Give feedback.
-
How would i do the same for the Finish action? |
Beta Was this translation helpful? Give feedback.
with
or
you can force a cancel. The Event 'pm:drawend' is fired, but this only works with the drawing tools and not with the edit tools
To disable drawing if you don't know the active type or to disable drawing and edit tools, you can call
First you change the drawing type and then you disable now knowing the type.