MCPcopy Create free account
hub / github.com/python-visualization/folium / components

Function components

docs/_static/flask_example.py:57–88  ·  view source on GitHub ↗

Extract map components and put those on a page.

()

Source from the content-addressed store, hash-verified

55
56@app.route("/components")
57def components():
58 """Extract map components and put those on a page."""
59 m = folium.Map(
60 width=800,
61 height=600,
62 )
63
64 m.get_root().render()
65 header = m.get_root().header.render()
66 body_html = m.get_root().html.render()
67 script = m.get_root().script.render()
68
69 return render_template_string(
70 """
71 <!DOCTYPE html>
72 <html>
73 <head>
74 {{ header|safe }}
75 </head>
76 <body>
77 <h1>Using components</h1>
78 {{ body_html|safe }}
79 <script>
80 {{ script|safe }}
81 </script>
82 </body>
83 </html>
84 """,
85 header=header,
86 body_html=body_html,
87 script=script,
88 )
89
90
91if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…