Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folium map not displaying in Spyder

The title says it all : I can't get Spyder to display a map with folium.

Here is what I get :

import folium
m = folium.Map(location=[45.5236, -122.6750])
m

No error (and no map), just this :

< folium.folium.Map at 0xd03fcf8 >

m.render() # No idea what .render() it's supposed to do, 
# but "render" sounds like maybe it could display the map, so I tried it.
# But it prints nothing

m.render

< bound method LegacyMap.render of < folium.folium.Map object at 0x000000000D03FCF8 > >

Any idea ?

Thanks

(Note : I tried this, with no success)

like image 725
François M. Avatar asked Sep 21 '17 09:09

François M.


1 Answers

If you have a map m you could use:

m.save("mymap.html")

It saves your map in your working directory as html. You still have to open it manually in Chrome/IE. The advantage of this is that you can e-mail your map to anyone you want, even if he/she does not have python on his/her computer.

like image 200
Dick van Huizen Avatar answered Sep 18 '22 18:09

Dick van Huizen