title: How in leaflet enable/disable overlays when changes baselayer?
body: <p>I create an interactive map of rooms. are highlighted on the map of houses for which there is space plans. on plans to light up the room.
  Вy default is open floor plan with enabled overlay illumination of rooms and disabled overlay markers.
  Further, when you switch to a map you want to hide from the group of 3 layers of overlay and remove them from the map. </p>
  
  <pre><code>    map.removeLayer(roomsOverlay);
      map.removeLayer(markersOverlay);
      map.removeLayer(bld2_1_lbls);
      layerControl.removeLayer(roomsOverlay);
      layerControl.removeLayer(markersOverlay);
      layerControl.removeLayer(bld2_1_lbls);
  </code></pre>
  
  <p>Now when you return back to the plan of the building should be returned 3 overlay</p>
  
  <pre><code>    layerControl.addOverlay(roomsOverlay,"Rooms");
      layerControl.addOverlay(markersOverlay,"markersOverlay");
      layerControl.addOverlay(bld2_1_lbls,"lab");
  </code></pre>
  
  <p>but now these overlays are disabled, how to do that they have been checked in layercontrol?
  also want to when switching to a map overlay was active.</p>
  
  <p>Demo: <a href="http://plnkr.co/edit/do27UnlRoWaEyqrs8VHe?p=preview" rel="nofollow">http://plnkr.co/edit/do27UnlRoWaEyqrs8VHe?p=preview</a></p>
  
  <p>p.s.</p>
  
  <pre><code>map.on('baselayerchange', function(e) {
  if (e.name=="cartoDBmap")
  {/*some code*/
      map.removeLayer(roomsOverlay);  //if not remove they can be seen on Africa
      map.removeLayer(markersOverlay);
      map.removeLayer(bld2_1_lbls);
      layerControl.removeLayer(roomsOverlay);
      layerControl.removeLayer(markersOverlay);
      layerControl.removeLayer(bld2_1_lbls);
  
      layerControl.addOverlay(buildingsOverlay,"buildings"); //how make it checked on layercontrol?
  }
  else
  {/*some code*/
      layerControl.addOverlay(roomsOverlay,"Rooms");  //how make it checked on layercontrol?
      layerControl.addOverlay(markersOverlay,"markersOverlay");
      layerControl.addOverlay(bld2_1_lbls,"lab");
  
      layerControl.removeLayer(buildingsOverlay);
      map.removeLayer(buildingsOverlay);
  }
  console.log(layerControl);
  });
  </code></pre>