MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / constructor

Method constructor

src/mapboxgl/mapping/VideoMap.js:98–121  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

96
97export 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

Callers

nothing calls this directly

Calls 2

_createMapMethod · 0.95
_addVideoLayerMethod · 0.95

Tested by

no test coverage detected