OnTransformListener
The interface OnTransformListener is a member of com.here.android.mpa.mapping.Map.
Interface Summary
public static abstract interface Map.OnTransformListener
Listener for Map
transform events.
[For complete information, see the section Interface Details]
Method Summary
Methods |
---|
Called after onMapTransformStart() once the MapState returns to a steady value (such as when it has stopped moving). |
Called just before the MapState begins to change. |
Interface Details
Listener for 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.
Method Details
public abstract void onMapTransformEnd (MapState mapState)
Called after onMapTransformStart() once the MapState returns to a steady value (such as when it has stopped moving).
Parameters:
-
mapState
The current state of the map at the time of this callback
public abstract void onMapTransformStart ()
Called just before the 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.