title: Trouble getting Gmaps4rails callbacks working
body: <p>I am unable to get a Javascript callback to work with gmaps4_rails when the map has loaded or is in the 'idle' state.</p>
  
  <p>Based on the wiki and this other SO question <a href="https://stackoverflow.com/questions/5046987/dynamically-load-google-maps-markers-with-gmaps4rails">Dynamically load Google Maps Markers with gmaps4rails</a> I thought this would fire all of the alerts in this view:</p>
  
  <pre><code>&lt;%= gmaps(:map_options =&gt; {:detect_location =&gt; true,
                             :center_on_user =&gt; true,
                             :auto_zoom =&gt; true,
                             :zoom =&gt; 12,
                             :auto_adjust =&gt; false},
             :markers =&gt; {:data =&gt; @json,   
                          :options =&gt; {:processsing =&gt; "@json",
                                       :list_container =&gt; "markers_list",
                                       :do_clustering =&gt; true
                                                         } }) %&gt;
  &lt;ul id="markers_list"&gt; &lt;/ul&gt;
  
  &lt;script type="text/javascript" charset="utf-8"&gt;
    alert("About to register callback");
    Gmaps.map.callback = function() {
      alert("Map Loaded Callback Reached");
    }
  
    function gmaps4rails_callback() {
       alert("gmaps4_rails callback");
    }
  &lt;/script&gt;
  
  &lt;%= yield :scripts %&gt;
  </code></pre>
  
  <p>Instead I only get the "about to register callback" alert. The other functions never seem to be called. I have a feeling I'm misunderstanding something about the namespace but any insight would be appreciated- I'm trying to get things setup to refresh from a JSON endpoint as the map moved but I'm not having a lot of luck getting past this first step of making sure I can trigger a callback.</p>
  
  <p>I should note the map appears normally and my initial data is all there.</p>