http://jsbin.com/hinekaj/edit?html,output
este es un enlace a un mapa estoy trabajando en. Sería genial si alguien pudiera ayudarme a ocultar los atributos que tienen "null" como valor. Soy consciente de que tengo que utilizar el comando IF, pero he estado luchando con él.
onEachFeature: function (feature, layer) {
layer.bindPopup('<strong>Address: </strong>'+ feature.properties.address
+ '<p></p>Sample 1: '+ feature.properties.sample_1 + ' Pb'
+ "<p></p>Sample 1: "+ feature.properties.sample_1 + ' Pb'
+ " , Sample 2: "+ feature.properties.sample_2 + ' Pb'
+ "<p></p>Sample 3: "+ feature.properties.sample_3 + ' Pb'
+ " , Sample 4: "+ feature.properties.sample_4 + ' Pb'
+ '<p></p>Sample 5: '+ feature.properties.sample_5 + ' Pb'
+ ' , Sample 6: '+ feature.properties.sample_6 + ' Pb'
+ '<p></p>Sample 7: '+ feature.properties.sample_7 + ' Pb'
+ ' , Sample 8: '+ feature.properties.sample_8 + ' Pb'
+ '<p></p>Sample 9: '+ feature.properties.sample_9 + ' Pb'
+ ' , Sample 10: '+ feature.properties.sample_10 + ' Pb'
+ '<p></p>Sample 11: '+ feature.properties.sample_11 + ' Pb'
+ ' , Sample 12: '+ feature.properties.sample_12 + ' Pb'
+ '<p></p>Sample 13: '+ feature.properties.sample_13 + ' Pb'
+ ' , Sample 14: '+ feature.properties.sample_14 + ' Pb'
);
},