Skip to content
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

Non deterministic zoom level when exporting to Jupyter slides #874

Closed
astrojuanlu opened this issue May 31, 2018 · 5 comments
Closed

Non deterministic zoom level when exporting to Jupyter slides #874

astrojuanlu opened this issue May 31, 2018 · 5 comments
Labels
bug An issue describing unexpected or malicious behaviour jupyter This issue/PR has to do about Jupyter

Comments

@astrojuanlu
Copy link

Please add a code sample or a nbviewer link, copy-pastable if possible

http://nbviewer.jupyter.org/format/slides/gist/Juanlu001/7feeffbada57114423d68fe0bf491352#/0/1

Problem description

[this should explain why the current behavior is a problem and what is the expected output.]

When opening the link above, sometimes I get a zoomed map and sometimes I get a world map. It depends on F5 versus Ctrl+F5 and has a random result. Tested on Linux Mint 18.3 with both Firefox and Chromium.

Expected Output

Always a zoomed map.

Output of folium.__version__

$ python -c "import folium as f;print(f.__version__)"
0.5.0
@astrojuanlu
Copy link
Author

I attach a screencast of the observed behavior:

ezgif com-optimize

@ocefpaf
Copy link
Member

ocefpaf commented May 31, 2018

I believe that ipyleaft may be a better fit for this case. We cannot keep up with the constant changes in how jupyter/jupyterlab deals with HTML/JS display :-(

@ocefpaf ocefpaf added the bug An issue describing unexpected or malicious behaviour label May 31, 2018
@astrojuanlu
Copy link
Author

Thanks for your quick answer @ocefpaf. It's a pity because ipyleaflet being a widget instead of an HTML content makes it trickier to share in some use cases, but we understand the issue and in fact we have been doing experiments with both.

@ocefpaf
Copy link
Member

ocefpaf commented May 31, 2018

being a widget instead of an HTML content makes it trickier to share in some use cases

I know, that is the only reason why we are still keeping folium afloat.

but we understand the issue and in fact we have been doing experiments with both.

The changes in how they handle HTML/JS made me loose my interest in this sort of thing. For example, to get folium to work with JupyterLab I have to actually write JS but the whole reason behind folium is to not write JS 😆

@ocefpaf
Copy link
Member

ocefpaf commented Nov 9, 2018

@Juanlu001 I looked into this and I could not find the culprit. Something with revealjs does not play well with how we are loading all the folium JS deps. Closing this as "unsolvable" but I'll keep looking into a better way ti isolate things.

PS: note that the m.fit_bounds(m.get_bounds()) may help you there.

@ocefpaf ocefpaf closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected or malicious behaviour jupyter This issue/PR has to do about Jupyter
Projects
None yet
Development

No branches or pull requests

3 participants