added out-of-view optimization to map shifting