title: leaflet multiple markers django map reference?
body: <p>I'm using Python 3.4, latest Django with the leaflet django install.  I'm able to display the map, and add 1 marker from my list.</p>
  
  <p>The problem is adding all of the markers in the list.  The code renders all of the markers but not all of them get added to the map.  Maybe I'm losing the map reference via a scope issue?  I'm not sure.  Here is my code, I really could use the help.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{% load leaflet_tags %}
  
  &lt;head&gt;
      
      {% leaflet_js %}
      {% leaflet_css %}
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
  {% if latest_device_list %}
   &lt;script type="text/javascript"&gt;
  
      {% for device in latest_device_list %}
      function map_init_basic (map, options) {
    
          marker = new L.marker([{{device.Device_Lat}}, {{device.Device_Lon}}])
    .bindPopup("&lt;h3&gt;"+{{device.Device_IMEI}}+"&lt;/h3&gt;")
    .addTo(map);  
    
                }
      {% endfor %}
   &lt;/script&gt;
  {% else %}
      &lt;p&gt;No Devices are available.&lt;/p&gt;
  {% endif %}
    {% leaflet_map "yourmap" callback="window.map_init_basic" %}   
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>