title: Rendering a Gmap through an AJAX call with Gmaps4rails
body: <p>There are topics that try to cover this here: <a href="https://stackoverflow.com/questions/5340055/gmaps4rails-map-not-showing-when-loaded-dynamically">Gmaps4rails : map not showing when loaded dynamically</a> and especially here: <a href="https://stackoverflow.com/questions/5611113/rendering-google-map-using-gmaps4rails-through-ajax">Rendering google map using gmaps4rails through Ajax</a>, also watched the screencast in which a gmap is dynamically updated but I still don't seem to get it work.</p>
  
  <p>I am trying to load the map in a drop-down tab only if a button is clicked displaying the direction between a user and an offer. In my _location.html.erb partial I have:</p>
  
  <p><code>&lt;%= gmaps({ "direction"   =&gt; { "data" =&gt; { "from" =&gt; current_user.location, "to" =&gt; @offer.location } }       })%&gt;</code></p>
  
  <p>(the locations are addresses)</p>
  
  <p>Now this works nicely when the partial is rendered immediately. If I however try to render the partial over an AJAX call later after the whole page has already loaded initially, the gmap is not displayed. Is it possible to initialize and render the gmap through an AJAX call and display directions then? </p>