Google Maps API v3 - fitBounds centers only one marker
I have a few markers that I retrieve and want to center the map to. 
Yes, I have read all the other answers, but it doesn't seem to work for me:
http://stackoverflow.com/questions/1556921/google-map-api-v3-set-bounds-and-center

JS:
 
    geocoder.geocode( {'address': loc}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) {
				var markerBounds = new google.maps.LatLngBounds();
				var coordinate = results[0].geometry.location;
				var icon = new google.maps.MarkerImage("images/icon-"+type+".png", new google.maps.Size(37, 44));	
				
                //create the marker
				var marker = new google.maps.Marker({
					map: map, 
					position: coordinate,
					visible: true,
					id: type,
					shadow: shadow,
					icon: icon
				});
				markerBounds.extend(coordinate);
				map.fitBounds(markerBounds);
			}
    }
Google Maps API v3 - fitBounds centers only one marker
===

I have a few markers that I retrieve and want to center the map to. 
Yes, I have read all the other answers, but it doesn't seem to work for me:
http://stackoverflow.com/questions/1556921/google-map-api-v3-set-bounds-and-center

JS:
 
    geocoder.geocode( {'address': loc}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) {
				var markerBounds = new google.maps.LatLngBounds();
				var coordinate = results[0].geometry.location;
				var icon = new google.maps.MarkerImage("images/icon-"+type+".png", new google.maps.Size(37, 44));	
				
                //create the marker
				var marker = new google.maps.Marker({
					map: map, 
					position: coordinate,
					visible: true,
					id: type,
					shadow: shadow,
					icon: icon
				});
				markerBounds.extend(coordinate);
				map.fitBounds(markerBounds);
			}
    }