PALMA, Majorca — In summers, Majorca and its sister islands off the eastern coast of Spain were once a discreet destination for the cultured, famous and well-heeled. In the 19th century, the composer Frédéric Chopin and his partner, the writer George Sand, were among those who sought its Mediterranean climate.

Celebrities still come, but in more recent years, bargain airlines and package tours have added to the mix, with Britons and others looking for cheap and drunken holidays.

It has gotten to the point where some hotels in the port of Magaluf have encased their balconies in glass panels to prevent inebriated clients from jumping off. Usually they land in swimming pools, sometimes not. In early June, a 20-year-old tourist became the second person to fall to his death this year.

Then there is Palma, the island’s quieter, tonier capital about a half-hour drive along the coast, where the mayor is erecting his own kind of barrier to tourists: In July, it will become the first Spanish city to ban the short-term rental of apartments through Airbnb and other home-sharing websites.