Embed a map as an iframe on a page.
()
| 30 | |
| 31 | @app.route("/iframe") |
| 32 | def iframe(): |
| 33 | """Embed a map as an iframe on a page.""" |
| 34 | m = folium.Map() |
| 35 | |
| 36 | # set the iframe width and height |
| 37 | m.get_root().width = "800px" |
| 38 | m.get_root().height = "600px" |
| 39 | iframe = m.get_root()._repr_html_() |
| 40 | |
| 41 | return render_template_string( |
| 42 | """ |
| 43 | <!DOCTYPE html> |
| 44 | <html> |
| 45 | <head></head> |
| 46 | <body> |
| 47 | <h1>Using an iframe</h1> |
| 48 | {{ iframe|safe }} |
| 49 | </body> |
| 50 | </html> |
| 51 | """, |
| 52 | iframe=iframe, |
| 53 | ) |
| 54 | |
| 55 | |
| 56 | @app.route("/components") |
nothing calls this directly
no test coverage detected
searching dependent graphs…