In Google Maps JavaScript API V3 we can use something like this:
let markers
let map
const bounds = map.getBounds()
markers.filter(m => m.isAdded).forEach(m => {
if (bounds.contains(m.getPosition())) {
// code for showing your object, associated with current marker
}
})