Well, you will need to define your map in terms of world units, since it is 2D I will assume world units are in pixels.
So if your tiles are 32x32 pixels you map will be, in pixels
Assuming a zoom level of 1, so size of a world unit pixel is the same size as a screen pixel. This means your viewing volume is 800x600 pixels.
At this point you simply need to compare sides of your viewing volume to the sides of the map. For example, if the right side of the viewing space is greater than the map size, then the camera is outside the bounds. You then correct the bounds to match the mapSize
right = left + screenSize.width
if (right > mapSize.width)
// clamp the right side to the edge
right = mapSize.width
// since right = left + screenSize.width, I solve
// for the left based on the new right value
left = right - screenSize.width;