The jury may, in any case, at the request of either party, be taken to view the premises or place in question, or any property, matter or thing relating to the controversy between the parties, when it shall appear to the court that such view is necessary to a just decision, and in such case the judge presiding at the trial may go with the jury and control the proceedings; and in a felony case the judge and the clerk shall go with the jury and the judge shall control the proceedings, and the accused shall likewise be taken with the jury or, if under recognizance, shall attend the view and his recognizance shall be construed to require such attendance. The party making the motion, in a civil case, shall advance a sum sufficient to defray the expenses of the jury and the officers who attend them in taking the view, which expenses shall be afterwards taxed like other legal costs.