title: How to get reference to map that is already set on div
body: <p>I have a div on my page called 'map', and I set google map in it:</p>
  
  <pre><code>(function () {
          window.onload = function () {
              var mapDiv = document.getElementById('map');
              var latlng = new google.maps.LatLng('@lng', '@lat');
              var options = { styles: styleArray,
                  center: latlng,
                  zoom: 15,
                  mapTypeId: google.maps.MapTypeId.ROADMAP,
                  mapTypeControl: false                
              };
              var map = new google.maps.Map(mapDiv, options);
  ...
  </code></pre>
  
  <p>Now I have some other functions and I need reference to this map div so I can add markers on it.
  So how I can get reference to this dic with map to get map object?
  I tried this way but it doesn't work:</p>
  
  <pre><code>var map = new google.maps.Map(document.getElementById("map"));
  </code></pre>