Add events for scale / rotate / tilt by user (#256)
This commit is contained in:
parent
5f534656ea
commit
77653096f9
@ -2,6 +2,7 @@
|
|||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016 devemux86
|
||||||
* Copyright 2016 Andrey Novikov
|
* Copyright 2016 Andrey Novikov
|
||||||
|
* Copyright 2016 Longri
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@ -404,6 +405,15 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene
|
|||||||
mPrevY2 = y2;
|
mPrevY2 = y2;
|
||||||
|
|
||||||
mMap.updateMap(true);
|
mMap.updateMap(true);
|
||||||
|
|
||||||
|
if (mMap.viewport().getMapPosition(mapPosition)) {
|
||||||
|
if (mDoScale)
|
||||||
|
mMap.events.fire(Map.SCALE_EVENT, mapPosition);
|
||||||
|
if (mDoRotate)
|
||||||
|
mMap.events.fire(Map.ROTATE_EVENT, mapPosition);
|
||||||
|
if (mDoTilt)
|
||||||
|
mMap.events.fire(Map.TILT_EVENT, mapPosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMulti(MotionEvent e) {
|
private void updateMulti(MotionEvent e) {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016 devemux86
|
||||||
* Copyright 2016 Andrey Novikov
|
* Copyright 2016 Andrey Novikov
|
||||||
|
* Copyright 2016 Longri
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@ -498,6 +499,15 @@ public class MapEventLayer2 extends AbstractMapEventLayer implements InputListen
|
|||||||
mPrevY2 = y2;
|
mPrevY2 = y2;
|
||||||
|
|
||||||
mMap.updateMap(true);
|
mMap.updateMap(true);
|
||||||
|
|
||||||
|
if (mMap.viewport().getMapPosition(mapPosition)) {
|
||||||
|
if (mDoScale)
|
||||||
|
mMap.events.fire(Map.SCALE_EVENT, mapPosition);
|
||||||
|
if (mDoRotate)
|
||||||
|
mMap.events.fire(Map.ROTATE_EVENT, mapPosition);
|
||||||
|
if (mDoTilt)
|
||||||
|
mMap.events.fire(Map.TILT_EVENT, mapPosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMulti(MotionEvent e) {
|
private void updateMulti(MotionEvent e) {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
* Copyright 2016 Andrey Novikov
|
* Copyright 2016 Andrey Novikov
|
||||||
* Copyright 2016 Stephan Leuschner
|
* Copyright 2016 Stephan Leuschner
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016 devemux86
|
||||||
|
* Copyright 2016 Longri
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@ -85,6 +86,21 @@ public abstract class Map implements TaskQueue {
|
|||||||
*/
|
*/
|
||||||
public static final Event MOVE_EVENT = new Event();
|
public static final Event MOVE_EVENT = new Event();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateListener event. Map was scaled by user.
|
||||||
|
*/
|
||||||
|
public static final Event SCALE_EVENT = new Event();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateListener event. Map was rotated by user.
|
||||||
|
*/
|
||||||
|
public static final Event ROTATE_EVENT = new Event();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateListener event. Map was tilted by user.
|
||||||
|
*/
|
||||||
|
public static final Event TILT_EVENT = new Event();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateLister event. Delivered on main-thread when updateMap() was called
|
* UpdateLister event. Delivered on main-thread when updateMap() was called
|
||||||
* and no CLEAR_EVENT or POSITION_EVENT was triggered.
|
* and no CLEAR_EVENT or POSITION_EVENT was triggered.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user