mirror of https://gitee.com/antv-l7/antv-l7
commit
a371768cee
|
@ -1,5 +1,10 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import {
|
||||||
import { Mapbox } from '@antv/l7-maps';
|
Scene,
|
||||||
|
LineLayer
|
||||||
|
} from '@antv/l7';
|
||||||
|
import {
|
||||||
|
Mapbox
|
||||||
|
} from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
|
|
|
@ -18,6 +18,6 @@ describe('extrude polyline', () => {
|
||||||
coord[1] = lat;
|
coord[1] = lat;
|
||||||
});
|
});
|
||||||
const mesh = extrude.extrude(coords);
|
const mesh = extrude.extrude(coords);
|
||||||
expect(mesh.indices.length).toBe(12);
|
expect(mesh.indices.length).toBe(6);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,12 +34,17 @@ function isPointEqual(a: vec2, b: vec2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArrayUnique(matrix: number[][]) {
|
function getArrayUnique(matrix: number[][]) {
|
||||||
const result: number[][] = [];
|
const map = new Map();
|
||||||
matrix.map((item) => {
|
for (let i = 0; i < matrix.length; i++) {
|
||||||
item.sort((a, b) => b - a);
|
const key = matrix[0].toString() + '-' + matrix[1].toString();
|
||||||
result.push(item);
|
if (map.get(key)) {
|
||||||
});
|
matrix.splice(i, 1);
|
||||||
return result;
|
i++;
|
||||||
|
} else {
|
||||||
|
map.set(key, key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IExtrudeLineOption {
|
export interface IExtrudeLineOption {
|
||||||
|
|
Loading…
Reference in New Issue