Added a tileCanvasFunction option for drawing the canvas