debugged calculation of visible part of map and its conjunction with UI