Thinking back on it, though, I would absolutely not give further notice if I was only doing "busy" work (as someone suggested elsewhere). I try to maintain a good relationship with my employers as a professional courtesy. Putting out notice beyond what active work I have would, I think, send a signal that I'm looking to collect an easy pay check and disconnect. Lining up my resignation with my active work sends a message that I am still invested in contributing to my team's success, and that's a good way to have people be more than happy to give you referrals or networking opportunities in the future.
As with all social etiquette, it's a guideline, not a law. The outcome depends entirely on your relationship with your boss and what kind of position the team is left in when you leave.
In all cases, they have been appreciated, and it gave me the opportunity to wrap up projects.
In several cases(the previous three jobs), I have been retained in a 1099 capacity at rates that far exceed my salary(3-5x) for consulting on projects and ongoing expertise of archaic systems. Typically that arrangement winds down to very little work after the first year.
In all of these scenarios, my manager was aware I was looking for months before I put in my notice. My reason for moving is a combination of environment(outgrown the scale of the company, or looking to relocate) and pay.