Here are some points:
If anyone is still needing an answer to this question, I have a complete working model on Codepen.io
Feel free to download it and tweak it for your needs. Just please change the API key to your own. (They're free)
https://codepen.io/pailwriter/pen/bGEpeRv
Here's the function to get the markers in viewport.
function showVisibleMarkers() {
var bounds = map.getBounds(),
count = 0;
for (var i = 0; i < markers.length; i++) {
var marker = markers[i],
infoPanel = $('.info-' + (i+1) ); // array indexes start at zero, but not our class names :)
if(bounds.contains(marker.getPosition())===true) {
infoPanel.show();
count++;
}
else {
infoPanel.hide();
}
}
$('#infos h2 span').html(count);
}