Skip to content

Add a "no tiles" option #330

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 1 commit into from
Jan 15, 2016
Merged

Conversation

ocefpaf
Copy link
Member

@ocefpaf ocefpaf commented Jan 15, 2016

See #249.

@BibMartin
Copy link
Contributor

Simple, clean. Thanks @ocefpaf .

BibMartin added a commit that referenced this pull request Jan 15, 2016
@BibMartin BibMartin merged commit 9c4dcb2 into python-visualization:master Jan 15, 2016
@ocefpaf ocefpaf deleted the no_tiles branch January 15, 2016 13:11
@ocefpaf
Copy link
Member Author

ocefpaf commented Jan 15, 2016

I am not sure if we can change the grey background to another color though. But this will be a niche feature anyways.

@BibMartin
Copy link
Contributor

An ugly hack: if you want a white background, you can create a Layer pointing to white tiles.

# Create a white image of 4 pixels, and embed it in a url.
white_tile = folium.utilities.image_to_url([[1,1],[1,1]])

# Create a map using this url for each tile.
m = folium.Map(tiles=white_tile, attr='white tile')

@BibMartin
Copy link
Contributor

I don't think it shall be embeded in folium, but it's good to remember.

@ocefpaf
Copy link
Member Author

ocefpaf commented Jan 15, 2016

I don't think it shall be embeded in folium,

Agree.

but it's good to remember.

👍 (That actually gave me a few crazy ideas 😉)

@BibMartin
Copy link
Contributor

(That actually gave me a few crazy ideas 😉)

Yeah ; like:

tile = folium.utilities.image_to_url([[(-1)**((i+j)//30) for i in range(300)] for j in range(300)])
tile = folium.utilities.image_to_url([[(-1)**((i//30+j//30)) for i in range(300)] for j in range(300)])

@ocefpaf
Copy link
Member Author

ocefpaf commented Jan 15, 2016

I really like the second one:

http://nbviewer.ipython.org/gist/ocefpaf/efcf54d0a3710b324b60

@ocefpaf ocefpaf added the enhancement Feature request or idea about how to make folium better label Feb 12, 2016
@ocefpaf ocefpaf added this to the v0.2.0 milestone Feb 12, 2016
sanga pushed a commit to sanga/folium that referenced this pull request Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or idea about how to make folium better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants