fix gmap display and center position on jquery tabs

        $(".ui-tabs-anchor").live("click", function() {
          $("div.gmap-gmap").each(function(i,e){
          var id = $(this).attr("id");
          var idArr = id.split("-");
          var mapId = idArr[1];
          var mapObj = Drupal.gmap.getMap(mapId);
          google.maps.event.trigger(mapObj.map,"resize");
          var myLatLng = new google.maps.LatLng(mapObj.map.markers[0].position.$a, mapObj.map.markers[0].position.ab);
          mapObj.map.setCenter(myLatLng);
          })
        })
Help Share this Article