Changed the map rendering so that it can deal with different canvas sizes by setting the canvas with as the map size.