I have the following code:
//alert()
function initial
for some reason, when the map loads up, the zoom level is full, so its zoomed right into the marker.
If you have a bounds object with one LatLng in it, it should zoom in as far as possible. From the documentation:
fitBounds(bounds:LatLngBounds) None Sets the viewport to contain the given bounds.
If you only have one marker, don't use fitBounds, use .setCenter (on the coordinates of the marker, .setZoom (to your desired zoom level).
If your code needs to handle both cases (one marker or several markers), count the markers you add to the bounds, if the number is one use .setCenter/.setZoom, if it is more than one, use .fitBounds.