mirror of https://gitee.com/antv-l7/antv-l7
fix(source): geojson parser filter invalid
This commit is contained in:
parent
af7ead3443
commit
2702f028b0
|
@ -3,6 +3,10 @@ import { getCoords } from '@turf/invariant';
|
|||
|
||||
export default function geoJSON(data) {
|
||||
const resultData = [];
|
||||
data.features = data.features.filter(item => {
|
||||
return item != null && item.geometry && item.geometry.type && item.geometry.coordinates && item.geometry.coordinates.length > 0;
|
||||
});
|
||||
|
||||
// 数据为空时处理
|
||||
turfMeta.flattenEach(data, (currentFeature, featureIndex) => { // 多个polygon 拆成一个
|
||||
const coord = getCoords(currentFeature);
|
||||
|
|
Loading…
Reference in New Issue