title: Filter Leaflet Geojson object based on Checkbox status
body: <p>I've been trying to adapt this <a href="https://www.mapbox.com/mapbox.js/example/v1.0.0/multiple-marker-filters/" rel="nofollow">example</a> to filter a leaflet layer based on the checkbox ID. It kind of works where the enabled object gets filled and the corresponding feature is filtered and added to the map.</p>
  
  <p>However, when I uncheck the box object becomes empty but the feature remains on the map as there is nothing to tell if to be removed. </p>
  
  <p>What do I need to do here to remove the feature? </p>
  
  <pre><code>   function update() {
          var enabled = {};
          // Run through each checkbox and record whether it is checked. If it is,
          // add it to the object of types to display, otherwise do not.
          for (var i = 0; i &lt; checkboxes.length; i++) {
            if (checkboxes[i].checked) enabled[checkboxes[i].id] = true;
           }
          L.geoJson(parishesData, {
          filter: function(feature, layer) {
              return (feature.properties.name in enabled);
              }
          }).addTo(map);
          console.log(enabled)
          };
  </code></pre>