Skip to main content

pan

Function pan 

Source
pub fn pan(
    centre_longitude: f64,
    centre_latitude: f64,
    zoom: f64,
    dx_px: f64,
    dy_px: f64,
    tile_size: u32,
) -> (f64, f64)
Expand description

Apply a pan: the user dragged the visible map by (dx_px, dy_px) pixels. Returns the new camera centre.

Sign convention: a positive dx_px means “drag right” — the content under the finger moves right, so the camera moves left in geo space and longitude decreases. Same for dy_px / latitude: drag down → camera moves up → latitude increases.