Skip to content

Commit a87d59f

Browse files
fix ut
1 parent 86c24ff commit a87d59f

File tree

2 files changed

+70
-80
lines changed

2 files changed

+70
-80
lines changed

test/mapboxgl/mapping/VideoMapSpec.js

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('mapboxgl_videoMap', () => {
1717
CV_64FC1: 'CV_64FC1',
1818
matFromImageData: function () {
1919
return {
20-
delete: function () {}
20+
delete: function () { }
2121
};
2222
},
2323
Size: function () {
@@ -26,22 +26,22 @@ describe('mapboxgl_videoMap', () => {
2626
height: 690
2727
};
2828
},
29-
matFromArray: function () {},
29+
matFromArray: function () { },
3030
Mat: function () {
3131
return {
32-
inv: function () {},
33-
delete: function () {},
32+
inv: function () { },
33+
delete: function () { },
3434
data64F: [200, 100],
3535
cols: 2,
3636
rows: 2,
3737
data: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
3838
};
3939
},
40-
gemm: function () {},
41-
Rodrigues: function () {},
42-
projectPoints: function () {},
43-
multiply: function () {},
44-
subtract: function () {}
40+
gemm: function () { },
41+
Rodrigues: function () { },
42+
projectPoints: function () { },
43+
multiply: function () { },
44+
subtract: function () { }
4545
};
4646
});
4747
afterEach(() => {
@@ -61,24 +61,22 @@ describe('mapboxgl_videoMap', () => {
6161
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
6262
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;
6363
});
64-
64+
6565
it('init videoMap', (done) => {
6666
var url = videoUrl;
67-
var videoMap = new VideoMap({
68-
src: url,
67+
var videoMap = new VideoMap(url, {
68+
fovX: 84,
69+
fovY: 47,
70+
centerX: 960,
71+
centerY: 540,
72+
pitch: -20,
73+
roll: 0,
74+
yaw: 2,
75+
x: 11587478.810629973,
76+
y: 3570800.195541344,
77+
z: 154.50312
78+
}, {
6979
opencv: cv,
70-
videoParameters: {
71-
fovX: 84,
72-
fovY: 47,
73-
centerX: 960,
74-
centerY: 540,
75-
pitch: -20,
76-
roll: 0,
77-
yaw: 2,
78-
x: 11587478.810629973,
79-
y: 3570800.195541344,
80-
z: 154.50312
81-
}
8280
});
8381
videoMap.on('load', function () {
8482
expect(videoMap.coordTransfer).not.toBe(null);
@@ -89,21 +87,19 @@ describe('mapboxgl_videoMap', () => {
8987

9088
it('addlayer removelayer', (done) => {
9189
var url = videoUrl;
92-
var videoMap = new VideoMap({
93-
src: url,
90+
var videoMap = new VideoMap(url, {
91+
fovX: 84,
92+
fovY: 47,
93+
centerX: 960,
94+
centerY: 540,
95+
pitch: -20,
96+
roll: 0,
97+
yaw: 2,
98+
x: 11587478.810629973,
99+
y: 3570800.195541344,
100+
z: 154.50312
101+
}, {
94102
opencv: cv,
95-
videoParameters: {
96-
fovX: 84,
97-
fovY: 47,
98-
centerX: 960,
99-
centerY: 540,
100-
pitch: -20,
101-
roll: 0,
102-
yaw: 2,
103-
x: 11587478.810629973,
104-
y: 3570800.195541344,
105-
z: 154.50312
106-
}
107103
});
108104
videoMap.on('load', function () {
109105
videoMap.addLayer({
@@ -154,21 +150,19 @@ describe('mapboxgl_videoMap', () => {
154150

155151
it('addSource removeSource', (done) => {
156152
var url = videoUrl;
157-
var videoMap = new VideoMap({
158-
src: url,
153+
var videoMap = new VideoMap(url, {
154+
fovX: 84,
155+
fovY: 47,
156+
centerX: 960,
157+
centerY: 540,
158+
pitch: -20,
159+
roll: 0,
160+
yaw: 2,
161+
x: 11587478.810629973,
162+
y: 3570800.195541344,
163+
z: 154.50312
164+
}, {
159165
opencv: cv,
160-
videoParameters: {
161-
fovX: 84,
162-
fovY: 47,
163-
centerX: 960,
164-
centerY: 540,
165-
pitch: -20,
166-
roll: 0,
167-
yaw: 2,
168-
x: 11587478.810629973,
169-
y: 3570800.195541344,
170-
z: 154.50312
171-
}
172166
});
173167
videoMap.on('load', function () {
174168
videoMap.addSource('test111', {

test/mapboxgl/overlay/VideoLayerSpec.js

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -127,27 +127,25 @@ describe('mapboxgl_VideoLayer', () => {
127127
var url = videoUrl;
128128
spyOn(cv, 'Size');
129129
spyOn(cv, 'warpPerspective');
130-
var videoLayer = new VideoLayer({
131-
url: url,
130+
var videoLayer = new VideoLayer(url, {
131+
fovX: 84,
132+
fovY: 47,
133+
centerX: 960,
134+
centerY: 540,
135+
pitch: -20,
136+
roll: 0,
137+
yaw: 2,
138+
x: 11587478.810629973,
139+
y: 3570800.195541344,
140+
z: 154.50312
141+
}, {
132142
opencv: cv,
133143
clipRegion: [
134144
[0, 0],
135145
[1920, 0],
136146
[1920, 900],
137147
[0, 900]
138148
],
139-
videoParameters: {
140-
fovX: 84,
141-
fovY: 47,
142-
centerX: 960,
143-
centerY: 540,
144-
pitch: -20,
145-
roll: 0,
146-
yaw: 2,
147-
x: 11587478.810629973,
148-
y: 3570800.195541344,
149-
z: 154.50312
150-
},
151149
extent: [
152150
[116.14394400766855, 28.249134537249257],
153151
[116.143464581289, 28.252977295834056],
@@ -169,27 +167,25 @@ describe('mapboxgl_VideoLayer', () => {
169167

170168
it('render moveLayer onRemove setVisibility', (done) => {
171169
var url = videoUrl;
172-
var videoLayer = new VideoLayer({
173-
url: url,
170+
var videoLayer = new VideoLayer(url, {
171+
fovX: 84,
172+
fovY: 47,
173+
centerX: 960,
174+
centerY: 540,
175+
pitch: -20,
176+
roll: 0,
177+
yaw: 2,
178+
x: 11587478.810629973,
179+
y: 3570800.195541344,
180+
z: 154.50312
181+
}, {
174182
opencv: cv,
175183
clipRegion: [
176184
[0, 0],
177185
[1920, 0],
178186
[1920, 900],
179187
[0, 900]
180188
],
181-
videoParameters: {
182-
fovX: 84,
183-
fovY: 47,
184-
centerX: 960,
185-
centerY: 540,
186-
pitch: -20,
187-
roll: 0,
188-
yaw: 2,
189-
x: 11587478.810629973,
190-
y: 3570800.195541344,
191-
z: 154.50312
192-
},
193189
extent: [
194190
[116.14394400766855, 28.249134537249257],
195191
[116.143464581289, 28.252977295834056],

0 commit comments

Comments
 (0)