Event handling¶
Click or move the map to trigger callbacks.
In [1]:
from maplibreum import Map
def handle_click(data):
print('Clicked at', data['lngLat'])
def handle_move(data):
print('Map center', data['center'])
m = Map()
m.on_click(handle_click)
m.on_move(handle_move)
m
Out[1]: