我用Django做了一个网页应用程序,我在网页上有一个导航栏和一个Map。它在电脑和横向屏幕设备上工作得很好,但是在纵向屏幕设备上Map有一个自由空间。
我的Map代码:
current_map = folium.Map(location=start_location, zoom_start=6)
fig = branca.element.Figure(height="100%")
fig.add_child(current_map)
context = {"current_map": current_map._repr_html_()}
return render(request, template_name="index.html", context=context)
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
{{ current_map | safe }}
</body>
</html>
我该怎么填?
2条答案
按热度按时间dzjeubhm1#
好吧,我可能会使用Figure并修改folium包。
我下载了
folium-0.12.1.post1.tar.gz
,并从folium/folium.py
中删除了列表_default_js
和_default_css
中有关旧版本Bootstrap的内容。在
requirements.txt
中,我使用这个本地修改的distr:bnlyeluc2#
试试看:
index.html: