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