code: function (coord1, coord2) {
          if (!this.getProjection()) {
              return null;
          }
          const p1 = new Coordinate(coord1),
              p2 = new Coordinate(coord2);
          if (p1.equals(p2)) {
              return 0;
          }
          return this.getProjection().measureLength(p1, p2);
      }
docs: Caculate distance of two coordinates.
  @param {Number[]|Coordinate} coord1 - coordinate 1
  @param {Number[]|Coordinate} coord2 - coordinate 2
  @return {Number} distance, unit is meter
  @example
  var distance = map.computeLength([0, 0], [0, 20]);