I’m reading the tutorial following this link: OpenStreetMapX_tutorial
More specifically, the code I’m running is the following:
using PyCall
flm = pyimport("folium")
matplotlib_cm = pyimport("matplotlib.cm")
matplotlib_colors = pyimport("matplotlib.colors")
cmap = matplotlib_cm.get_cmap("prism")
SHOW_PATHS=20
m = flm.Map()
for k=1:min(SHOW_PATHS, length(routes))
locs = [LLA(mx.nodes[n],mx.bounds) for n in routes[k]]
info = "Sample route number $k\n<BR>"*
"Length: $(length(routes[k])) nodes\n<br>" *
"From: $(routes[k][1]) $(round.((locs[1].lat, locs[1].lon),digits=4))\n<br>" *
"To: $(routes[k][end]) $(round.((locs[end].lat, locs[end].lon),digits=4))"
flm.PolyLine(
[(loc.lat, loc.lon) for loc in locs ],
popup=info,
tooltip=info,
color=matplotlib_colors.to_hex(cmap(k/SHOW_PATHS))
).add_to(m)
end
MAP_BOUNDS = [(mx.bounds.min_y,mx.bounds.min_x),(mx.bounds.max_y,mx.bounds.max_x)]
flm.Rectangle(MAP_BOUNDS, color="black",weight=6).add_to(m)
m.fit_bounds(MAP_BOUNDS)
In the tutorial, Jupiter is used. That’s why the map is drawn directly with a simple line calling the object m. I’m using Julia REPL. When I was trying to show the object m through REPL, the following is the output.
julia> m
PyObject <folium.folium.Map object at 0x7fe364b8c9b0>
So, I was wondering, how to draw this m folium.folium.Map object? Any comments are greatly appreciated.