pysepal.mapping.bounds.compute_zoom_for_bounds#
- pysepal.mapping.bounds.compute_zoom_for_bounds(bounds, map_width_px=1024, map_height_px=None, min_zoom=None, max_zoom=None)[source]#
Calculate the Web Mercator zoom that fits bounds into the viewport.
If
map_height_pxis provided, the zoom is limited by whichever axis runs out of pixels first (so tall bounds in a wide viewport, or vice versa, still fit fully). If omitted, behaviour matches the previous width-only calculation.