* Start or stop pan zoom mode *
()
| 88 | * |
| 89 | */ |
| 90 | panzoom(): void { |
| 91 | if (this.panzoomData.panning) { |
| 92 | this.set('interaction', this.panzoomData.cached_interaction); |
| 93 | this.panzoomData.panning = false; |
| 94 | this.save_changes(); |
| 95 | } else { |
| 96 | this.panzoomData.cached_interaction = this.get('interaction'); |
| 97 | const panzoom = this.panzoomData.panzoom; |
| 98 | if (panzoom) { |
| 99 | this.set('interaction', panzoom); |
| 100 | this.save_changes(); |
| 101 | } else { |
| 102 | this.create_panzoom_model().then((model) => { |
| 103 | this.set('interaction', model); |
| 104 | this.panzoomData.panzoom = model; |
| 105 | this.save_changes(); |
| 106 | }); |
| 107 | } |
| 108 | this.panzoomData.panning = true; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Creates a panzoom interaction widget for the this model. |
nothing calls this directly
no test coverage detected