code: function distance(λ1,φ1,λ2,φ2) {
      var R = 6371000;
      Δλ = (λ2 - λ1) * Math.PI / 180;
      φ1 = φ1 * Math.PI / 180;
      φ2 = φ2 * Math.PI / 180;
      var x = Δλ * Math.cos((φ1+φ2)/2);
      var y = (φ2-φ1);
      var d = Math.sqrt(x*x + y*y);
      return R * d;
  }
docs: Calculate the approximate distance between two coordinates (lat/lon)
  
  © Chris Veness, MIT-licensed,
  http://www.movable-type.co.uk/scripts/latlong.html#equirectangular