Ensure updateLegend happens after adding layer

Add a second event binding to make sure this always happens *after* a layer is added. Use debounce for performance, so that if these two events occur within 200ms, only the later call will execute.