Merge pull request #1240 from brianherbert/allow-null-geojson
Allow null GeoJSON geometries.
This commit is contained in:
commit
733666bcab
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user