Skip to main content

fit_bounds

Function fit_bounds 

Source
pub fn fit_bounds(
    pins: &[LatLng],
    viewport_w: f32,
    viewport_h: f32,
) -> (LatLng, u8)
Expand description

Compute the bounding box of a set of pins, then return a (center, zoom) that fits all pins with a small padding margin. Returns a default map center + MIN_ZOOM if pins is empty.