Skip to content

Fix broken attribution for built-in tiles. #1128

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

Merged
merged 2 commits into from
Apr 14, 2019

Conversation

FabeG
Copy link
Contributor

@FabeG FabeG commented Apr 8, 2019

Small correction to fix broken attribution for built-in tiles (Closes #1117).

  • self.attr (from Map) has been removed (attribution now set with options)
  • updated tests

Maybe the attribution files (attr.txt) should be reviewed and updated too ?

Copy link
Member

@Conengmo Conengmo left a comment

Choose a reason for hiding this comment

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

Great PR @FabeG, thanks! Also good you improved the tests. I have one comment about the use of f-strings I hope you can look at.

url = m._env.get_template(url(tiles)).render()
attr = m._env.get_template(attr(tiles)).render()
tiles = "".join(tiles.lower().strip().split())
url = f"tiles/{tiles}/tiles.txt"
Copy link
Member

Choose a reason for hiding this comment

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

f-strings are great, but folium still supports Python 3.5. Right now we don't run tests for Python 3.5, but that's something we should probably do. Can you use normal format() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok @Conengmo , sorry for that, it is corrected now.
One question: I wanted to add also a test for tiles needing an API key (cloudmade and mapbox), but I noticed that you suppressed one in your previous commit (test_cloudmade). Any reason for that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Conengmo Ah, I see, you removed the test test_cloudmade following GH-1127.

- Going back to format instead of f-string (folium supports python 3.5)
- Change a little the attribution text ((c) replaced by ©)
- Corrected a dead link in mapbox attribution
@FabeG
Copy link
Contributor Author

FabeG commented Apr 12, 2019

It seems the previous CI tests have failed , but not sure it comes from the modifcations I made.

@Conengmo Conengmo merged commit 91c59c4 into python-visualization:master Apr 14, 2019
@Conengmo
Copy link
Member

Thanks for fixing this @FabeG! It's appreciated.

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.

Map attribution not showing up for built in tiles
2 participants