All mining claims, including patented and unpatented claims, shall be subject to the right-of-way of any ditch, flume, pipeline for transporting water or air for mining purposes, or of any tram, tramway, or pack trail, across any such locations or claims. Any person or corporation desiring to construct, maintain, and operate any such flume, ditch, pipeline, tram, tramway, or pack trail shall pay due and just compensation for such right-of-way to the owner of the claim through which it is proposed to construct, operate, and maintain such flume, ditch, pipeline, tram, tramway, or pack trail. When the parties cannot agree upon such right-of-way and the amount of compensation to be paid the owner of such claim, the same shall be determined in the manner provided by law for the exercise of right of eminent domain. Such ditch, flume, or pipeline shall be so constructed that the water from such ditch, flume, or pipeline shall not injure vested rights by flooding.