title: adding layers in layer group dynamically to layer control in leaflet
body: <p>I am creating a bunch of vector layers via <code>xhr</code> calls, and want to add the to a layer group and add that layer group to a layer control. The way I am thinking is</p>
  
  <pre><code>1. Add a layer control to the map with only the base layer in the control
  2. Create a layer via `xhr`  
     2.1. Check if layer group LG exists in layer control  
        2.1.1. If yes, add layer to LG
        2.1.2. If no, add layer group LG to layer control and add layer to LG
  3. Repeat #2 above.
  </code></pre>
  
  <p>Well, I tried the above (without the layer group part) and that works (code below).</p>
  
  <pre><code>LC = L.control.layers({'OSM': osm}).addTo(map);
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>x.onload = function(e) {
      if (x.readyState === 4) {
          if (x.status === 200) {
              var res = JSON.parse(x.responseText);
              ..
              LC.addOverlay(lyr, "layer name");
          }
      }
  };
  </code></pre>
  
  <p>However, I can't figure out to do it with a layer group. Suggestions welcome.</p>