Merge pull request #1139 from kitor/master

togeojson.js: Fix bug with parsing Google KML files
This commit is contained in:
Dave Ingram
2016-12-27 14:50:18 -08:00
committed by GitHub

View File

@ -96,6 +96,8 @@ toGeoJSON = (function() {
for (j = 0; j < geomNodes.length; j++) { for (j = 0; j < geomNodes.length; j++) {
geomNode = geomNodes[j]; geomNode = geomNodes[j];
if (geotypes[i] == 'Point') { if (geotypes[i] == 'Point') {
if(nodeVal(get1(geomNode, 'coordinates')) === null)
continue;
geoms.push({ geoms.push({
type: 'Point', type: 'Point',
coordinates: coord1(nodeVal(get1(geomNode, 'coordinates'))) coordinates: coord1(nodeVal(get1(geomNode, 'coordinates')))