I\'ve been looking around for a solution to this problem, but i can\'t seem to find somthing that solves this. The closest i get is this thread. But this doesn\'t work.
The above answer didn't work for me. Here's what did:
contained = true; map.fitBounds(bounds); map.setCenter(center); newbounds = map.getBounds(); for (i = 0; i < l; i ++) { if (!newbounds.contains(markers[i].getPosition())) { contained = false; } } if (!contained) map.setZoom(map.getZoom() - 1);