code: function(level, topLeftBound, bottomRightBound) {
          var leftX;
          var rightX;
          if (this.wrapHorizontal) {
              leftX = $.positiveModulo(topLeftBound.x, 1);
              rightX = $.positiveModulo(bottomRightBound.x, 1);
          } else {
              leftX = Math.max(0, topLeftBound.x);
              rightX = Math.min(1, bottomRightBound.x);
          }
          var topY;
          var bottomY;
          var aspectRatio = 1 / this.source.aspectRatio;
          if (this.wrapVertical) {
              topY = $.positiveModulo(topLeftBound.y, aspectRatio);
              bottomY = $.positiveModulo(bottomRightBound.y, aspectRatio);
          } else {
              topY = Math.max(0, topLeftBound.y);
              bottomY = Math.min(aspectRatio, bottomRightBound.y);
          }
  
          var topLeftTile = this.source.getTileAtPoint(level, new $.Point(leftX, topY));
          var bottomRightTile = this.source.getTileAtPoint(level, new $.Point(rightX, bottomY));
          var numTiles  = this.source.getNumTiles(level);
  
          if (this.wrapHorizontal) {
              topLeftTile.x += numTiles.x * Math.floor(topLeftBound.x);
              bottomRightTile.x += numTiles.x * Math.floor(bottomRightBound.x);
          }
          if (this.wrapVertical) {
              topLeftTile.y += numTiles.y * Math.floor(topLeftBound.y / aspectRatio);
              bottomRightTile.y += numTiles.y * Math.floor(bottomRightBound.y / aspectRatio);
          }
  
          return {
              topLeft: topLeftTile,
              bottomRight: bottomRightTile,
          };
      }
docs: private