Reload google map API in a popup

Reload google map API in a popup

Hi all,

I've an issue with a popup, I load in a google map, but when I click for a second request , the google maps isn't refresh despite I use  google.maps.event.trigger(map, 'resize');
My code is : 
  1.   var geocoder;
  2.   var map = null;
  3.   function initialize() {
  4.     geocoder = new google.maps.Geocoder();
  5.     var latlng = new google.maps.LatLng(-34.397, 150.644);
  6.     var mapOptions = {
  7.       zoom: 12,
  8.       center: latlng,
  9.       mapTypeId: google.maps.MapTypeId.ROADMAP
  10.     }
  11.     map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  12. googlemaps();
  13.   }
  14.   function lafonction(){
  15.  $( "#popupMap" ).popup( "open" );
  16.  
  17.   }
  18.   function googlemaps(){  
  19.  var address = window.localStorage.getItem("url");
  20.  geocoder = new google.maps.Geocoder();
  21. geocoder.geocode({ 'address': address }, function(results, status) {
  22. if (status == google.maps.GeocoderStatus.OK) {
  23. map.setCenter(results[0].geometry.location);
  24. var marker = new google.maps.Marker({
  25. map: map,
  26. position: results[0].geometry.location
  27.   });
  28. google.maps.event.trigger(map, 'resize');
  29.  } else {
  30. alert("Pas de localisation");
  31.  }
  32. });  
  33.   }

the HTML is :

  1. <a href="#" data-rel="popup" data-position-to="window" data-role="button" data-theme="b" data-inline="true" onClick="lafonction()">Localiser</a>
  2.              <div id="fiche" data-role="listview">
  3.                        <div data-role="popup" id="popupMap" data-overlay-theme="a" data-theme="a" data-corners="false" data-tolerance="15,15">
  4.                                 <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
  5.                           <iframe src="map.html" width="480" height="320" seamless></iframe>
  6.           </div> 
  7.                 </div>

And then the map is not centerd on the marker, the marker is on the left corner.

thanks a lot