(options)
| 96 | |
| 97 | export class VideoMap extends mapboxgl.Evented { |
| 98 | constructor(options) { |
| 99 | super(); |
| 100 | const { container, url, videoParameters, autoplay, loop, videoWidth, videoHeight, opencv, styleOptions } = options; |
| 101 | this.container = container || 'map'; |
| 102 | this.layerCache = {}; |
| 103 | this.sourceCache = {}; |
| 104 | this.videoWidth = videoWidth; |
| 105 | this.videoHeight = videoHeight; |
| 106 | this.autoplay = autoplay !== undefined ? autoplay : true; |
| 107 | this.loop = loop !== undefined ? loop : true; |
| 108 | this.styleOptions = styleOptions || {}; |
| 109 | this.cv = opencv || window.cv; |
| 110 | if (!this.cv) { |
| 111 | throw new Error('opencv.js instance is not existed!'); |
| 112 | } |
| 113 | if (!videoParameters) { |
| 114 | throw new Error('videoParameters must be config!'); |
| 115 | } |
| 116 | this.videoParameters = videoParameters; |
| 117 | this._createMap().then((map) => { |
| 118 | this.map = map; |
| 119 | this._addVideoLayer(url); |
| 120 | }); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * @function VideoMap.prototype.addLayer |
nothing calls this directly
no test coverage detected