document Map events
This commit is contained in:
parent
2e5ff2e4a4
commit
a8ed9b80ef
@ -43,9 +43,9 @@ public abstract class Map implements TaskQueue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener interface for map update notifications.
|
* Listener interface for map update notifications.
|
||||||
* Layers implementing this interface they will be automatically
|
* Layers implementing this interface they will be automatically register
|
||||||
* register when the layer is added to the map and unregistered when
|
* when the layer is added to the map and unregistered when the layer is
|
||||||
* the layer is removed.
|
* removed. Otherwise use map.events.bind(UpdateListener).
|
||||||
*/
|
*/
|
||||||
public interface UpdateListener extends EventListener {
|
public interface UpdateListener extends EventListener {
|
||||||
void onMapEvent(Event e, MapPosition mapPosition);
|
void onMapEvent(Event e, MapPosition mapPosition);
|
||||||
@ -53,23 +53,32 @@ public abstract class Map implements TaskQueue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener interface for input events.
|
* Listener interface for input events.
|
||||||
* Layers implementing this interface they will be automatically
|
* Layers implementing this interface they will be automatically register
|
||||||
* register when the layer is added to the map and unregistered when
|
* when the layer is added to the map and unregistered when the layer is
|
||||||
* the layer is removed.
|
* removed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface InputListener extends EventListener {
|
public interface InputListener extends EventListener {
|
||||||
void onInputEvent(Event e, MotionEvent motionEvent);
|
void onInputEvent(Event e, MotionEvent motionEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***/
|
|
||||||
public static Event UPDATE_EVENT = new Event();
|
|
||||||
/**
|
/**
|
||||||
* Map state has changed in a way that all layers should clear their state
|
* UpdateListener event. Map position has changed.
|
||||||
* e.g. the theme or the TilesSource has changed
|
*/
|
||||||
|
public static 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();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 Event CLEAR_EVENT = new Event();
|
||||||
public static Event POSITION_EVENT = new Event();
|
|
||||||
|
|
||||||
public final EventDispatcher<InputListener, MotionEvent> input;
|
public final EventDispatcher<InputListener, MotionEvent> input;
|
||||||
public final EventDispatcher<UpdateListener, MapPosition> events;
|
public final EventDispatcher<UpdateListener, MapPosition> events;
|
||||||
@ -82,12 +91,7 @@ public abstract class Map implements TaskQueue {
|
|||||||
|
|
||||||
protected final MapEventLayer mEventLayer;
|
protected final MapEventLayer mEventLayer;
|
||||||
protected GestureDetector mGestureDetector;
|
protected GestureDetector mGestureDetector;
|
||||||
/**
|
|
||||||
* Listener interface for map update notifications.
|
|
||||||
* Layers implementing this interface they will be automatically
|
|
||||||
* register when the layer is added to the map and unregistered when
|
|
||||||
* the layer is removed.
|
|
||||||
*/
|
|
||||||
private TileLayer mBaseLayer;
|
private TileLayer mBaseLayer;
|
||||||
|
|
||||||
protected boolean mClearMap = true;
|
protected boolean mClearMap = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user