I am getting the GeoJSON URL from GeoServer and the data is getting displayed on the map using Leaflet. Now I need to display a few of the features based on the property "status" whether it is pass or rescan.
But I'm getting the following error:
Uncaught TypeError: Cannot read property 'status' of undefined
Below is my code:
var Dupont = new L.GeoJSON.AJAX("http://localhost:8080/geoserver/ABHI/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ABHI:Dupont_new&maxFeatures=50&outputFormat=application%2Fjson",{dataType:"json"});
Dupont.addTo(map);
var stataupass=L.geoJson(Dupont, {
filter: function(feature, layer) {
return (feature.properties.status)=="rescan";
}
}).addTo(map);
link to Geojson data (fiddle)