public class MapTouchController extends java.lang.Object implements android.view.View.OnTouchListener, android.view.GestureDetector.OnGestureListener, ScaleGestureDetector.OnScaleGestureListener, android.view.GestureDetector.OnDoubleTapListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
MapTouchController.DeconflictionListener |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAXITEMS |
static int |
STATE_MANUAL_TILT_DISABLED |
static int |
STATE_PROGRAMATIC_TILT_DISABLED |
static int |
STATE_TILT_DISABLED |
static int |
STATE_TILT_ENABLED |
static java.lang.String |
TAG |
| Constructor and Description |
|---|
MapTouchController(MapView view) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.SortedSet<MapItem> |
_fetchOrthoHitItems(android.view.MotionEvent event,
int limit) |
void |
addDeconflictionListener(MapTouchController.DeconflictionListener l)
Add a custom deconfliction filter this is responsible for doing something wtih the
sorted set.
|
void |
cancelMotionEvents() |
void |
dispose() |
void |
focus(MapItem item) |
PointMapItem |
getFreeForm3DItem() |
GeoPoint |
getFreeForm3DPoint() |
boolean |
getInGesture() |
int |
getTiltEnabledState()
Get the current tilt lock state
|
static boolean |
goTo(MapItem item,
boolean select)
Pan, zoom, and bring up radial and coord overlay for a map item
|
boolean |
isCameraPanToEnabled() |
boolean |
isFreeForm3DEnabled() |
boolean |
isLongPressDragging() |
boolean |
isNadirClamped()
Check if the map view tilt is zero and NADIR clamping is enabled since
the last touch event
|
boolean |
isUserOrientationEnabled()
Whether the user has free control over the map rotation
|
static boolean |
isValidErrorEllipse(double v)
Check to see if the value ie either a valid CE or LE.
|
void |
lockControls() |
void |
lockScaleFocus()
Lock the scale focus to whatever the focus point
This will update when the map view size changes
|
void |
lockScaleFocus(int pixelx,
int pixely) |
boolean |
onDoubleTap(android.view.MotionEvent event) |
boolean |
onDoubleTapEvent(android.view.MotionEvent event) |
boolean |
onDown(android.view.MotionEvent event) |
boolean |
onFling(android.view.MotionEvent arg0,
android.view.MotionEvent arg1,
float arg2,
float arg3) |
protected void |
onItemDoubleTap(MapItem item,
android.view.MotionEvent event) |
protected void |
onItemDragContinued(MapItem item,
android.view.MotionEvent event) |
protected void |
onItemDragDropped(MapItem item,
android.view.MotionEvent event) |
protected boolean |
onItemDragStarted(MapItem item,
android.view.MotionEvent event) |
protected void |
onItemLongPress(MapItem item,
android.view.MotionEvent event) |
protected void |
onItemPress(MapItem item,
android.view.MotionEvent event) |
protected void |
onItemRelease(MapItem item,
android.view.MotionEvent event) |
protected boolean |
onItemSingleTap(MapItem item,
android.view.MotionEvent event) |
void |
onLongPress(android.view.MotionEvent event) |
protected void |
onMapDoubleTap(android.view.MotionEvent event) |
protected void |
onMapLongPress(android.view.MotionEvent event) |
protected void |
onMapPress(android.view.MotionEvent event) |
protected void |
onMapPress(android.view.MotionEvent event,
GeoPoint touchPoint) |
protected void |
onMapRelease(android.view.MotionEvent event) |
protected void |
onMapSingleTap(android.view.MotionEvent event) |
boolean |
onScale(ScaleGestureDetector detector)
Responds to scaling events for a gesture in progress.
|
boolean |
onScaleBegin(ScaleGestureDetector detector)
Responds to the beginning of a scaling gesture.
|
void |
onScaleEnd(ScaleGestureDetector detector)
Responds to the end of a scale gesture.
|
void |
onScaleEvent(MapEvent event)
Default scale event handling called by
MapTouchEventListener |
boolean |
onScroll(android.view.MotionEvent e1,
android.view.MotionEvent e2,
float dx,
float dy) |
void |
onShowPress(android.view.MotionEvent arg0) |
boolean |
onSingleTapConfirmed(android.view.MotionEvent event) |
boolean |
onSingleTapUp(android.view.MotionEvent arg0) |
boolean |
onTouch(android.view.View v,
android.view.MotionEvent event) |
void |
removeDeconflictionListener(MapTouchController.DeconflictionListener l)
Remove a custom deconfliction filter this is responsible for doing something wtih the
sorted set.
|
void |
setCameraPanToEnabled(boolean b) |
void |
setFreeForm3DEnabled(boolean enabled)
Set whether 3D free look is enabled
|
void |
setFreeForm3DItem(MapItem item)
Set the focused map item in free form 3D mode
|
void |
setFreeForm3DPoint(GeoPoint point) |
void |
setTiltEnabledState(int state)
Allows for programmatic setting of the tilt lock state.
|
void |
setToolActive(boolean toolActive) |
void |
setUserOrientation(boolean orientation)
Set whether the user has free control over the map rotation
|
void |
skipDeconfliction(boolean skip) |
void |
unlockControls() |
void |
unlockScaleFocus() |
public static final java.lang.String TAG
public static final int MAXITEMS
public static final int STATE_TILT_ENABLED
public static final int STATE_MANUAL_TILT_DISABLED
public static final int STATE_PROGRAMATIC_TILT_DISABLED
public static final int STATE_TILT_DISABLED
public MapTouchController(MapView view)
public void lockControls()
public void unlockControls()
public void dispose()
public void setCameraPanToEnabled(boolean b)
public boolean isCameraPanToEnabled()
protected void onItemLongPress(MapItem item, android.view.MotionEvent event)
protected boolean onItemDragStarted(MapItem item, android.view.MotionEvent event)
protected void onItemDragContinued(MapItem item, android.view.MotionEvent event)
protected void onItemDragDropped(MapItem item, android.view.MotionEvent event)
protected void onMapLongPress(android.view.MotionEvent event)
protected void onItemPress(MapItem item, android.view.MotionEvent event)
protected void onMapPress(android.view.MotionEvent event)
protected void onMapPress(android.view.MotionEvent event,
GeoPoint touchPoint)
protected void onItemDoubleTap(MapItem item, android.view.MotionEvent event)
protected void onMapDoubleTap(android.view.MotionEvent event)
protected boolean onItemSingleTap(MapItem item, android.view.MotionEvent event)
item - MapItem that was clicked.event - Event representing the click.protected void onMapSingleTap(android.view.MotionEvent event)
protected void onItemRelease(MapItem item, android.view.MotionEvent event)
protected void onMapRelease(android.view.MotionEvent event)
public boolean onTouch(android.view.View v,
android.view.MotionEvent event)
onTouch in interface android.view.View.OnTouchListenerpublic boolean onDown(android.view.MotionEvent event)
onDown in interface android.view.GestureDetector.OnGestureListenerpublic boolean onFling(android.view.MotionEvent arg0,
android.view.MotionEvent arg1,
float arg2,
float arg3)
onFling in interface android.view.GestureDetector.OnGestureListenerpublic void onLongPress(android.view.MotionEvent event)
onLongPress in interface android.view.GestureDetector.OnGestureListenerpublic void addDeconflictionListener(MapTouchController.DeconflictionListener l)
l - the deconfliction listener.public void removeDeconflictionListener(MapTouchController.DeconflictionListener l)
l - the deconfliction listener.public static boolean goTo(MapItem item, boolean select)
item - The map item to go toselect - True to bring up radial, false to just focus onpublic void focus(MapItem item)
public static boolean isValidErrorEllipse(double v)
v - the value to check.protected java.util.SortedSet<MapItem> _fetchOrthoHitItems(android.view.MotionEvent event, int limit)
public boolean onScroll(android.view.MotionEvent e1,
android.view.MotionEvent e2,
float dx,
float dy)
onScroll in interface android.view.GestureDetector.OnGestureListenerpublic void onShowPress(android.view.MotionEvent arg0)
onShowPress in interface android.view.GestureDetector.OnGestureListenerpublic boolean onSingleTapUp(android.view.MotionEvent arg0)
onSingleTapUp in interface android.view.GestureDetector.OnGestureListenerpublic void setUserOrientation(boolean orientation)
orientation - True if user-controlled map rotation enabledpublic boolean isUserOrientationEnabled()
public void setTiltEnabledState(int state)
state - can either be:
STATE_TILT_ENABLED=0,
STATE_MANUAL_TILT_DISABLED=1,
STATE_PROGRAMATIC_TILT_DISABLED=2,
STATE_TILT_DISABLED=3public int getTiltEnabledState()
public void setFreeForm3DEnabled(boolean enabled)
enabled - True if enabeldpublic void setFreeForm3DItem(MapItem item)
item - Map itempublic PointMapItem getFreeForm3DItem()
public void setFreeForm3DPoint(GeoPoint point)
public GeoPoint getFreeForm3DPoint()
public boolean isFreeForm3DEnabled()
public boolean onScale(ScaleGestureDetector detector)
ScaleGestureDetector.OnScaleGestureListeneronScale in interface ScaleGestureDetector.OnScaleGestureListenerdetector - The detector reporting the event - use this to retrieve extended info
about event state.public boolean onScaleBegin(ScaleGestureDetector detector)
ScaleGestureDetector.OnScaleGestureListeneronScaleBegin in interface ScaleGestureDetector.OnScaleGestureListenerdetector - The detector reporting the event - use this to retrieve extended info
about event state.public void onScaleEnd(ScaleGestureDetector detector)
ScaleGestureDetector.OnScaleGestureListenerScaleGestureDetector.getFocusX() and
ScaleGestureDetector.getFocusY() will return the location of the pointer
remaining on the screen.onScaleEnd in interface ScaleGestureDetector.OnScaleGestureListenerdetector - The detector reporting the event - use this to retrieve extended info
about event state.public boolean onDoubleTap(android.view.MotionEvent event)
onDoubleTap in interface android.view.GestureDetector.OnDoubleTapListenerpublic boolean onDoubleTapEvent(android.view.MotionEvent event)
onDoubleTapEvent in interface android.view.GestureDetector.OnDoubleTapListenerpublic boolean onSingleTapConfirmed(android.view.MotionEvent event)
onSingleTapConfirmed in interface android.view.GestureDetector.OnDoubleTapListenerpublic void onScaleEvent(MapEvent event)
MapTouchEventListenerevent - MapEvent.MAP_SCALE eventpublic void lockScaleFocus()
public void lockScaleFocus(int pixelx,
int pixely)
public void unlockScaleFocus()
public boolean getInGesture()
public boolean isLongPressDragging()
public void cancelMotionEvents()
public void setToolActive(boolean toolActive)
public void skipDeconfliction(boolean skip)
public boolean isNadirClamped()