Invisible link to canonical for Microformats

Folium maps

How to incorporate a map created with Folium

This page explains how to incorporate a map created with Folium into a web page. Folium is a Python library that allows you to create interactive maps using Leaflet.js. To incorporate a map created with Folium into a web page, you need to save the map to an .html file and include it in the web page.

Incorporating a map created with Folium into a web page

To incorporate a map created with Folium into a web page, you need to follow these steps:

  • Create a map with Folium
  • Save the map to an .html file
  • Include the .html file in the web page
    • Use the iframe tag to embed the .html file in the web page
    • Specify the path of the .html file as the value of the src attribute of the iframe tag
    • Specify the map dimensions using the width and height attributes of the iframe tag
    • Example HTML code to incorporate a map created with Folium into a web page:

<iframe src="/prova_master/assets/charts/map.html" width="100%" height="500"></iframe>

Note that the map created with Folium was exported with width and height set to 100%. You can adjust the map dimensions by modifying the values of the width and height attributes of the iframe tag.