Render offline map with ipyleaflet and ipywebrtc
Does not work in Colab
%%capture
!pip install ipyleaflet ipywebrtc
from ipyleaflet import *
thurles_point = (52.6801064,-7.804442099999999)
thurles = Map(center=(52.8001064,-7.804442099999999), zoom=8, basemap=basemaps.Esri.DeLorme)
marker = Marker(location=thurles_point, draggable=False)
thurles.add_layer(marker)
The map needs to be rendered for ipywebrtc to work
thurles
from ipywebrtc import WidgetStream, ImageRecorder
thurles_stream = WidgetStream(widget=thurles, max_fps=1)
thurles_img = ImageRecorder(stream=thurles_stream)
thurles_img.recording = True
thurles_img.autosave = False
thurles_img.download()
import PIL.Image
import PIL.ImageFilter
import io
thurles_pil = PIL.Image.open(io.BytesIO(thurles_img.image.value))
thurles_pil