How to add scrollbar to Python Folium popup?

Question:

How do you add a vertical scrollbar to a Python Folium map popup? I have too much information to display that the popup spans the entire screen currently.

Asked By: testytesttest

||

Answers:

Use an iframe object and add it to the folium.popup object.
Heres an example code:

import branca 

iframe = branca.element.IFrame(html='hello world' , width=500, height=400)

popup = folium.Popup(iframe, max_width=500 )

This example code automatically adds a scroll bar. Make sure your iFrame width matches the max width of the folium popup or else your scroll bar will not be within the bounds of the pop up object.

Answered By: Riku
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.