How to use ImageOverlay

It may happen that you want to draw an image on you map. Here are example on how to do that.


In [1]:
import sys
sys.path.insert(0,'..')
import folium
from folium import plugins

In importing a PNG

If you have a static image file on your disk, you can simply draw it on the map in doing:


In [2]:
m = folium.Map([37,0], zoom_start=1, tiles='stamentoner')

plugins.ImageOverlay(open('Mercator_projection_SW.png', 'br'),
                    [[-82,-180],[82,180]],
                    opacity=0.8,
                   ).add_to(m)

folium.LayerControl().add_to(m)
m


Out[2]: