Closed lopezvoliver closed 6 days ago
Thanks! I believe this was already possible using traitlets:
m = Map()
m.observe(handle_zoom, 'zoom')
Thanks! I believe this was already possible using traitlets:
m = Map() m.observe(handle_zoom, 'zoom')
This works, I can access the 'new' zoom in my handle_zoom
function. Thanks!
This new
on_zoom
feature is useful for implementing zoom-dependent logic, e.g. adding or removing components to the map based on zoom level.For example:
where
legend_control
is a control that I want shown only on zoom 10 or above: