optimized marker show/hide functionality