Gmap center and resize when block is collapsed

When you have a problem with google map when hiding or collapsing it within a block you need to do something to fix this. A way to do this is to make gmap block absolute in position and -10000 px in left like

#block-gmap_location-0{
    position: absolute;
   left: -10000px;
}

and then use jquery to show it with js script

  $('#block-gmap_location-0').css("position","relative");
   $('#block-gmap_location-0').css("left","0px"); 

and finally map is fixed and working.