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

Don't need separate SimpleHTTPServer #1

Open
bburky opened this issue Dec 2, 2013 · 2 comments
Open

Don't need separate SimpleHTTPServer #1

bburky opened this issue Dec 2, 2013 · 2 comments

Comments

@bburky
Copy link

bburky commented Dec 2, 2013

FYI, you can not use a second separate SimpleHTTPServer if you use IPython's relative files/ url path. This is a directory mapped to the contents of the directory where the server has been started.

For example, use this code:

<iframe src=files/osm.html width=1000 height=500></iframe>

I couldn't quite get this to work with nbviewer though, so your results may vary.

I'm also trying to skip generating files on disk entirely, using folium's internal map.HTML attribute, but that doesn't quite work in all cases.

@jlaura
Copy link
Owner

jlaura commented Dec 3, 2013

I have noticed that iPython caches the page. In an ESDA environment the hacky trick around this was to use a random number generator to append some value to osm.html, eg. osm1234.html. Perhaps that solves the issue?

Good to know re: files/

@bburky
Copy link
Author

bburky commented Dec 3, 2013

I think I may have phrased that poorly. I was mostly just saying that the SimpleHTTPServer wasn't needed if you use files/.

Thanks for posting this sample code though, was looking for a starting point to put a slippy map into IPython, everyone else seems to use matplotlib or something and just renders bitmap images.

This is the code I'm using now:
http://nbviewer.ipython.org/gist/bburky/7763555/folium-ipython.ipynb

Note that the first map works, because it's embedded into the notebook. But the second doesn't quite work because nbviewer handles files/ strangely I think. Works fine locally though.

No real issue here, just some info.

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

No branches or pull requests

2 participants