Index: js/gmap.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/gmap.js,v retrieving revision 1.1.2.12 diff -u -p -r1.1.2.12 gmap.js --- js/gmap.js 18 Feb 2007 20:49:29 -0000 1.1.2.12 +++ js/gmap.js 28 Feb 2007 03:49:43 -0000 @@ -112,6 +112,11 @@ Drupal.gmap.addHandler('gmap',function(e map.setCenter(new GLatLng(obj.vars.latitude,obj.vars.longitude), obj.vars.zoom); }); + // Workaround for collapsable elements containing maps. + obj.bind("collapsehack",function() { + map.checkResize(); + }); + // Respond to incoming zooms var binding = obj.bind("zoom",function(){map.setZoom(obj.vars.zoom)}); // Send out outgoing zooms @@ -314,7 +319,19 @@ function gmap_validate_dim(dim) { } if (Drupal.jsEnabled) { - $(document).ready(Drupal.gmap.setup) + $(document).ready(function() { + Drupal.gmap.setup(); + if (Drupal.toggleFieldset) { + // Uh oh, collapse.js is on. + // We need to checkResize all of the maps whenever something is collapsed or expanded. + // Since collapse.js might run AFTER us, defer ourselves so we get run after the event handler is done. + setTimeout(function() { + $('fieldset.collapsible > legend a').click(function() { + Drupal.gmap.globalChange('collapsehack'); + }); + },1); + } + }) .unload(function() { //Google cleanup. GUnload();