Legally, the boat has to maintain a certain distance with it's engine on.
BUT, if the whale comes up to the boat while the boat is still, that is not illegal. I have seen many whales come up to small fishing/ charter boats and breach, play by flapping their fins, just eye the people on the boat, especially when there are children on board. Breaching, like in the photo, where the whale comes up out of the water, may also be a way to warn the boats they are coming.
No one really knows for sure why they breach.
Excerpt:
Although
marine biologists have paid recent attention to the
endangered species of whales, they have not conducted enough research to know exactly why whales breach. Breaching occurs when a
whale, especially a humpback, flips itself entirely out of the water, twists in midair, and lands loudly on its side. Tourists on whale-watching tours may think the cavorting
mammals breach just to create
photogenic moments, but it probably has more to do with communication, comfort, defense, or predatory behavior.
I'm not saying this boat didn't edge up the to whale slowly, but he may also be innocent. The whale could have just come close up to the boat.