Optimize the calculation of visvis

visvis calculation is a significant part of map load time for large maps