Uncomment the following line to install leafmap if needed.
# !pip install leafmap
import os
from leafmap import leafmap
Using local files
Download the sample png from https://i.imgur.com/06Q1fSz.png to your Downloads
folder.
filepath = "weather.png"
url = "https://opengeos.org/data/images/weather.png"
if not os.path.exists(filepath):
leafmap.download_file(url, filepath)
m = leafmap.Map(center=(25, -115), zoom=4)
image = leafmap.ImageOverlay(url=filepath, bounds=((13, -130), (32, -100)))
m.add_layer(image)
m
Using remote files
m = leafmap.Map(center=(25, -115), zoom=4)
image = leafmap.ImageOverlay(url=url, bounds=((13, -130), (32, -100)))
m.add_layer(image)
m
Update image url
# image.url = "https://i.imgur.com/J9qCf4E.png"