           else
             tile = @drawTile mapX,mapY
 
-          #@ctx.fillStyle = "red"
-          #@ctx.fillRect i * @tileSize, j * @tileSize,@tileSize,@tileSize
           #@ctx.fillRect tileX,tileY,@tileSize,@tileSize
           #@ctx.putImageData tile,0,0,tileX,tileY,@tileSize,@tileSize
 

      @canvas.id = "can"
      @ctx = @canvas.getContext "2d"
      @canvas.setAttribute "id","#{@globalID}_canvas"

      @canvasWrapper = document.createElement "div"
      @canvasWrapper.appendChild @canvas

          #console.log "tile i:" + tileX + ",j:" + tileY
          @ctx.putImageData tile,tileX,tileY
          #@ctx.drawImage tile,tileX,tileY

      # control overlays

      # zoom control
      @ctx.fillStyle = "red"
      @ctx.fillRect @canvas.width - 40, @canvas.height - 35,15,15
      callback = -> alert "hi"
      @events.zoomIn = [@canvas.width - 40, @canvas.height - 35,15,15,callback]

      @ctx.fillStyle = "blue"
      @ctx.fillRect @canvas.width - 40, @canvas.height - 20,15,15
      @events.zoomOut = [@canvas.width - 40, @canvas.height - 20,15,15,callback]

      return @canvasWrapper

