Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created January 24, 2013 17:09
Show Gist options
  • Select an option

  • Save objectivehtml/4625210 to your computer and use it in GitHub Desktop.

Select an option

Save objectivehtml/4625210 to your computer and use it in GitHub Desktop.
$('a[data-toggle="tab"]').on('shown', function (e) {
google.maps.event.trigger(map_map, 'resize');
var bounds = new google.maps.LatLngBounds();
$.each(map_markers, function(i, marker) {
bounds.extend(marker.getPosition());
});
if(map_markers.length > 1) {
map_map.fitBounds(bounds);
}
else {
map_map.setZoom(map_options.zoom);
map_map.setCenter(bounds.getCenter());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment