google maps

how to load a google maps with a renderPartial?

a link is clicked and an action is called:


$this->renderPartial('_gmaps', array('daytrip' => $daytrip), false, true);

but when you click the link, the page will refresh and will turn into a empty page…

known issue?

what do you store inside the gmaps view?


<script type="text/javascript" src="http://www.google.com/jsapi"></script>


<script type="text/javascript">

google.load("maps", "3",  {other_params:"sensor=false"});


function initialize() {

    var geocoder = new google.maps.Geocoder();    

    var address = 'eibergen';


    if (geocoder) {

        geocoder.geocode( { 'address': address}, function(results, status) {

            if (status == google.maps.GeocoderStatus.OK) {                

                var myOptions = {

                    zoom: 8,

                    center: results[0].geometry.location,

                    mapTypeId: google.maps.MapTypeId.ROADMAP

                };

                

                var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);


                var marker = new google.maps.Marker({

                    map: map, 

                    position: results[0].geometry.location

                });

            } else {

                alert("Geocode was not successful for the following reason: " + status);

            }

        });

    }

};   


google.setOnLoadCallback(initialize); 

</script> 

<div id="map_canvas" style="width:425; height:344;"></div>