Skip to content

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

Open
agorf wants to merge 1 commit intodigidem:gh-pagesfrom
agorf:gh-pages
Open

Update attribution when adding layer after map is added to the DOM#30
agorf wants to merge 1 commit intodigidem:gh-pagesfrom
agorf:gh-pages

Conversation

@agorf
Copy link

@agorf agorf commented Nov 15, 2017

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 agorf changed the title Update attribution when adding map if empty Update attribution when adding layer after map is added to the DOM Nov 16, 2017
Copy link

@diachedelic diachedelic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be made to index.js, not leaflet-bing-layer.js as that file is generated by npm run build

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).
@agorf
Copy link
Author

agorf commented Jul 31, 2018

@diachedelic Fixed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants