This fixes the attributions not being fetched and not showing initially when the map is added to the DOM and the layer is added to the map at a later point (e.g. on a button click).
To reproduce, once the demo page loads, click on the button to add the layer. You will notice the attribution is still missing (it's still left as "Leaflet"). It is correctly updated only once the map is moved.
This fixes the attributions not being fetched and not showing initially when the map is added to the DOM and the layer is added to the map at a later point (e.g. on a button click).
Demo of the issue: https://jsfiddle.net/agorf/tphbuLvu/
To reproduce, once the demo page loads, click on the button to add the layer. You will notice the attribution is still missing (it's still left as "Leaflet"). It is correctly updated only once the map is moved.