- } else if (feature.type === "relation") {
- geometry = L.featureGroup();
-
- feature.members.forEach(function (member) {
- if (features[member.type + member.ref]) {
- geometry.addLayer(features[member.type + member.ref]);
- }
- });
- }
-
- if (geometry) {
- features[feature.type + feature.id] = geometry;
+ } else if (feature.type === "relation" && feature.members) {
+ geometry = L.featureGroup(feature.members.map(featureGeometry).filter(function (geometry) {
+ return geometry !== undefined;
+ }));