Skip to content

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

Open
angorf wants to merge 1 commit into
digidem:gh-pagesfrom
angorf:gh-pages
Open

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

Conversation

@angorf

@angorf angorf commented Nov 15, 2017

Copy link
Copy Markdown

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.

@angorf angorf 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

@diachedelic diachedelic left a comment

Copy link
Copy Markdown

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).
@angorf

angorf commented Jul 31, 2018

Copy link
Copy Markdown
Author

@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