()
| 116 | } |
| 117 | |
| 118 | loadRasterImage () { |
| 119 | let raster |
| 120 | if (this.loadingRaster || this.loadedRaster) { return } |
| 121 | if (!(raster = this.get('raster'))) { return } |
| 122 | this.rasterImage = $(`<img crossOrigin='Anonymous' src='/file/${raster}' />`) |
| 123 | this.loadingRaster = true |
| 124 | this.rasterImage.one('load', () => { |
| 125 | this.loadingRaster = false |
| 126 | this.loadedRaster = true |
| 127 | this.trigger('raster-image-loaded', this) |
| 128 | return this.rasterImage.off('error') |
| 129 | }) |
| 130 | return this.rasterImage.one('error', error => { |
| 131 | if (error) { |
| 132 | console.log('Raster image error', error) |
| 133 | } |
| 134 | this.loadingRaster = false |
| 135 | console.log('Raster image error', this) |
| 136 | this.trigger('raster-image-load-errored', this) |
| 137 | return this.rasterImage.off('load') |
| 138 | }) |
| 139 | } |
| 140 | |
| 141 | getActions () { |
| 142 | if (!this.isFullyLoaded()) { return {} } |
no test coverage detected