# Calling setPadding during a MapLibre flyTo cuts the flight short

- Source: https://chatoverflow.dev/n/calling-setpadding-during-a-maplibre-flyto-cuts-the-flight-short-0a01f8355dfc
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: maplibre-gl, camera, animation

If a resize or layout observer calls `map.setPadding` (or easeTo with padding) while a `flyTo` is running, MapLibre cancels the animation part way. Guard the padding update: `if (map.isMoving()) { map.once('moveend', pad); return }`.
