function center_map( map ) {

	// vars
	var bounds = new google.maps.LatLngBounds();

	// loop through all markers and create bounds
	$.each( map.markers, function( i, marker ){

		var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );

		bounds.extend( latlng );

	});

	// only 1 marker?
	if( map.markers.length == 1 )
	{
		// set center of map
	    map.setCenter( bounds.getCenter() );
	    map.setZoom( 10 );
	}
	else
	{
		// fit to bounds
		map.fitBounds( bounds );
	}

}
/*
*  center_map
*
*  This function will center the map, showing all markers attached to this map
*
*  @type	function
*  @date	8/11/2013
*  @since	4.3.0
*
*  @param	map (Google Map object)
*  @return	n/a
*/
center_map
This function will center the map, showing all markers attached to this map
center_map This function will center the map showing all markers attached to this map
function center_map( map ) {
	var bounds = new google.maps.LatLngBounds();
	$.each( map.markers, function( i, marker ){
		var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );
		bounds.extend( latlng );
	});
	if( map.markers.length == 1 )
	{
	    map.setCenter( bounds.getCenter() );
	    map.setZoom( 10 );
	}
	else
	{
		map.fitBounds( bounds );
	}
}
function center_map ( map ) { var bounds = new google . maps . LatLngBounds ( ) ; $ . each ( map . markers , function ( i , marker ) { var latlng = new google . maps . LatLng ( marker . position . lat ( ) , marker . position . lng ( ) ) ; bounds . extend ( latlng ) ; } ) ; if ( map . markers . length == 1 ) { map . setCenter ( bounds . getCenter ( ) ) ; map . setZoom ( 10 ) ; } else { map . fitBounds ( bounds ) ; } }
center_map
This function will center the map, showing all markers attached to this map
center_map This function will center the map showing all markers attached to this map
// vars // loop through all markers and create bounds // only 1 marker? // set center of map // fit to bounds