Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

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