ViewportTransition
ViewportTransition
is a protocol that Viewport
depends on as it orchestrates transitions
to and from different ViewportState
s.
MapboxMaps provides implementations of ViewportTransition
that can be created and
configured via methods on Viewport
. Applications may also define their own implementations to
handle advanced use cases not covered by the provided implementations.
-
Runs the transition to
toState
.The completion block must be invoked with
true
if the transition completes successfully. If the transition fails, invoke the completion block withfalse
.If the returned
Cancelable
is canceled, it not necessary to invoke the completion block (but is safe to do so — it will just be ignored).Transitions should handle the possibility that the “to” state might fail to provide a target camera in a timely manner or might update the target camera multiple times during the transition (a “moving target”).