Simplifying condition for null geojson geometries.

Used feedback from @mourner to make the change from the pull request
#1240
This commit is contained in:
Brian Herbert 2012-12-28 11:56:19 +09:00
parent 2a38a809d3
commit 971e55b911

View File

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