-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
added default options to tile_layer #124
Conversation
@ozak can you share an example image or notebook showing the fix pls. 👍 |
Will do once I solve come issues with the projection of the data I have and upload the web site I am working on. |
@ozak great thanks! |
One question...I have been trying to have the layer be active to start with, which is what the |
@ozak that should do it in my experience, adding |
without the change in the
which is what would be generated with the change I made. Or do you mean another My test basically executed the following code in an IPython notebook,
using |
@ozak interesting, that would work, maybe its the variable declaration? i.e |
Are you able to have some (non-base) layer active to start with? |
@ozak not at the min i dont think, the only things active from init are the base layers |
It looks like one needs to add it to the map's layers:
|
@ozak you shouldn't really need to do that, doing |
I completely agree with you. It should add it without having to do much else. Looking at the html output and the code, it seems |
Looks like one would need to generate some loop to write the elements of
which would have to come after the |
@ozak Can you add a test to your new functionality? Just a simple template test like we have in https://github.com/python-visualization/folium/blob/master/tests/folium_tests.py would do. |
Ok...I added the test and it worked on my computer. I see it is failing on 3.3 (passes on 2.7 and 3.4), but it is not related to what I have done. It fails due to
|
Python 3.x is crashing randomly and I am unsure why. Anyway, I re-started the test and Travis-CI is happy now. Back to you @birdage! If you think this is ready merge away! |
My guess is that the crashes are related to an issue I unearthed in #152: dictionaries are unordered and thus if you don't use the |
@andrewgiessel Thanks for fixing the tests. @ozak Sorry for the delay! Can you squash your commits? @birdage Are you done with the reviews? |
missing template added Otherwise ``folium.initialize_notebook()`` causes error. added test
@ocefpaf Done! |
def add_tile_layer(self, tile_name=None, tile_url=None, active=False): | ||
def add_tile_layer(self, tile_name=None, tile_url=None, active=False, minZoom=0, | ||
maxZoom=18, tms=False, continuousWorld=False, noWrap=False, zoomOffset=0, | ||
zoomReverse=False, opacity=1, attribution='Leaflet'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attribution
should be a string about the source of the layer, correct? Leave the default equal to None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozak can you write some docstring regarding these options?
Thanks @ozak! I made a few comments in your PR. Feel free to ping me if you need any clarification. |
@ocefpaf I'll try to answer to your comments, but won't be able to do so for a couple of days, since I am trying to meet a couple of deadlines. Sorry for the delay! |
No problem. The time we demand from contributors is inverse to pay. That means you get zero pay but infinite time 😜 PS: If you address the comments I might get this merged as is and we can work on it later. |
The problem is that I have to reacquaint myself with the code and leaflet in general... 😄 |
I hear you! The whole purpose of folium is to avoid that, but as developer we cannot afford to do it 😒 |
@ozak with the recent changes on folium I am certain that this belongs in the |
Sure...I will take a look into it. But as I said it might take a while (at least a month) before I can go back to this. |
Not a problem. I am behind the schedule with |
This addresses #123