A new tourism law has been approved for a Spanish city as the government cracks down on the number of tourist apartments.