Merge pull request #1240 from brianherbert/allow-null-geojson

Allow null GeoJSON geometries.
This commit is contained in:
Vladimir Agafonkin 2012-12-28 04:49:31 -08:00
commit 733666bcab

View File

@ -20,7 +20,10 @@ L.GeoJSON = L.FeatureGroup.extend({
if (features) { if (features) {
for (i = 0, len = features.length; i < len; i++) { for (i = 0, len = features.length; i < len; i++) {
this.addData(features[i]); // Only add this if geometry or geometries are set and not null
if (features[i].geometries || features[i].geometry) {
this.addData(features[i]);
}
} }
return this; return this;
} }