Skip to content

Commit

Permalink
fix(geojson): geometry is null
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxue committed Apr 23, 2019
1 parent 4297de6 commit 3fc7747
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ demos/index.html
demos/*
rollup/*
webpack/*
src/core/three.js
src/core/three.js
testdemo/*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ demos/data
demos/image
.vscode
demos/hexagon.html
demos/model
demos/model
testdemo
2 changes: 1 addition & 1 deletion demos/04_choropleths_polygon.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
window.scene = scene;
scene.on('loaded', () => {
var colors = ["#FFF5B8","#FFDC7D","#FFAB5C","#F27049","#D42F31","#730D1C"];
$.getJSON('https://gw.alipayobjects.com/os/basement_prod/7224a078-e3a3-4cc3-8749-7026af9e5c7f.json', city => {
$.getJSON('https://gw.alipayobjects.com/os/basement_prod/77497aa8-8dd0-4a0c-bf3b-3bb55c5d453c.json', city => {

const citylayer = scene.PolygonLayer()
.source(city)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/l7",
"version": "1.1.9",
"version": "1.1.10",
"description": "Large-scale WebGL-powered Geospatial Data Visualization",
"main": "build/l7.js",
"browser": "build/l7.js",
Expand Down
1 change: 1 addition & 0 deletions src/source/parser/geojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getCoords } from '@turf/invariant';

export default function geoJSON(data) {
const resultData = [];
// 数据为空时处理
turfMeta.flattenEach(data, (currentFeature, featureIndex) => { // 多个polygon 拆成一个
const coord = getCoords(currentFeature);
const dataItem = {
Expand Down

0 comments on commit 3fc7747

Please sign in to comment.