aboutsummaryrefslogtreecommitdiffhomepage
path: root/snippets/javascript_terrdraw
blob: 17363b1add0b8ccd50b6e9dcec1fc363e7dbc674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Events
draw.on("finish", (id: string, context: { action: string, mode: string }) => {
  if (action === 'draw') {
    // Do something for draw finish event
  } else if (action === 'dragFeature') {
    // Do something for a drag finish event
  } else if (action === 'dragCoordinate') {
    //
  }else if (action === 'dragCoordinateResize') {
    //
  }
});

draw.on("change", (ids: string[], type: string) => {
  // Possible type values:
  // 'create'
  // 'update'
  // 'delete'
  // 'styling'
  // Do something
  //...
});

draw.on("select", (id: string) => {
  // Do something
  //...
});

draw.on("deselect", () => {
  // Do something
  //...
});