  } else {
          val = 0;
        }
        instr = instr + "<p><b>Iš viso: " + Math.trunc(total_distance * 10) / 10 + "km. ";
        if (val > 0) {
          instr = instr + val + "val. ";
        }
        if (min > 0) {
          instr = instr + min + "m. ";
        }
        instr = instr + sek + "s.</b></p>";
        document.getElementById("instr").innerHTML=instr;
      })
      .catch(function(err) {
        if (err.message.startsWith('Cannot find point 0')) {
          alert('Pradžios taška