diff --git a/vtm/src/org/oscim/map/Animator.java b/vtm/src/org/oscim/map/Animator.java index 40b5ec04..ff9d3433 100644 --- a/vtm/src/org/oscim/map/Animator.java +++ b/vtm/src/org/oscim/map/Animator.java @@ -211,11 +211,8 @@ public class Animator { long millisLeft = mAnimEnd - MapRenderer.frametime; - //boolean changed = false; - ViewController v = mMap.viewport(); - //synchronized (v) { /* cancel animation when position was changed since last * update, i.e. when it was modified outside the animator. */ if (v.getMapPosition(mCurPos)) { @@ -293,5 +290,10 @@ public class Animator { mState = ANIM_NONE; mPivot.x = 0; mPivot.y = 0; + mMap.events.fire(Map.ANIM_END, mMap.mMapPosition); + } + + public boolean isActive() { + return mState != ANIM_NONE; } } diff --git a/vtm/src/org/oscim/map/Map.java b/vtm/src/org/oscim/map/Map.java index 8d2a15b0..9737ae8d 100644 --- a/vtm/src/org/oscim/map/Map.java +++ b/vtm/src/org/oscim/map/Map.java @@ -66,30 +66,33 @@ public abstract class Map implements TaskQueue { /** * UpdateListener event. Map position has changed. */ - public static Event POSITION_EVENT = new Event(); + public static final Event POSITION_EVENT = new Event(); /** * UpdateLister event. Delivered on main-thread when updateMap() was called * and no CLEAR_EVENT or POSITION_EVENT was triggered. */ - public static Event UPDATE_EVENT = new Event(); + public static final Event UPDATE_EVENT = new Event(); /** * UpdateListerner event. Map state has changed in a way that all layers * should clear their state e.g. the theme or the TilesSource has changed. * TODO should have an event-source to only clear affected layers. */ - public static Event CLEAR_EVENT = new Event(); + public static final Event CLEAR_EVENT = new Event(); + + public static final Event ANIM_END = new Event(); public final EventDispatcher input; public final EventDispatcher events; private final Layers mLayers; private final ViewController mViewport; - protected final Animator mAnimator; - private final MapPosition mMapPosition; private final AsyncExecutor mAsyncExecutor; + protected final Animator mAnimator; + protected final MapPosition mMapPosition; + protected final MapEventLayer mEventLayer; protected GestureDetector mGestureDetector;