title: How to add map control with leaflet?
body: <p>I'm struggling with turning on the Map Control in Leaflet.</p>
  
  <p>Staring at the example doesn't seem to help.  I know I must be making a stupid mistake, but I can't figure it out.</p>
  
  <p><a href="http://leaflet.cloudmade.com/examples/layers-control.html" rel="nofollow">http://leaflet.cloudmade.com/examples/layers-control.html</a></p>
  
  <p>I've got my map, and it loads, displays ok, but at the <code>addTo(map)</code> method I get the error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot call method 'addTo' of undefined</p>
  </blockquote>
  
  <p>Any ideas what I'm missing?</p>
  
  <pre><code>var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
  var osmAttrib='Map data &amp;copy; &lt;a href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; contributors';
  var street_layer = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 18, attribution: osmAttrib});
  map = new L.Map('map',{
                  center: initial_center,
                  zoom: initial_zoom,
                  layers: mapLayersList    
  });
  var baseMaps = {"Streets": street_layer};
  L.Control.Layers(baseMaps, null).addTo(map);
  </code></pre>