digidem / leaflet-bing-layer

Bing Maps Layer for Leaflet v1.0.0
http://digidem.github.io/leaflet-bing-layer/
87 stars 53 forks source link

Update attribution when adding layer after map is added to the DOM #30

Open agorf opened 6 years ago

agorf commented 6 years ago

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.

agorf commented 6 years ago

@diachedelic Fixed. Thanks.