In [1]:
import os
import folium
print(folium.__version__)
In [2]:
m = folium.Map([37, 0], zoom_start=1, tiles='stamentoner')
merc = os.path.join('data', 'Mercator_projection_SW.png')
if not os.path.isfile(merc):
print(f'Could not find {merc}')
else:
img = folium.raster_layers.ImageOverlay(
name='Mercator projection SW',
image=merc,
bounds=[[-82, -180], [82, 180]],
opacity=0.6,
interactive=True,
cross_origin=False,
zindex=1,
)
folium.Popup('I am an image').add_to(img)
img.add_to(m)
folium.LayerControl().add_to(m)
m.save(os.path.join('results', 'ImageOverlay_0.html'))
m
Out[2]: