# Loading a Google map in a partial via Ajax

**URL:** <https://www.ruby-forum.com/t/loading-a-google-map-in-a-partial-via-ajax/136076>\
**Category:** Rails\
**Created:** [April 28, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/loading-a-google-map-in-a-partial-via-ajax/136076 "2008-04-28T18:57:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chunkyslink](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f0a364/32.png) [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Post date:** [April 28, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/loading-a-google-map-in-a-partial-via-ajax/136076/1 "2008-04-28T18:57:37Z")

</div>

I’ve just started playing with Google Maps and ym4r\_gm. The map seems to  
work fine when it is called by the controller in a http request, but I  
was hoping I could load a map via a link\_to\_function only when it is  
called by the user. However, doing so seems to give a blank div, so I’m  
presuming that a need to make some sort of request to Google Maps during  
the link\_to\_function. Does any know how to fix this, or do I always need  
to load a map in the http request and then set the ‘display’ properties?

\<%= link\_to\_function(“See on Map”) do |page|  
page.insert\_html :top, “items\_wrapper”, “#{render :partial =\>  
“map/show”}”  
end %\>
