public static interface Map.OnTransformListener
Map
transform events. Map transform events are triggered by any
operation which causes the MapState
to change.
This includes user interaction (such as map gestures) as well as programmatic calls to the
map.
onMapTransformStart()
is called just before the map state begins to change, while
onMapTransformEnd(MapState)
is called after the map state returns to a steady value.
Therefore, there can be a significant amount of time between when the two callbacks are made
in cases such as animated map movement events and continuous user interaction.
If you need to update UI widgets as the map state changes, the recommended approach is to
trigger a Runnable
object when onMapTransformStart()
is called. This method
periodically checks the current map state (at no more than 30fps) and updates the UI widgets.
The Runnable
object can then be cancelled upon a call to
onMapTransformEnd(MapState)
. An android.os.Handler
object can be used to
implement this elegantly.
Modifier and Type | Method and Description |
---|---|
void |
onMapTransformEnd(MapState mapState)
Called after
onMapTransformStart() once the
MapState returns to a steady value (such as
when it has stopped moving). |
void |
onMapTransformStart()
Called just before the
MapState begins to
change. |
void onMapTransformStart()
MapState
begins to
change. This can be triggered by user interaction (such as map gestures) as well as
programmatic calls to the map. This method will not be called again until an
onMapTransformEnd(MapState)
call has been made.void onMapTransformEnd(MapState mapState)
onMapTransformStart()
once the
MapState
returns to a steady value (such as
when it has stopped moving).mapState
- The current state of the map at the time of this callback