MAP-1573: Calculating and setting the map bounderies

NOTE: This does not work correctly for setting the north boundary yet. Decided to put it as it is now and figure this out later.