#!/usr/bin/env python # coding: utf-8 # In[ ]: from ipyleaflet import * from ipywidgets import * m = Map(center=(52, 10), zoom=8) tl = TileLayer(url="https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png") m.add(tl) label = Label(value="Not Loading") def on_load_change(change): loading = change["new"] label.value = str("Loading..." if loading else "Not Loading") tl.observe(on_load_change, "loading") display(m) display(label) # move the map, zoom out or zoom in to see the Label change from 'Loading...' to 'Not Loading' # In[ ]: