0

I am using Google Colab. I am trying to add a background map to a network map via the built-in function ox.plot_graph_folium from osmnx.

However, the map is not shown up.

My code:

graph_map = ox.plot_graph_folium(G, popup_attribute='name', edge_width=2)
# save as html file then display map as an iframe
filepath = 'stockholm.html'
graph_map.save(filepath)
IFrame(filepath, width=900, height=500)

Error message:

localhost refused to connect.

enter image description here

Attempt to fix it

I have read a question that may be relevant in StackOverflow (here). To be honest, I am an amateur. I didn't really understand what the code means. But still, I tried it and it doesn't work anyway.

!ln -s /usr/local/share/jupyter/nbextensions /nbextensions
%cd /nbextensions

Any help would be appreciated.

0 Answers0