code: function getDistance(start, end) {
    function toRadians(num) {
      return num * Math.PI / 180;
    }
    var R = 6371000;  // earth radius in metres
    var lat1 = toRadians(start.latitude / COORD_FACTOR);
    var lat2 = toRadians(end.latitude / COORD_FACTOR);
    var lon1 = toRadians(start.longitude / COORD_FACTOR);
    var lon2 = toRadians(end.longitude / COORD_FACTOR);
  
    var deltalat = lat2-lat1;
    var deltalon = lon2-lon1;
    var a = Math.sin(deltalat/2) * Math.sin(deltalat/2) +
        Math.cos(lat1) * Math.cos(lat2) *
        Math.sin(deltalon/2) * Math.sin(deltalon/2);
    var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    return R * c;
  }
docs: Calculate the distance between two points using the "haversine" formula.
  The formula is based on http://mathforum.org/library/drmath/view/51879.html.
  @param start The starting point
  @param end The end point
  @return The distance between the points in meters