aboutsummaryrefslogtreecommitdiffhomepage
path: root/snippets/javascript_terrdraw
diff options
context:
space:
mode:
Diffstat (limited to 'snippets/javascript_terrdraw')
-rw-r--r--snippets/javascript_terrdraw32
1 files changed, 32 insertions, 0 deletions
diff --git a/snippets/javascript_terrdraw b/snippets/javascript_terrdraw
new file mode 100644
index 0000000..17363b1
--- /dev/null
+++ b/snippets/javascript_terrdraw
@@ -0,0 +1,32 @@
1// Events
2draw.on("finish", (id: string, context: { action: string, mode: string }) => {
3 if (action === 'draw') {
4 // Do something for draw finish event
5 } else if (action === 'dragFeature') {
6 // Do something for a drag finish event
7 } else if (action === 'dragCoordinate') {
8 //
9 }else if (action === 'dragCoordinateResize') {
10 //
11 }
12});
13
14draw.on("change", (ids: string[], type: string) => {
15 // Possible type values:
16 // 'create'
17 // 'update'
18 // 'delete'
19 // 'styling'
20 // Do something
21 //...
22});
23
24draw.on("select", (id: string) => {
25 // Do something
26 //...
27});
28
29draw.on("deselect", () => {
30 // Do something
31 //...
32});